Link to home
Start Free TrialLog in
Avatar of imagekrazy
imagekrazy

asked on

How do I write a code in my order form that acknowledge it is from some that recommeds that page

I want to know what is the best way of writing a code in my form  that lets me know that it is from a paticulair person who recommends that page .
Avatar of Kamshak
Kamshak

What exactly do you want to make? A form where you can enter recommendations and you want to know from what person it is?
Avatar of imagekrazy

ASKER

Lets say, i want to sign up people to sell my product and they  got a customer for me how do i know its from him or her?
You can give them a specific link. For example: http://your-site.com/signup.php?ref=User123. At signup.php you just check if $_GET['ref']is set.  Then you you can read the user out.

Example:
<?php
//Your form here
//Your validation here
//if everything is valid:
if(isset($_GET['ref'])){
     echo "This user found your site because of the user {$_GET['ref']}";
}

Open in new window

sorry forgot the ?>
<?php
//Your form here
//Your validation here
//if everything is valid:
if(isset($_GET['ref'])){
     echo "This user found your site because of the user {$_GET['ref']}";
}
?>

Open in new window

So are you saying , I will give out the webpage address with a user id so it can be user 123 user 124 etc..
Then i make a signup.php file and i can send that signup.php file to my email?
// so i add the form  like this
<body>
</form>
<form action="signup.php" method="post">
<div align="center">
  <p>
   
</p>
  <table width="350" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <th width="113" scope="row">&nbsp;</th>
      <td width="237">Description:</td>
    </tr>
  </table>
  <table width="680" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <th width="90" height="32" bgcolor="#0091D7" scope="row"><div align="left" class="style1">Name:</div></th>
      <td width="186" bgcolor="#99CC00"><input type="text" name="name2" /></td>
      <td width="12" rowspan="4" bgcolor="#666666">&nbsp;</td>
      <td colspan="2" rowspan="3"><div align="right">
        <textarea name="description" id="description" rows="6" cols="55">
          </textarea>
      </div></td>
    </tr>
    <tr>
      <th height="38" bgcolor="#666666" scope="row"><div align="left">AGE:</div></th>
      <td bgcolor="#708101"><input type="text" name="age2" /></td>
    </tr>
    <tr>
      <th bgcolor="#708101" scope="row"><div align="left">LOCATION:</div></th>
      <td bgcolor="#0094D9"><input type="text" name="location2" /></td>
    </tr>
    <tr>
      <th bgcolor="#99CC00" scope="row"><div align="left">E-MAIL:</div></th>
      <td bgcolor="#666666"><input type="email" name="email2" /></td>
      <td bgcolor="#000000">&nbsp;</td>
      <td width="277" bgcolor="#000000"><div align="center">
        <input type="submit" /></div></td>
         </tr>
  </table>
  </div>
 </form>

<?php
//Your form here


//Your validation here
//if everything is valid:
if(isset($_GET['ref'])){
     echo "This user found your site because of the user {$_GET['ref']}";
}
?>

</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of Kamshak
Kamshak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you