Jump to content

aebstract

Members
  • Posts

    1,105
  • Joined

  • Last visited

Posts posted by aebstract

  1. $result = mysql_query("INSERT INTO users (firstname,midname,lastname,email,password,date_signup,ip_signup,country,address1,address2,city,state,postal,telephone)".
    "VALUES ('$firstname', '$midname', '$lastname', '$email', '$password', 'now()', '$ipsignup', '$country', '$address1', '$address2', '$city', '$state', '$postal', '$telephone')") or DIE(mysql_error());
    
    $result2 = mysql_query("INSERT INTO map_users_roles (users_id,roles_id)".
    "VALUES ('mysql_insert_id()', '3')") or DIE(mysql_error());
    

     

    Okay, with that function in, it is placing '0' in the column. I also tryed mysql_insert_id(users_id) thinking that maybe I had to put the column name in place? What am I doing wrong here?

  2. Hello,

    I am entering information in to a database. Everything enters 100% fine, the first column is an auto_increment id number. What I want to do is enter information in to another table, but I need to use that id number that is generated in one of the columns. (and it has to be pretty much instant with the first one, its for a register form) Is this possible? If so, how would I do it? Thanks!

  3.  

     

    html {
    height: 100%;
    }
    
    body {
            text-align: center;
    	background: #4d4d4d;
    }
    
    
    
    .banner {
    position: relative;
    top:20px;
    left:50px;
    right:50px;
    float: left
    }
    
    .container {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    }
    
    
    .left {
    position: relative;
    text-align: center;
    float: left
    
    }
    
    .center {
    position: relative;
    float: left
    }
    
    
    .right {
    position: relative;
    float: left
    }
    
    
    
    .footer {
    position: relative;
    bottom: 20px;
    
    }
    
    a {text-decoration: none}
    a:link     { color:#d0a700 }
    a:visited  { color:#d0a700 }
    a:active   { color:#d0a700 }
    a:hover    { color:#767676 }
    

     

     

     

    <div class="container">
    
    <div class="header">
    header stuff
    </div>
    
    <div class="left">
    left stuff
    </div>
    
    <div class="center">
    center stuff
    </div>
    
    <div class="right">
    right stuff
    </div>
    
    </div>
    

     

     

     

    Set the width you want your left, center and right divs. ( width: 000px; ) Also set the width of your header to the full width of the container ( everything ) and set your container's width to whatever you want it all to end up being. See how that works out.

  4. See, that is what I am trying to do, is pass them through a form.. though I am coming up short. I'll try and post the bits that are dealing with that here to make it easier to see:

     

     

    This part is after you click send on the form, ( the if submit comes in to play )

    if (isset ($_POST['submit'])) {
    $msg = $_POST['msg'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $email = $_POST['email'];
    $mail = $_POST['mail'];
    
    
    $query = "UPDATE contact SET readc='1' WHERE id=$mail;";
    mysql_query($query);
    
    
    mail ($email, 'Reply from HMG', $msg, 'From: info@hillmarketinggroup.com');
    header ("Location: readmail.php");
    
    }
    
    
    $mark = $_GET['mark'];
    if (isset($mark)) {
    $query = "UPDATE contact SET readc='1' WHERE id=$mark;";
    mysql_query($query);
    
    header("Location: readmail.php");
    }
    

     

     

     

     

    Okay, here is the part where, when you click an email address on the main section, you get this form:

    $mail = $_GET['mail'];
    if (isset($mail)) {
    
    $result = mysql_query("SELECT * FROM contact WHERE id=$mail") or DIE(mysql_error());
    while($r=mysql_fetch_array($result)) 
    { 
    $id=$r["id"];
    $firstname=$r["firstname"];
    $lastname=$r["lastname"];
    $email=$r["email"];
    $body=$r["body"];
    
    echo "
    <div id=uploadform>
    <table>
    <tr>
    <td align=right>To:</td><td width=5></td><td>$firstname $lastname</td>
    </tr><tr>
    <td></td><td></td><td>$email</td>
    </tr><tr>
    <td></td><td></td><td>
    <form action=readmail.php method=post>
    <input name=$mail type=hidden value=$mail>
    <input name=$firstname type=hidden value=$firstname>
    <input name=$lastname type=hidden value=$lastname>
    <input name=$email type=hidden value=$email>
    <textarea name=msg rows=5 cols=60></textarea><br />
    <input type=submit name=submit value=Send />
    </form>
    </td>
    </tr>
    </table>
    <div align=right><a href=readmail.php>back</a></div>
    </div>
    ";
    
    }
    
    } else {
    

     

    I closed that bit of code off at the else, because the first part you go to when visiting this page is in that else.

    Hope this helps out so that I can get some help :P

  5. Hello again,

    I have a setup where I am displaying lots of information, all of it comes from contact forms and is stored in a database. Then can be viewed on one page, through the scripts. One feature is that you can click on an email address to send an email to that specific user. When you click their email, the form comes up fine, and I have been playing with this for awhile.. I am having trouble getting the variables passed through so that I can send the email and update the database. If anyone could take a look at my code that would be great.

     

    <?php
    header("Cache-control: private");
    ?>
    <html>
    <head>
    <link href="stylesheet.css" rel="stylesheet" type=text/css title=default />
    </head>
    <body>
    <div id="concon">
    <?php
    
    mysql_connect("localhost","hmg","hillpass"); 
    mysql_select_db("hmg"); 
    
    
    if (isset ($_POST['submit'])) {
    $msg = $_POST['msg'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $email = $_POST['email'];
    $mail = $_POST['mail'];
    
    
    $query = "UPDATE contact SET readc='1' WHERE id=$mail;";
    mysql_query($query);
    
    
    mail ($email, 'Reply from HMG', $msg, 'From: info@hillmarketinggroup.com');
    header ("Location: readmail.php");
    
    }
    
    
    $mark = $_GET['mark'];
    if (isset($mark)) {
    $query = "UPDATE contact SET readc='1' WHERE id=$mark;";
    mysql_query($query);
    
    header("Location: readmail.php");
    }
    
    
    
    $mail = $_GET['mail'];
    if (isset($mail)) {
    
    $result = mysql_query("SELECT * FROM contact WHERE id=$mail") or DIE(mysql_error());
    while($r=mysql_fetch_array($result)) 
    { 
    $id=$r["id"];
    $firstname=$r["firstname"];
    $lastname=$r["lastname"];
    $email=$r["email"];
    $body=$r["body"];
    
    echo "
    <div id=uploadform>
    <table>
    <tr>
    <td align=right>To:</td><td width=5></td><td>$firstname $lastname</td>
    </tr><tr>
    <td></td><td></td><td>$email</td>
    </tr><tr>
    <td></td><td></td><td>
    <form action=readmail.php method=post>
    <input name=$mail type=hidden value=$mail>
    <input name=$firstname type=hidden value=$firstname>
    <input name=$lastname type=hidden value=$lastname>
    <input name=$email type=hidden value=$email>
    <textarea name=msg rows=5 cols=60></textarea><br />
    <input type=submit name=submit value=Send />
    </form>
    </td>
    </tr>
    </table>
    <div align=right><a href=readmail.php>back</a></div>
    </div>
    ";
    
    }
    
    } else {
    
    
    $result = mysql_query("SELECT * FROM contact WHERE readc='0' ORDER BY id ASC") or DIE(mysql_error());
    while($r=mysql_fetch_array($result)) 
    { 
    $id=$r["id"];
    $typec=$r["typec"];
    $readc=$r["readc"];
    $firstname=$r["firstname"];
    $lastname=$r["lastname"];
    $email=$r["email"];
    $body=$r["body"];
    $company=$r["company"];
    $website=$r["website"];
    $telephone=$r["telephone"];
    $address=$r["address"];
    $city=$r["city"];
    $state=$r["state"];
    $zip=$r["zip"];
    
    if ($typec == 0) {
    echo "
    <div class=\"contactdivred\"><a href=readmail.php?mark=$id>UNREAD</a></div>
    <div class=\"contactdiv\">
    <table class=\"contfont\">
    <tr>
    <td align=right>Name:</td><td width=5></td><td>$firstname $lastname</td>
    </tr><tr>
    <td align=right>Email:</td><td></td><td><a href=readmail.php?mail=$id>$email</a></td>
    </tr><tr>
    <td align=right valign=top>Message:</td><td></td><td>$body</td>
    </tr>
    </table>
    </div>
    ";
    } else {
    echo "
    <div class=\"contactdivred\"><a href=readmail.php?mark=$id>UNREAD</a></div>
    <div class=\"contactdiv\">
    <table class=\"contfont\">
    <tr>
    <td align=right>Name:</td><td width=5></td><td>$firstname $lastname</td>
    </tr><tr>
    <td align=right>Email:</td><td></td><td><a href=readmail.php?mail=$id>$email</a></td>
    </tr><tr>
    <td align=right valign=top>Message:</td><td></td><td>$body</td>
    </tr><tr>
    <td></td><td></td><td></td>
    </tr><tr>
    <td></td><td></td><td></td>
    </tr><tr>
    <td></td><td></td><td></td>
    </tr><tr>
    <td align=right>Company:</td><td></td><td>$company</td>
    </tr><tr>
    <td align=right>Website:</td><td></td><td>$website</td>
    </tr><tr>
    <td align=right>Telephone:</td><td></td><td>$telephone</td>
    </tr><tr>
    <td align=right>Address:</td><td></td><td>$address</td>
    </tr><tr>
    <td align=right>City:</td><td></td><td>$city</td>
    </tr><tr>
    <td align=right>State:</td><td></td><td>$state</td>
    </tr><tr>
    <td align=right>ZIP:</td><td></td><td>$zip</td>
    </tr>
    </table>
    </div>
    ";
    }
    
    }
    
    
    
    
    $result = mysql_query("SELECT * FROM contact WHERE readc='1' ORDER BY id DESC") or DIE(mysql_error());
    while($r=mysql_fetch_array($result)) 
    { 
    $id=$r["id"];
    $typec=$r["typec"];
    $readc=$r["readc"];
    $firstname=$r["firstname"];
    $lastname=$r["lastname"];
    $email=$r["email"];
    $body=$r["body"];
    $company=$r["company"];
    $website=$r["website"];
    $telephone=$r["telephone"];
    $address=$r["address"];
    $city=$r["city"];
    $state=$r["state"];
    $zip=$r["zip"];
    
    if ($typec == 0) {
    echo "
    <div class=\"contactdiv\">
    <table class=\"contfont\">
    <tr>
    <td align=right>Name:</td><td width=5></td><td>$firstname $lastname</td>
    </tr><tr>
    <td align=right>Email:</td><td></td><td><a href=readmail.php?mail=$id>$email</a></td>
    </tr><tr>
    <td align=right valign=top>Message:</td><td></td><td>$body</td>
    </tr>
    </table>
    </div>
    ";
    } else {
    echo "
    <div class=\"contactdiv\">
    <table class=\"contfont\">
    <tr>
    <td align=right>Name:</td><td width=5></td><td>$firstname $lastname</td>
    </tr><tr>
    <td align=right>Email:</td><td></td><td><a href=readmail.php?mail=$id>$email</a></td>
    </tr><tr>
    <td align=right valign=top>Message:</td><td></td><td>$body</td>
    </tr><tr>
    <td></td><td></td><td></td>
    </tr><tr>
    <td></td><td></td><td></td>
    </tr><tr>
    <td></td><td></td><td></td>
    </tr><tr>
    <td align=right>Company:</td><td></td><td>$company</td>
    </tr><tr>
    <td align=right>Website:</td><td></td><td>$website</td>
    </tr><tr>
    <td align=right>Telephone:</td><td></td><td>$telephone</td>
    </tr><tr>
    <td align=right>Address:</td><td></td><td>$address</td>
    </tr><tr>
    <td align=right>City:</td><td></td><td>$city</td>
    </tr><tr>
    <td align=right>State:</td><td></td><td>$state</td>
    </tr><tr>
    <td align=right>ZIP:</td><td></td><td>$zip</td>
    </tr>
    </table>
    </div>
    ";
    }
    
    }
    }
    ?>
    
    </div>
    </body>
    </html>
    

     

    Most of the mailing stuff if near the top.

    Thanks!

  6. Eh, sorry for so many questions today, I am having a bit of a coders block it seems :(

    I am pulling information from the database and displaying it, and I want to display all of it. Each will be in its own div.. the code is only displaying the last row in the db. I know I am missing something stupid but can anyone tell me what is wrong? Thanks.

     

    <html>
    <head>
    <link href="stylesheet.css" rel="stylesheet" type=text/css title=default />
    </head>
    <body>
    
    <?php
    
    mysql_connect("localhost","hmg","hillpass"); 
    mysql_select_db("hmg"); 
    
    $result = mysql_query("SELECT * FROM contact WHERE readc='0' ORDER BY id ASC") or DIE(mysql_error());
    while($r=mysql_fetch_array($result)) 
    { 
    $id=$r["id"];
    $typec=$r["type"];
    $readc=$r["read"];
    $firstname=$r["firstname"];
    $lastname=$r["lastname"];
    $email=$r["email"];
    $body=$r["body"];
    $company=$r["company"];
    $website=$r["website"];
    $telephone=$r["telephone"];
    $address=$r["address"];
    $city=$r["city"];
    $state=$r["state"];
    $zip=$r["zip"];
    $ip=$r["ip"];
    
    echo "
    <div id=\"contactdiv\">
    $firstname $lastname
    $email
    $body
    </div>
    ";
    
    }
    
    
    ?>
    
    
    </body>
    </html>
    

     

     

    edit: ps - I am sure I could do it with some for statement, but can't it be done with this while statement?

  7. 	
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read,firstname,lastname,email,body,company,website,telephone,address,city,state,' at line 1
    

     

    $query = "INSERT INTO contact (type,read,firstname,lastname,email,body,company,website,telephone,address,city,state,zip) VALUES ('0','0','$firstname','$lastname','$email','$body','$company','$website','$telephone','$address','$city','$state','$zip')";
    

     

     

    I had it there at first cause I wasn't sure if it had to be removed or not. This is the new code + the error message to go along with it.

  8. Okay, I did both changes that you guys mentioned. Here is the error I got, along with updated code:

     

    	
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read,firstname,lastname,email,body,company,website,telephone,address,city,state,' at line 1
    

     

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Hill Marketing Group - Atlanta Web Design Programming -  Websites  Banners  HTML  Mailers  Flash  E-Commerce  PHP CSS  MySQL</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <?php include ("meta.php"); ?>
    <link href="stylesheet.css" rel="stylesheet" type=text/css title=default />
    </head>
    
    <body>
    <div id="container">
    <div id="ctop">
    <div id="logotrans"><a href="http://hillmarketinggroup.com"><img src="logotrans.gif" border="0" title="Hill Marketing Group: Atlanta Web Design & Programming" alt="Hill Marketing Group: Atlanta Web Design & Programming" /></a></div>
    <div id="nav">
    <?php include ("nav.php"); ?>
    </div>
    </div>
    <div id="contentheader2">
      <div id="contentcatagory">contact</div>
    <div style="width:140px; height:35px; float:right; "><a href="requestquote.php"><img src="spacer.gif" border="0" /></a></div>
    </div>
    <div>
    <table width="735px" height="218px" cellpadding="0" cellspacing="0">
    <tr>
    <td width="19" style="background-image: url(leftcontentbg.jpg); "></td><td width="701" bgcolor="#FFFFFF" valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td> 
    
    
    
    
    
    <?php
    header("Cache-control: private");
    
    if(isset($sent)) {
    $content2 .= 'Your message has been sent.';
    }
    
    if(!isset($sent)) {
    
    
    
    if (isset ($_POST['submit'])) {
    $problem = FALSE;
    
    if ($problem == TRUE) {
    $content .= 'Errors:<br />';
    }
    
    
    
    if (empty ($_POST['firstname'])) {
    $problem = TRUE;
    $content .= 'Name is required<br />';
    }
    
    
    if (empty ($_POST['email'])) {
    $problem = TRUE;
    $content .= 'Email Address is required.<br />';
    }elseif (!preg_match("/.*@.*..*/", $_POST['email']) OR preg_match("/(<|>)/", $_POST['email']))
    {
    $problem = TRUE;
    $content .= 'The email address you chose was incorrect<br />';
    }
    
    
    
    if (empty ($_POST['body'])) {
    $problem = TRUE;
    $content .= 'You are required to submit a message.<br />';
    }
    
    
    if (!$problem) {
    
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $email = $_POST['email'];
    $body = $_POST['body'];
    $company = $_POST['company'];
    $website = $_POST['website'];
    $telephone = $_POST['telephone'];
    $address = $_POST['address'];
    $city = $_POST['city'];
    $state = $_POST['state'];
    $zip = $_POST['zip'];
    
    
    mysql_connect("localhost","hmg","hillpass"); 
    mysql_select_db("hmg"); 
    
    $query = "INSERT INTO contact (id,type,read,firstname,lastname,email,body,company,website,telephone,address,city,state,zip) VALUES ('null','0','0','$firstname','$lastname','$email','$body','$company','$website','$telephone','$address','$city','$state','$zip')";
    mysql_query($query) or DIE(mysql_error());
    
    
    
    
    $sendmail = "
    firstname - $firstname 
    email - $email
    
    
    
    $body";
    
    $sendmail2 = "Hi $firstname $lastname,
    This is an automatic message sent to confirm that your message has been sent and we will get back with you as soon as possible. 
    
    Thanks,
    Hill Marketing Group";
    
    mail ('mike.hill5@comcast.net', 'Contact Form', $sendmail, 'From: $email');
    mail ($email, 'Message received', $sendmail2, "From: info@hillmarketinggroup.com");
    
    
    header ("Location: index.php?menu=contact&sent");
    
    $content .= '<font size="2" face="Arial" color="#000000">Thank you for contacting us. Your message has been received.</font> <br />';
    
    
    } else {
    }
    }
    
    
    
    
    
    
    
    $content .= '
    
    
    
    
    <table width="350" border="0" align="center" cellpadding="4" cellspacing="3">
    
                                  <tr> 
    
                                    <td height="38" colspan="2" bgcolor="#FFFFFF"><p><font color="#333333"><font size="2" face="Arial, Helvetica, sans-serif"><strong><font color="#000000" size="3"><font size="2">HILL 
    
                                    MARKETING GROUP, LLC.</font></font></strong></font></font></p></td>
    
                                  </tr>
    
                                  <tr> 
    
                                    <td valign="top"width="63%" bgcolor="#F6F6F6"><font size="2" face="Arial, Helvetica, sans-serif"><strong> 
    
                                      General Info:<br><br>
    
                                      </strong> <div class="ccc"><a href="mailto:info@hillmarketinggroup.com">info@hillmarketinggroup.com</div><br>
    
                                      </a><br>
    
                                      </font><font size="2" face="Arial, Helvetica, sans-serif"><strong> 
    
                                      Careers:</strong><br><br>
    
                                      <div class="ccc"><a href="mailto:careers@hillmarketinggroup.com">careers@hillmarketinggroup.com</a></div><br>
    
                                      <br>
    
                                      </font></td>
    
                                    <td valign="top"width="37%" bgcolor="#F6F6F6"><p><font size="2" face="Arial, Helvetica, sans-serif"><strong> 
    
                                        Phone:</strong> <br>
    
                                        770.366.7532</font></p>
    
                                      <p><font size="2" face="Arial, Helvetica, sans-serif"><strong> 
    
                                        Fax:</strong><br>
    
                                        770.454.8589<br>
    
                                        <br>
    
                                        </font></p></td>
    								<td></td><td>
    								<form action="contact.php" method="post">
                              <table border="0" cellpadding="2">
    
                                <tr> 
    <td align="left" valign="middle" bgcolor="#eeeeee"><font size="1" face="Arial" color="#000000"><font size="1" face="Arial" color="#000000"><strong>Name</strong></font> </td><td valign="top" bgcolor="#FFFFFF"><input type="text" class="texta" name="firstname" maxlength="20" size="20" value="' . $_POST['firstname'] . '" /></td>
                                </tr>
                                <tr> 
    
    <td align="left" valign="middle" bgcolor="#eeeeee"><font size="1" face="Arial" color="#000000"><font size="1" face="Arial" color="#000000"><strong>E-Mail</strong></font> </td><td valign="top" bgcolor="#FFFFFF"><input type="text" class="texta" name="email" maxlength="50" size="20" value="' . $_POST['email'] . '" /></td>
                                </tr>
                                <tr> 
    <td align="left" valign="middle" bgcolor="#eeeeee"><font size="1" face="Arial" color="#000000"><font size="1" face="Arial" color="#000000"><strong>Message </strong></font></td><td valign="top" bgcolor="#FFFFFF"><textarea name="body" rows="3" cols="15" class="textfieldmsg"></textarea></td>
                                </tr>
    						<tr>
    						<td></td>
    						<td>
    						<input type="submit" name="submit" value="Talk To Us!" style="background-color: #525252;  border: 1px solid orange;  border-style:none; color: #FFFFFF; padding: 2px;" class="textsubmit" />
    						</td></tr>
                              </table>
    
    
    
    
    </form>
    								</td>
    
                                  </tr>
    </table>';
    
    
    }
    
    
    echo "$content";
    ?>
    </td>
                        <td> </td>
                      </tr>
                    </table>
    </td><td width="15" height="218" style="background-image: url(contentbgright.jpg); "></td>
    </tr>
    </table>
    </div>
    <div id="bottom2">
    <div id="copyright">
    <?php include ("copyright.php"); ?>
    </div>
    </div>
    </div>
    </body>
    </html>
    

  9. I have a contact form and I want the information to enter in to the database, though it isn't entering anything in to the database. My code for the page is listed below, much thanks for taking time to help!

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Hill Marketing Group - Atlanta Web Design Programming -  Websites  Banners  HTML  Mailers  Flash  E-Commerce  PHP CSS  MySQL</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <?php include ("meta.php"); ?>
    <link href="stylesheet.css" rel="stylesheet" type=text/css title=default />
    </head>
    
    <body>
    <div id="container">
    <div id="ctop">
    <div id="logotrans"><a href="http://hillmarketinggroup.com"><img src="logotrans.gif" border="0" title="Hill Marketing Group: Atlanta Web Design & Programming" alt="Hill Marketing Group: Atlanta Web Design & Programming" /></a></div>
    <div id="nav">
    <?php include ("nav.php"); ?>
    </div>
    </div>
    <div id="contentheader2">
      <div id="contentcatagory">contact</div>
    <div style="width:140px; height:35px; float:right; "><a href="requestquote.php"><img src="spacer.gif" border="0" /></a></div>
    </div>
    <div>
    <table width="735px" height="218px" cellpadding="0" cellspacing="0">
    <tr>
    <td width="19" style="background-image: url(leftcontentbg.jpg); "></td><td width="701" bgcolor="#FFFFFF" valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td> 
    
    
    
    
    
    <?php
    header("Cache-control: private");
    
    if(isset($sent)) {
    $content2 .= 'Your message has been sent.';
    }
    
    if(!isset($sent)) {
    
    
    
    if (isset ($_POST['submit'])) {
    $problem = FALSE;
    
    if ($problem == TRUE) {
    $content .= 'Errors:<br />';
    }
    
    
    
    if (empty ($_POST['firstname'])) {
    $problem = TRUE;
    $content .= 'Name is required<br />';
    }
    
    
    if (empty ($_POST['email'])) {
    $problem = TRUE;
    $content .= 'Email Address is required.<br />';
    }elseif (!preg_match("/.*@.*..*/", $_POST['email']) OR preg_match("/(<|>)/", $_POST['email']))
    {
    $problem = TRUE;
    $content .= 'The email address you chose was incorrect<br />';
    }
    
    
    
    if (empty ($_POST['body'])) {
    $problem = TRUE;
    $content .= 'You are required to submit a message.<br />';
    }
    
    
    if (!$problem) {
    
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $email = $_POST['email'];
    $body = $_POST['body'];
    $company = $_POST['company'];
    $website = $_POST['website'];
    $telephone = $_POST['telephone'];
    $address = $_POST['address'];
    $city = $_POST['city'];
    $state = $_POST['state'];
    $zip = $_POST['zip'];
    
    
    mysql_connect("localhost","hmg","hillpass"); 
    mysql_select_db("hmg"); 
    
    $query = "INSERT INTO contact (id,type,read,firstname,lastname,email,body,company,website,telephone,address,city,state,zip) VALUES (null,0,0,$firstname,$lastname,$email,$body,$company,$website,$telephone,$address,$city,$state,$zip)";
    mysql_query($query);
    
    
    
    
    $sendmail = "
    firstname - $firstname 
    email - $email
    
    
    
    $body";
    
    $sendmail2 = "Hi $firstname $lastname,
    This is an automatic message sent to confirm that your message has been sent and we will get back with you as soon as possible. 
    
    Thanks,
    Hill Marketing Group";
    
    mail ('mike.hill5@comcast.net', 'Contact Form', $sendmail, 'From: $email');
    mail ($email, 'Message received', $sendmail2, "From: info@hillmarketinggroup.com");
    
    
    header ("Location: index.php?menu=contact&sent");
    
    $content .= '<font size="2" face="Arial" color="#000000">Thank you for contacting us. Your message has been received.</font> <br />';
    
    
    } else {
    }
    }
    
    
    
    
    
    
    
    $content .= '
    
    
    
    
    <table width="350" border="0" align="center" cellpadding="4" cellspacing="3">
    
                                  <tr> 
    
                                    <td height="38" colspan="2" bgcolor="#FFFFFF"><p><font color="#333333"><font size="2" face="Arial, Helvetica, sans-serif"><strong><font color="#000000" size="3"><font size="2">HILL 
    
                                    MARKETING GROUP, LLC.</font></font></strong></font></font></p></td>
    
                                  </tr>
    
                                  <tr> 
    
                                    <td valign="top"width="63%" bgcolor="#F6F6F6"><font size="2" face="Arial, Helvetica, sans-serif"><strong> 
    
                                      General Info:<br><br>
    
                                      </strong> <div class="ccc"><a href="mailto:info@hillmarketinggroup.com">info@hillmarketinggroup.com</div><br>
    
                                      </a><br>
    
                                      </font><font size="2" face="Arial, Helvetica, sans-serif"><strong> 
    
                                      Careers:</strong><br><br>
    
                                      <div class="ccc"><a href="mailto:careers@hillmarketinggroup.com">careers@hillmarketinggroup.com</a></div><br>
    
                                      <br>
    
                                      </font></td>
    
                                    <td valign="top"width="37%" bgcolor="#F6F6F6"><p><font size="2" face="Arial, Helvetica, sans-serif"><strong> 
    
                                        Phone:</strong> <br>
    
                                        770.366.7532</font></p>
    
                                      <p><font size="2" face="Arial, Helvetica, sans-serif"><strong> 
    
                                        Fax:</strong><br>
    
                                        770.454.8589<br>
    
                                        <br>
    
                                        </font></p></td>
    								<td></td><td>
    								<form action="contact.php" method="post">
                              <table border="0" cellpadding="2">
    
                                <tr> 
    <td align="left" valign="middle" bgcolor="#eeeeee"><font size="1" face="Arial" color="#000000"><font size="1" face="Arial" color="#000000"><strong>Name</strong></font> </td><td valign="top" bgcolor="#FFFFFF"><input type="text" class="texta" name="firstname" maxlength="20" size="20" value="' . $_POST['firstname'] . '" /></td>
                                </tr>
                                <tr> 
    
    <td align="left" valign="middle" bgcolor="#eeeeee"><font size="1" face="Arial" color="#000000"><font size="1" face="Arial" color="#000000"><strong>E-Mail</strong></font> </td><td valign="top" bgcolor="#FFFFFF"><input type="text" class="texta" name="email" maxlength="50" size="20" value="' . $_POST['email'] . '" /></td>
                                </tr>
                                <tr> 
    <td align="left" valign="middle" bgcolor="#eeeeee"><font size="1" face="Arial" color="#000000"><font size="1" face="Arial" color="#000000"><strong>Message </strong></font></td><td valign="top" bgcolor="#FFFFFF"><textarea name="body" rows="3" cols="15" class="textfieldmsg"></textarea></td>
                                </tr>
    						<tr>
    						<td></td>
    						<td>
    						<input type="submit" name="submit" value="Talk To Us!" style="background-color: #525252;  border: 1px solid orange;  border-style:none; color: #FFFFFF; padding: 2px;" class="textsubmit" />
    						</td></tr>
                              </table>
    
    
    
    
    </form>
    								</td>
    
                                  </tr>
    </table>';
    
    
    }
    
    
    echo "$content";
    ?>
    </td>
                        <td> </td>
                      </tr>
                    </table>
    </td><td width="15" height="218" style="background-image: url(contentbgright.jpg); "></td>
    </tr>
    </table>
    </div>
    <div id="bottom2">
    <div id="copyright">
    <?php include ("copyright.php"); ?>
    </div>
    </div>
    </div>
    </body>
    </html>
    
    

  10. if (isset($_POST['AvailibleSubmit'])) {
    if (isset($_POST['availible'])) {
    	$sql="UPDATE `designer_status` SET `amavailible` = '1' WHERE `designer_status`.`amavailible` =1 LIMIT 1";
    	$result = mysql_query($sql);
    	if ($result) {
    		echo "database changes have been made. Press <a href=\"admin.php\">back</a> to continue.";
    	} else {
    		echo "database changes failed, please try again";
    	}
    } else {
    	$sql="UPDATE `designer_status` SET `amavailible` = '0' WHERE `designer_status`.`amavailible` =1 LIMIT 1";
    	$result = mysql_query($sql);
    	if ($result) {
    		echo "database changes have been made. Press <a href=\"admin.php\">back</a> to continue.";
    	} else {
    		echo "database changes failed, please try again";
    	}
    }
    }
    

     

    Changed a few lines just to make it check if the variable isset or not, this is causing it to do one or the other, noth both. Is this what you were looking for?

  11. You said when you click on a name/photo you want it to take you to another page where it displays the information for that person, correct? If so, you need to do what I posted above to achieve this. This way you pass the id for the person chosen to the next page and then grab that value out of the url so that you can take out the information in the database that matches that id. Make sense?

  12. So you need to either pass them through using sessions or through the url. To go through the url just set each value like:

    index.php?name=$name&dob=$dob then you can grab them from the url on the next page with $name = $_GET['name'];

    and etc. I'm a little rusty on sessions as I haven't done them in like two years so this is as far as I can give help, I think. Hope it helps though!

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