Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Not showing Session messages in php.
Old 02-17-2010, 01:58 AM Not showing Session messages in php.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
HI.

I am running this condition.....
PHP Code:
session_start(); 

if (
$_POST["verifycode"] != $_SESSION["vercode"])  

    
    
$_SESSION["msg"] = "Wrong Captcha Code! Please Try Again.";
    
    
$url =  "../register.php";

        
header("Location: $url");
        
        die;
}; 
I want this $_SESSION["msg"] to be displayed on register.php

I am calling it here on register.php

PHP Code:
<font color="#ff761c"> <?php  
                    
if($_SESSION["msg"]!="")
                    {
                        echo 
$_SESSION["msg"];
                        
$_SESSION["msg"]="";
                    }
                
?></font>
Its sending me back to register.php as per the function, but its not displaying message...."Wrong Captcha Code! Please Try Again"

Your help would be highly appreciated.

Thanks
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-17-2010, 08:28 AM Re: Not showing Session messages in php.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Is anybody here!....
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 02-17-2010, 08:30 AM Re: Not showing Session messages in php.
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
do you have <?php session_start(); ?> at the VERY top of your page?
maybe even above any HTML.

Also, This is something I do but may not be needed..
Is:

Instead of using " i use ' in the session var.
IE:

NOT $_SESSION["foo"] = "Hello";

I use $_SESSION['foo'] = "Hello";
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE



Last edited by lynxus; 02-17-2010 at 08:32 AM..
lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 02-18-2010, 08:58 AM Re: Not showing Session messages in php.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Thanks, I'll try and let you know.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 02-19-2010, 01:13 AM Re: Not showing Session messages in php.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Quote:
Originally Posted by lynxus View Post
do you have <?php session_start(); ?> at the VERY top of your page?
maybe even above any HTML.

Also, This is something I do but may not be needed..
Is:

Instead of using " i use ' in the session var.
IE:

NOT $_SESSION["foo"] = "Hello";

I use $_SESSION['foo'] = "Hello";
Thanks Its working now.....
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Not showing Session messages in php.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21163 seconds with 12 queries