FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


using variables





darth_revan
well, the topic may seem weird, but i cannot use variables.

i know how to use variables normally.

but, for example, when i want a variable in such codes, i'm having problems;
Code:

$album = $_GET['addcm'];
echo '<form action="music.php?add=cm&id=$album" method="post">';


it dont work. i tried id=\'$album\', '$album' and such, but none seems to work. How can i solve that?
DanielXP
try

Code:
$album = $_GET['addcm'];
echo "<form action='music.php?add=cm&id=$album' method='post'>";
Nyizsa
DanielXP wrote:
try

Code:
$album = $_GET['addcm'];
echo "<form action='music.php?add=cm&id=$album' method='post'>";

I hope you have spotted the difference between single an double quotes. But there's an other way to do it:
Code:
$album = $_GET['addcm'];
echo ('<form action="music.php?add=cm&id='.$album.'method=post">');

Again, watch for those quotes, and make sure that .$album. is not enclosed in any of them.
darth_revan
oh, thanks a lot. The code seems to be working fine now
Related topics
PHP Toturail
Mail with PHP (Simple Tutorial)
Using mail() func on Frihost
SUPER FLASH STORE {CLOSED}
using PHP $_SERVER commands for phpbb login
Php Calculations
Session handlers in Frihost using Python? Help Needed!
PhP/mySQL problem need help!
Receive the same email domain but the account does not exist
4 Java Tutorials (Have added a new one.)
help with 'loops on variable variables'
problem with get variables!
Storing IPs in mysql
Have Notepad In Send To
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.