0

I'm sure this has been answered on stack before but I don't know the proper terms to use to find my desired results.

I want to take a value in a url and input it into my php script. So if I goto:

http://mydomain/search.php='MYSEARCHQUERY'

The search.php would take the MYSEARCHQUERY as a value.

<?php 
$html=file_get_contents('http://anotherwebsite/MYSEARCHQUERY'); 
?>

1 Answer 1

3

The URL would be something like:

http://mydomain/search.php?query=MYSEARCHQUERY

and the PHP:

$html = file_get_contents('http://anotherwebsite/' . $_GET['query']); 
Sign up to request clarification or add additional context in comments.

1 Comment

Was about to downvote, but your edit was quickly pushed to my browser. +1 where it's deserved

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.