Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving data from the URL

Status
Not open for further replies.

Sitehelp

Technical User
Joined
Feb 4, 2004
Messages
142
Location
GB
Ok so now new question, if u copy a result from Javascript across the URL, can you retrieve the data through PHP???? if so how, is it just the normal way???? Cheers all!
 
if you are transferring data across with the url, use the $_GET['varname'] to access the data, the do what you want with it...

Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
Excellent cheers this worked! Once I retrieved it into my form how can I set another txt box below to a string automatically. For example if HARDWARE was inserted the textbox below will print GREEN if its SOFTWARE then AMBER and if NETWORK then RED etc etc... If I could get this working I would be dead happy! I presume its using an IF statement but I am unsure how to get it all working correctly. Cheers!
 
<?php
$entered_text = $_GET[&quot;var_from_other_page&quot;];

if ($entered_text == &quot;HARDWARE&quot;)
{
?>text box that has green color<?php
}
elseif($entered_text == &quot;SOFTWARE&quot;)
{
?>text box that has amber color<?php
}
etc...
?>

hope this is what you mean

David Kuhn
------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top