View Full Version : click on a button

07-14-2008, 06:54 PM
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

07-14-2008, 07:00 PM
I think you're looking for file_get_contents()

$file = file_get_contents('http://www.google.ca');
echo $file;


07-14-2008, 07:02 PM
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.

07-14-2008, 07:29 PM
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


(well, i think i am anyway)

07-14-2008, 07:50 PM
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.