Php code issue

Newbie Member
14Dec2009,20:52   #1
mojo142's Avatar
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?
Go4Expert Founder
15Dec2009,09:33   #2
shabbir's Avatar
Moved your attachment code into post
Ambitious contributor
15Dec2009,16:19   #3
venami's Avatar
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
Skilled contributor
24Jan2010,20:24   #4
ManzZup's Avatar
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 ?>" />