Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    click on a button

    hey,
    very basic question (i hope)
    i want to create a php page that will load an external web page, select an option from a drop-down and click the submit button to select the option i have just picked.

    i'm no programmer so help on this would be great

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts
    I think you're looking for file_get_contents()
    PHP Code:
    $file file_get_contents('http://www.google.ca');
    echo 
    $file
    http://www.php.net/manual/en/functio...t-contents.php

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Okay and what have you tried? This forum is for helping people who've tried things on their own not to just give code. If you want something custom then consider hiring someone. You will need to figure out how to post to a php script. Once you figure that out you can use a php header() call to send the user to the selected page.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, like i say i'm no programmer, just looking to do up a website.

    i was looking at using javascript and "getElementById" but wanted to use serverside php

    so i'm just looking for a php version like

    document.getElementById('myselection').click()
    document.getElementById('submit').click()


    (well, i think i am anyway)

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    There is no way in PHP to detect events from the browser. Flood has some code above that will let you read the file in, but you will still need javascript to give it a more animated or interactive feel to it. To create the most seamless feel, you will want to use an AJAX technique that allows you to fetch the new data to populate the textarea or div with.
    If you have something more along the lines of a replacement (say a top header thats always the same), a simple include/require will allow you to include and parse another PHP script into that location - similar to how a server side include works in cgi.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •