PDA

View Full Version : Trying to grab "?what=ever" from query url


jimrains
06-20-2003, 08:28 AM
Trying to grab "?what=ever" from query url

How can I from client side "page.htm" link to server side "adid.php" and make the var "$adid" and it's value usable in "page.htm"? Trying to grab
"?adid=???" from linking url without using cookie.

page.htm
<html><head></head>
<body>
<a href=........
or
<script language=javascript.......
or
<how ever.......

</body></html>


adid.php
<html><head>
<?php
$adid=$_GET['adid'];
?>
</head><body>
</body></html>


Thanks for your help to a real newbie!!:) :confused: :confused: :confused:

SpeedFreak
06-20-2003, 03:18 PM
ok - i am not really sure what you are trying to do but i think you want the php file to pass a variable to a html file?

if thats the case - why not make both files php? in the first file that passes the variable put the following:


<?
$var = "whatever"

echo "<a href=\"page.php?what="
echo $var
echo "\">Go to page</a>"
?>


where $var is the information you want to send and ?what is the variable that page.php will retrieve.
In page.php $what will have a value of whatever you put in the url (in this case it will have a value of "whatever")

Cheers

jimrains
06-20-2003, 04:09 PM
I'm trying to get the linking url variable "?adid=001" useable in page.htm. I understand changing page.htm to page.php will work, but is there not a way to link from page.htm to the server side adid.php, either with javascript, href or something, to make the var "$adid" available to page.htm?

Thanks :confused: :confused:

sage45
06-20-2003, 08:09 PM
Yes there is... However, this post should have originally been posted within the Javascript portion of the forum... The answer you seek can be found here:

http://javascriptkit.com/javatutors/send1.shtml

Now forwarding this post to the Javascript help forum...

-sage-

jimrains
06-21-2003, 03:12 AM
Thanks for the pointer and I'm sorry for posting in the wrong forum.:thumbsup: