Jump to content

Combining Data


cab

Recommended Posts

Don't ask why i'm doing my email address this way :) (problems storing it normally) but anyways....

echo "<tr>
          <td align='right'> <B>Email</br></td>
          <td><input type='text' name='email1' size='30' maxlength='65' >
            &nbsp;@ &nbsp;<input type='text' name='email2' size='26' maxlength='65' ></td>
          </tr>";

  $expemail = $_POST['expemail1']."@";
  $expemail .= $_POST['expemail2'];

Will this code above combine "email1" and "email2" into the variable "email" which can then be stored in the database?

Please advise......
Link to comment
Share on other sites

Just to add to the above this should also work..

$expemail = $_POST['expemail1']."@".$_POST['expemail2'];


but this would be a safer option also

$expemail = mysql_real_escape_string($_POST['expemail1']."@".$_POST['expemail2']);

This will escape alot a bas stuff before you insert into your DB

Regards
Liam
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.