am i missing something obvious !!!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

mike-grant
New php-forum User
New php-forum User
Posts: 2
Joined: Wed Jul 02, 2003 3:40 am

am i missing something obvious !!!

Postby mike-grant » Wed Jul 02, 2003 4:03 am

i have a page that use an include which works fine however i am trying to insert a keyword into a link am i missing something as the first part finds the keyword with no problems but the second part where it inserts into the url doesn't.
any help would be great.

url would look like this:

http://www.mydomain.com/page3.php?keyword=anything

my include looks like this

Code: Select all

<?php
print "Why not try searching another site for ".$HTTP_GET_VARS['keyword'];
?>
<a href="http://myserver.com/myScript.php?keyword="<?php print $HTTP_GET_VARS['keyword'];?>>search now</a>


so it looks like this in the page

Why not try searching another site for "keyword" search now

can anyone tell me why it wont insert into the link but will display on the page.

phPMaster
New php-forum User
New php-forum User
Posts: 4
Joined: Wed Jul 02, 2003 2:23 am

Postby phPMaster » Wed Jul 02, 2003 4:17 am

Try the folowing code :D


Code: Select all

<?php
print "Why not try searching another site for ".$HTTP_GET_VARS['keyword'];
?>
<a href="http://myserver.com/myScript.php?keyword=<?php print $HTTP_GET_VARS['keyword'];?>">search now</a>

mike-grant
New php-forum User
New php-forum User
Posts: 2
Joined: Wed Jul 02, 2003 3:40 am

Postby mike-grant » Wed Jul 02, 2003 4:25 am

works great thanks


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests