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
https://forums.phpfreaks.com/topic/20395-combining-data/
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
https://forums.phpfreaks.com/topic/20395-combining-data/#findComment-89843
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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