hidden message [php]

technokid88

Part of a System
Joined
15 Feb 2006
Messages
741
OK here is what i need to do.

I have a form put in more then one location on a site. The info gets emailed to the admin of the site.

I am trying to put a hidden message in the php form that the person inputing the info cant see, but only the admin can see in this email. Any help would be much appreciated. I don't think this is too hard either but kind of rusty on my php.

Each form will have a different message the that can be added by editing the code.
 
Last edited:

Perris Calderon

dealer
Staff member
Political Access
Joined
24 Jan 2002
Messages
12,374
can you zip it up in a password protected file?

you can of course use a white font which he'll highligt to see what you want him to see but anyone can access once they know
 

SPeedY_B

I may actually be insane.
Joined
31 Mar 2002
Messages
15,804
So you basically have some fields, which are e-mailed to an address, and you wish to add additional text to the submitted information?

Can you post the code you're using to send the e-mail, and also exactly what extra you need sending.
 

technokid88

Part of a System
Joined
15 Feb 2006
Messages
741
code.........
--------
Code:
<form action="register.php" method="post" onSubmit="return validate()">
  <p>Username: <span class="style1 style5">*</span><br />
    <input type="text" name="username" size="20">
    <br>
Password: <span class="style1 style5">*</span><br />
<input type="password" name="password" size="20">
<br>
First Name: <span class="style1 style5">*</span><br />
    <input type="text" name="name1" size="20">
    <br>
    Last Name:<span class="style1 style5"> *</span><br />
    <input type="text" name="name2" size="20">
    <br>
    E-mail <span class="style1 style5">*</span><br />
    <input type="text" name="email" size="20">
 
  <br>Phone <span class="style1 style5">*</span><br />
    <input type="number" name="phone" size="20">
    <br>
    Cell <br />
    <input type="number" name="cell" size="20">
    <br>
    Street Address<br>
    <input type="text" name="street" size="50">
    <br>City<br>
    <input type="text" name="city" size="20">
    <br>
    State<br>
    <input type="text" name="state" size="10">
    <br>
    Zip<br>
    <input type="number" name="zip" size="15">
    <br>
    <br />
    <input type="submit" value="Sign Up">
Code:
<?php 

include("config.php"); 

// connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());

// select the database
mysql_select_db($database)
or die ("Could not select database because ".mysql_error());

// check if the username is taken
$check = "select id from $table where username = '".$_POST['username']."';"; 
$qry = mysql_query($check)
or die ("Could not match data because ".mysql_error());
$num_rows = mysql_num_rows($qry); 
if ($num_rows != 0) { 
echo "Sorry, there the username $username is already taken.<br>";
echo "<a href=register1.php>Please try again</a>";
exit; 
} else {

// insert the data
$insert = mysql_query("insert into $table values ('NULL', '".$_POST['username']."', '".$_POST['password']."', '".$_POST['name1']."', '".$_POST['name2']."', '".$_POST['email']."', '".$_POST['phone']."', '".$_POST['cell']."', '".$_POST['street']."','".$_POST['city']."','".$_POST['state']."', '".$_POST['zip']."')")
or die("Could not insert data because ".mysql_error());

$to      = 'admin@whatever.com';
$subject = 'New Registration';
$message = $_POST['username'] . " " . $_POST['password'] . " " . $_POST['name1'] . " " . $_POST['name2'] . " " . $_POST['email'] . " " . $_POST['phone'] . " " . $_POST['cell'] . " " . $_POST['street'] . " " . $_POST['city'] . " " . $_POST['state'] . " " . $_POST['zip'];
$headers =  'From: admin@whatever.com' . "\r\n" .
                 'Reply-To: admin@whatever.com' . "\r\n" .
                 'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);

// print a success message
echo "Your user account has been created for bla blah.com!<br>"; 
echo "Now you can <a href=login1.php>log in</a>"; 
}

?>
well ill have this code in diffrent areas of the site

All i want is a message sent to admin of the site. But the message is hidden from the public.

What i want to check is .. what areas bring the person to register for the site.

So if they choice to go to a page and registers ill have a message "resisted through page 1".

i know you can just pass the image name as a variable in the url... but don't want to do it like that... i have some extra stuff in between the image they click and the forms.
 
Last edited:

Ferretlovers

Giver of 2 Cents
Joined
6 Mar 2004
Messages
40
On top of what LordofLA said you can also take that hidden value and make it an arbitrary value that is per page(if you have any type of ID# on each of your pages you could use that) and then within register.php use some code to look at a table of these id's and match it up with the value that you want returned for that page. This would make it so that each page needs it's own number as well as that number needs entered on each page. This may not work if your pages are dynamically created(i.e. forums where showthread.php is used to show every thread, you would be able to tell by file that called it, but not necessarily what page called it).

This would make it so that if a user looks at the source of the page the only thing they would see is a number that means nothing to them, but when you receive the email it says exactly what you want it to.
 

technokid88

Part of a System
Joined
15 Feb 2006
Messages
741
Thanks man.. works for me... i knew after you go sleep and you wake up you could figure it out... lol

ok worked perfect thanks for you help lorofla...
 
Last edited:

Members online

No members online now.

Latest profile posts

Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!
Perris Calderon wrote on Electronic Punk's profile.
EP, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there!

Forum statistics

Threads
61,997
Messages
673,411
Members
5,591
Latest member
nodee