Jump to content

cab

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cab's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. cab

    Combining Data

    I'm sorry i'm really new at PHP and i'm kind of self-teaching from a book i bought. What exactly are "addslashes"
  2. 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......
  3. Like i said i'm new at this, so i hope this is the code you were refering to...... $connection = mysql_connect($host,$user,$password)       or die ("couldn't connect to server");     $db = mysql_select_db($database,$connection)       or die ("Couldn't select database");     $query = "INSERT INTO customer (first_name,last_name,email,address1,address2,city,state,zip,phone)                     VALUES ('$first_name','$last_name','$email','$address1','$address2','$city','$state','$zip','$phone')";     $result = mysql_query($query)       or die ("Couldn't execute query.");     echo "Thank You
  4. I am very new to PHP (self learning) and I am having a problem with a form I am setting up to collect customers information to opt in for a newletter. I can record all data to my database except an email address. I have not put any restrictions on my data types yet since i was just testing this out. I can save "words" to the "email" column of my database but if i do a formal email address with both the (at) and the (dot com) it gives me a "403 forbidden error" "Server configuration does not allow access to this page." I contacted my web hosting company and asked them if there was an error on their end and they said it had to be in my code (attached below). Please let me know if there is any reason why I could save (cbauer22@gmail.c but i can not save cbauer22@gmail.com) to a mysql database. Thanks $labels = array( "first_name"=>"First Name:", "last_name"=>"Last Name:", "email"=>"Email Address:", "address1"=>"Street Address Line 1:", "address2"=>"Street Address Line 2:", "city"=>"City:", "state"=>"State:", "zip"=>"Zip Code:", "phone"=>"Phone Number:"); echo "<p align='center'> <b>Please enter your information below.</b><hr>"; echo "<form action='saveaddress.php' method='POST'> <table width='95%' border='0' cellspacing='0' cellpadding='2'>\n"; foreach($labels as $field=>$label) { echo "<tr> <td align='right'> <B>{$labels[$field]} </br></td> <td><input type='text' name='$field' size='65' maxlength='65' ></td> </tr>"; } echo "</table> <div align='center'><input type='submit' value='Submit Information'> </div> </form>";
×
×
  • 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.