Jump to content

[SOLVED] Cookie data not displaying...


acctman

Recommended Posts

The cookie data is not being displayed in the register.html file, is there something wrong with my coding?

 

<?php

/* 

  File refer.php

  www.domain.com/refer.php?m=UserName

*/

 

$rmbuser = $_REQUEST['m'];

 

if (isset($_COOKIE["rmbreferral"]))

    header ("Location: http://www.domain.com/register.html");

else

    setcookie ("rmbreferral", $rmbuser, strtotime("+30 days")); 

    header ("Location: http://www.domain.com/register.html");

?>

 

I added this to the register.html file.

Referred By:<input type=text name=edit[ref_by] size=30 value='<? echo $_COOKIE['rmbreferral']; ?>'>

 

Link to comment
Share on other sites

i'm using a linux server editing an exisiting register.html file, i'm looking at the file now and see that its parsing php coding in other locations like this

 

<? global $countries; foreach ($countries as $key => $value) echo "<option value='".$key."' ".($en['country'] == $key ? ' selected' : '').">".htmlentities($value['name'],ENT_QUOTES)."</option>"; ?>

 

so i'm thinking is my coding correct?

Link to comment
Share on other sites

if i put <? echo $_COOKIE['rmbreferral']; ?> outside of the input value property it shows the referral it just wont parsing if i put it as

<input type=text name=edit[ref_by] size=30 value='<? echo $_COOKIE['rmbreferral']; ?>'>

 

any idea why?

 

 

Link to comment
Share on other sites

Solved:

I had to format the coding like below. it wouldn't work if all on one line.

<tr><td class=regform>Referred By:</td><td><input type=text name=edit[ref_by] size=30 value='

<?

echo $_COOKIE["rmbreferral"];

?>

' disabled></td></tr>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.