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

imagekrazy
imagekrazy used Ask the Experts™
on
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 .
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

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

Author

Commented:
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?

Commented:
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

Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
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

Author

Commented:
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?

Author

Commented:
// 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>
Commented:
You do not need to send it to your email. You should use a database to save users and use a field for recommended user. Then you can just look in the database who recommended your website to wich user.

Author

Commented:
thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial