Results 1 to 7 of 7

Thread: Cookie code, whats wrong?

Threaded View

  1. #1

    Thread Starter
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Question Cookie code, whats wrong?

    whats wrong with my cookie code? I am pretty sure my code SHOULD work 100%, yet it doesn't.....
    Code:
    <?php
    if ( $_GET["RSN"] == "" || $_GET["RSN"] == "null")
    {
    	$username = $_COOKIE["TipMeName"];
    	//echo '<script type="text/javascript">alert("Getting An Allready Set Cookie: '.$_COOKIE["TipMeName"].'")</script>';
    } else { 
    	setcookie("TipMeName", $_GET["RSN"] , time()+5184000 );
    	header( 'refresh: 0; url=/1/' );
    	//echo'<script type="text/javascript">alert("Setting A New Cookie: '.$_COOKIE["TipMeName"].' - '.$_GET["RSN"].'")</script>';
    }
    
    
    if (isset($_COOKIE["TipMeName"]))
    {
      echo
    		'
    		<fieldset>
    		<table border="0" width="100%">
    			<tr>
    				<td>
    				<p align="center"><font size="2">Your RS Name Is:"' .$username. '"</font><br>
    				<form action="#" method="get">
    				RSN: 
    				<input type="text" name="RSN" size="20">
    				<input type="submit" value="Change It">
    				</form>
    				</p>
    				</td>
    			</tr>
    		</table>
    		</fieldset>
    		';
    } else {
      echo
    				'
    				<fieldset>
    		<table border="0" width="100%">
    			<tr>
    				<td>
    				<p align="center"><font size="2">---text goes here the i removed-- 
    				tools.</font></td>
    			</tr>
    			<tr>
    				<td>
    				<p align="center"><b><font size="2" color="#FF0000">No RS Username is set!</font></b><br>
    				<form action="#" method="get">
    				RSN: 
    				<input type="text" name="RSN" size="20">
    				<input type="submit" value="Save Name">
    				</form>
    				</p>
    				</td>
    			</tr>
    		</table>
    		</fieldset>
    		';	
    }
    ?>
    Last edited by wiz126; Jan 28th, 2007 at 12:10 PM.
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width