Php code issue

mojo142's Avatar, Join Date: Dec 2009
Newbie Member
Hi,

here in the attachment i have put the original link and php code by me please take a look and let me know what is wrong. I am not able to post that thing due to links in it so please just take a look.

PHP Code:
Hi this is the code of php which i am using

original

value="http://www.abc.com/page/123456"


code:

<?php
$url 
$_GET['id'];
echo 
"value="http://www.abc.com/page/$url";
?>

But this is not working. Anything wrong here?
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Moved your attachment code into post
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
Quote:
Originally Posted by mojo142 View Post
PHP Code:
code:

<?php
$url 
$_GET['id'];
echo 
"value="http://www.abc.com/page/$url";
?>

But this is not working. Anything wrong here?
The echo statement should be like below:
PHP Code:
echo "value=http://www.abc.com/page/$url"
You have wrongly used the double quotes. There are three double quotes in your echo statement instead of 2.

Last edited by venami; 15Dec2009 at 16:21.. Reason: Missed the explanation
ManzZup's Avatar, Join Date: May 2009
Skilled contributor
i thnk hez rite but in case you are trying to assagn a value to a control like a button

<input type="button" value="<?php echo "http://www.abc.com/page/" .$url ?>" />