Jump to content

[SOLVED] session variable


waz

Recommended Posts

how am i surpose to set a variable from the previous page  check if its same as before if it is then leave the session variable at same value if not change it to $_post['text'] which is the new value to use .

 

but code doesnt seem to work anyone know why.

<php

session_start();

if($_SESSION['Test'] <> $_POST['textfield']) {

    echo $_POST['textfield'] && " is not same as the session which is " && $_SESSION['Test'];

}else{ $_SESSION['Test'] = $_POST['textfield'];

}

?>

 

 

its really that simple but i cant seem to get it to remeber also its on a php self form

 

thanks waz

Link to comment
https://forums.phpfreaks.com/topic/55323-solved-session-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.