Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Php code issue (http://www.go4expert.com/forums/php-code-issue-t20367/)

mojo142 14Dec2009 20:52

Php code issue
 
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 15Dec2009 09:33

Re: Php code issue
 
Moved your attachment code into post

venami 15Dec2009 16:19

Re: Php code issue
 
Quote:

Originally Posted by mojo142 (Post 61683)
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.

ManzZup 24Jan2010 20:24

Re: Php code issue
 
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 ?>" />


All times are GMT +5.5. The time now is 00:02.