Sunday, 24 March 2019

Notice: Undefined variable: var in F\wamp\www\project\filename.php in PHP/WAMP

I got the following problem when I was migrating from WAMP server 2 to WAMP Server 3 version in my project.



Code I was written that -

<?php $var=$_GET['ll']; ?> //getting value from another page in a variable

<?php echo $var; ?> //Printing the value on page

This code segment has problem, when my project was developed in WAMP Server 2

I just replace this code segment in WAMP server 3 to resolve this issue.


<?php 
if(isset($_GET['ll'])){
    $var = $_GET['ll'];
}
?>


<?php 
if(isset($var)){ 
    echo $var;
}
?>


No comments:

Post a Comment

Change image source dynamically on hyperlink

 Changing image source dynamically using JQuery. Here in this example I have created there hyperlink and stored all images in the same folde...