introduction screenshots faq forum blog modules components download
Please use the search function and/or read the FAQ first.

Go to Topic: PreviousNext
Go to: Message ListNew TopicSearchLog InPrint View

Notice: Undefined variable



Posted by: bledhuk
February 20, 2010 10:13PM
My error
Notice: Undefined variable: var_uang in D:\EasyPHP-5.3.1\www\bukutamu\2.php on line 3
anybody can solve my problem



my script
1.php
<?php

$uang = "Rp 15.000";
echo "<a href=\"2.php?var_uang=$uang\">
uang ditampilkan di 2.php</a>";

?>

2.php
<?php

echo "$var_uang";

?>
Options: ReplyQuote
Posted by: Amour
February 21, 2010 09:05AM
Into 2.php, $var_uang don't exists... you must use $_GET['var_uang'] because you use GET method ;)

Also, if you use a form and POST method, you will use $_POST vars.
Options: ReplyQuote
Posted by: ioeasy
June 23, 2011 05:57PM
You need call the value with a request value

<?php

$uang = "Rp 15.000";
echo "<a href=\"".$_SERVER['PHP_SELF']."?var_uang=$uang\">
uang ditampilkan di 2.php</a>";

?>


<?php
$var_uang=$_REQUEST['var_uang'];
echo "$var_uang";

?>

;)
Options: ReplyQuote


Go to: Message ListSearchLog In
Your Name: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.