Jump to content

Mythiel

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Mythiel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the replys. Looks like I'm am going to have to contact the hosting company for this one. Just wanted to see if there was any way to install PHP on remote servers but guess not. No biggie, again thanks guys.
  2. Ok, this is probably a 'noob' question but after a while on google I'm going to ask. Currently I am working on a site that has no php (an older site i am revamping for a friend) thus all the php code shows up on the page through the browser. Usually the sites I have worked on the past have php, and all that jazz, already installed but if not i would have to contact the hosting company to get them but that sometimes involve me paying. I have never installed Php to a server myself and what I've found are tutorials on installing Php to the computer rather than the web server itself. So, my question is can I install php on a hosted web server or am I going to have to directly contact the hosting company for this?
  3. *FacePalm* Wow, Thanks a lot. Its always the most obvious ones that get me.
  4. Ive made myself a small test form to check to see if i can get connected to my company's new database. However after I submit the form I get this error message: "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 ')' at line 11" here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>PhP Contact Form</title></head><body><?php$errors = '0';if( isset( $_POST['name']) and $errors == 0){ echo '<p>Thank you for your submission!</p>'; $to = 'graphics@softsigns.com'; $subject = 'Contact Form Submission'; $message = 'You have received a contact form submmision: First Name: '.$_POST['name'].''; $headers = 'From: Contact Form Alert <FormAlert@softsigns.com>'."\n\r"; mail( $to, $subject, $message, $headers ); $connect = mysql_connect( 'localhost','********', '********' ) or die( mysql_error() ); mysql_select_db( 'softsigns', $connect ) or die( mysql_error() ); $query = 'INSERT INTO test_db ( test_name, test_value, test_date ) VALUES ( "'.$_POST['name'].'", "'.$_POST['value'].'", "'.$_POST['date'].'", )'; mysql_query( $query, $connect ) or die( mysql_error() ); }else{ ?> <form id="contact_form" name="contact_form" method="post" action="PhpFormtest.php"> <table width="636" border="0"> <tr> <td width="111"> <div align="right">Name:</div> </td> <td width="510"> <input type="text" name="name" value="<?php echo @$_POST['name']; ?>"/> </td> <td width="1" rowspan="11"> </td> </tr> <tr> <td width="111"> <div align="right">Value:</div> </td> <td width="510"> <input type="text" name="value" value="<?php echo @$_POST['value']; ?>"/> </td> <td width="1" rowspan="11"> </td> </tr> <tr> <td> <div align="right">Date:</div> </td> <td> <input type="text" name="date" value="<?php echo @$_POST['date']; ?>"/> </td> </tr> <tr> <td> <input type="submit" name="submit" value="submit"> <input type="hidden" name="submitted" id="submitted" value="true" /> </td> <td colspan="4"> </td> </tr> </table> </form> <?php}?></body></html> Any Suggestions?
  5. I am trying to make a Web Form for people to fill out that has two drop down menus where i want the first drop down menu's selection changes the values of the selections in the second drop down. ((IE. If the first drop down value is "product 01" then the second drop down shows values "Red, Green, Blue" while if the first drop down value is "product 02" then the second drop down shows values "Yellow, Green")) Anyone have any ideas? Thanks in Advance.
  6. Perfect, everything works now, can't believe I forgot the $connect. Thanks a lot for the help, Much appreciated!
  7. Awsome, that did the trick (can't believe i forgot to put in those '$' marks) but now that ive taken care of that error ive gotten a new one stating: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /smarthosting/content/f/fslj0004/.website4166/FormViewer.php on line 103 I did some searching around and found that the most common problem causing this is a incorrect/missmatched field value or something. Now this doesn't seem like a Php error but a mysql error. Either way can anyone see what i am missing (i tend to overlook these small mistakes but im learning to find them )
  8. Ive posted a problem last week on the first part of this project I'm working on in the sql forum page, and first off would like to say thanks for the help from those who helped me solved that problem, but now into the second part ive run into another snag. This is part of a Php web form that works with MySQL through PhpMyAdmin, where the first part is the actual form and the second part is a web page to display the info collected from the form in the database. However, the 'Form Viewer' as i call it is showing this error: "Parse error: syntax error, unexpected ',', expecting T_PAAMAYIM_NEKUDOTAYIM in /smarthosting/content/f/fslj0004/.website4166/FormViewer.php on line 35" Now i assume this is a php code error hence why i have posted here now rather than in the sql section, but let me know if i am wrong. Here is the code (keep in mind this is just a template to just get things working, graphics and proper styling will come later): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <body> <?php if( $_GET['id'] ) { $query = 'SELECT contactss_first, contactss_last, contactss_company, contactss_adress, contactss_city, contactss_province, contactss_country, contactss_postal, contactss_phone, contactss_fax, contactss_email, contactss_cme, contactss_info, contactss_date FROM contactss WHERE contactss_id = "'.$_GET['id'].'" LIMIT 1'; $result = mysql_query( $query, $connect ) or die( mysql_error() ); list( contactss_first,contactss_last,contactss_company,contactss_adress,contactss_city,contactss_province,contactss_country,contactss_postal,contactss_phone,contactss_fax,contactss_email,contactss_cme,contactss_info,contactss_date ) = mysql_fetch_row( $result ); echo ' <table width="1024" height="277" border="0">'; echo ' <tr>'; echo ' <td width="104" height="20">Contact #</td>'; echo ' <td width="143">'.$contactss_id.'</td>'; echo ' <td width="59"> </td>'; echo ' <td width="132"> </td>'; echo ' <td width="89"> </td>'; echo ' <td width="202"> </td>'; echo ' <td width="78"> </td>'; echo ' <td width="183"> </td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td height="20">First Name</td>'; echo ' <td>'.$contactss_first.'</td>'; echo ' <td>City</td>'; echo ' <td>'.$contactss_city.'</td>'; echo ' <td>Adress</td>'; echo ' <td>'.$contactss_adress.'</td>'; echo ' <td>Phone #</td>'; echo ' <td>'.$contactss_phone.'</td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td height="20">Last Name</td>'; echo ' <td>'.$contactss_last.'</td>'; echo ' <td>Province</td>'; echo ' <td>'.$contactss_province.'</td>'; echo ' <td>Postal Code</td>'; echo ' <td>'.$contactss_postal.'</td>'; echo ' <td>Fax #</td>'; echo ' <td>'.$contactss_fax.'</td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td height="20">Company Name</td>'; echo ' <td>'.$contactss_company.'</td>'; echo ' <td>Country</td>'; echo ' <td>'.$contactss_country.'</td>'; echo ' <td>Email</td>'; echo ' <td>'.$contactss_email.'</td>'; echo ' <td>Contact by</td>'; echo ' <td>'.$contactss_cme.'</td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td height="9"> </td>'; echo ' <td height="20" colspan="7" rowspan="2"> </td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td height="9">Message</td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td height="141" colspan="8">'.$contactss_info.'</td>'; echo ' </tr>'; echo '</table><br /><br />'; } else { $query = 'SELECT contactss_id, contactss_first, contactss_last FROM contactss ORDER BY contactss_id'; $result = mysql_query( $query, $connect ) or die( mysql_error() ); $rows = mysql_num_rows( $result ); for( $i = 0; $i < $rows; $i ++ ) { list( $contactss_id,$contactss_first, $contactss_last ) = mysql_fetch_row( $result ); echo '<a href="FormViewer.php?id='.$contactss_id.'">'.$contactss_first.'_'.$contactss_last.'</a>'; echo ' - '.$contactss_date; echo '<hr />'; } } ?> </body> </html>
  9. Been looking around for a solution but so far found nothing. I am trying to update a contact form for my work with PhpMyAdmin. I have done a simple form like this a long while back so i am a bit rusty on understanding what im doing. While waiting for my work server to be updated i have been trying to get someting working on my personal site. I have gotten my old form test to work (data showing up in PhpMyAdmin) but working on the new one hasn't been as easy. The error shown after i submit the form is "Column count doesn't match value count at row 1" Here is my code and attached is my table layout in PhpMyAdmin. <?php if( isset( $_POST['first'] ) ) { $errors = 0; if( $_POST['first'] == '' ) { $first_error = 'Please enter your first name!'; $errors++; } elseif( strlen( $_POST['first'] ) < 2 ) { $first_error = 'Please enter a valid first name!'; $errors++; } elseif( !eregi( '^[a-zA-Z]+((\s|\-)[a-zA-Z]+)?$', $_POST['first'] ) ) { $first_error = 'Please enter a valid first name!'; $errors++; } if( $_POST['last'] == '' ) { $last_error = 'Please enter your last name!'; $errors++; } elseif( strlen( $_POST['last'] ) < 2 ) { $last_error = 'Please enter a valid last name!'; $errors++; } elseif( !eregi( '^[a-zA-Z]+((\s|\-)[a-zA-Z]+)?$', $_POST['last'] ) ) { $last_error = 'Please enter a valid last name!'; $errors++; } if( $_POST['province'] == 'Not Selected' ) { $province_error = 'Please enter your province!'; $errors++; } if( $_POST['country'] == 'Not Selected' ) { $country_error = 'Please enter your country!'; $errors++; } if( $_POST['phone'] == '' ) { $phone_error = 'Please enter a phone number!'; $errors++; } if( $_POST['email'] == '' ) { $email_error = 'Please enter your Email!'; $errors++; } elseif( !eregi( '^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$', $_POST['email'] ) ) { $email_error = 'Please enter a valid Email!'; $errors++; } if( $_POST['info'] == '' ) { $info_error = 'Please let us know what you would like!'; $errors++; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>PhP Contact Form</title> </head> <body> <?php if( isset( $_POST['first']) and $errors == 0) { echo '<p>Thank you for your submission!</p>'; $to = 'graphics@softsigns.ca'; $subject = 'Contact Form Submission'; $message = 'You have received a contact form submmision: First Name: '.$_POST['first'].' '; $headers = 'From: Contact Form Alert <FormAlert@softsigns.com>'."\n\r"; mail( $to, $subject, $message, $headers ); $connect = mysql_connect( '*************','*********', '**********' ) or die( mysql_error() ); mysql_select_db( '************', $connect ) or die( mysql_error() ); $query = 'INSERT INTO contactss ( contactss_first, contactss_last, contactss_company, contactss_adress, contactss_city, contactss_provice, contactss_country, contactss_postal, contactss_phone, contactss_fax, contactss_email, contactss_cme, contactss_info ) VALUES ( "'.$_POST['first'].'", "'.$_POST['last'].'", "'.$_POST['company'].'", "'.$_POST['adress'].'", "'.$_POST['city'].'", "'.$_POST['province'].'", "'.$_POST['country'].'", "'.$_POST['postal'].'", "'.$_POST['phone'].'", "'.$_POST['fax'].'", "'.$_POST['email'].'", "'.$_POST['cme'].'", "'.$_POST['info'].'", NOW() )'; mysql_query( $query, $connect ) or die( mysql_error() ); } else { ?> <form id="contact_form" name="contact_form" method="post" action="PhpForm2.php"> <table width="636" border="0"> <tr> <td width="111"> <div align="right">*First Name:</div> </td> <td width="510"> <input type="text" name="first" value="<?php echo @$_POST['first']; ?>"/> <?php echo $first_error; ?> </td> <td width="1" rowspan="11"> </td> </tr> <tr> <td width="111"> <div align="right">*Last Name:</div> </td> <td width="510"> <input type="text" name="last" value="<?php echo @$_POST['last']; ?>"/> <?php echo $last_error; ?> </td> <td width="1" rowspan="11"> </td> </tr> <tr> <td> <div align="right">Company Name:</div> </td> <td> <input type="text" name="company" value="<?php echo @$_POST['company']; ?>"/> </td> </tr> <tr> <td> <div align="right">Adress:</div> </td> <td> <input type="text" name="adress" value="<?php echo @$_POST['adress']; ?>"/> </td> </tr> <tr> <td> <div align="right">City:</div> </td> <td> <input type="text" name="city" value="<?php echo @$_POST['city']; ?>"/> </td> </tr> <tr> <td> <div align="right">*Province:</div> </td> <td> <select name="province"> <option value="Not Selected">- Select Province -</option> <option value="Not Selected"></option> <option value="British Columbia">British Columbia</option> <option value="Alberta">Alberta</option> <option value="Saskatchewan">Saskatchewan</option> <option value="Manitoba">Manitoba</option> <option value="Ontario">Ontario</option> <option value="Quebec">Quebec</option> <option value="New Brunswick">New Brunswick</option> <option value="Prince Edward Island">Prince Edward Island</option> <option value="Nova Scotia">Nova Scotia</option> <option value="Newfoundland and Labrador">Newfoundland and Labrador</option> <option value="Not Selected"></option> <option value="Not Selected">------------</option> <option value="Not Selected"></option> <option value="Yukon">Yukon</option> <option value="Northwest Territories">Northwest Territories</option> <option value="Nunavut">Nunavut</option> </select> <?php echo $province_error; ?> </td> </tr> <tr> <td> <div align="right">*Country:</div> </td> <td> <select name="country" id="country"> <option value="Not Selected">- Country -</option> <option value="Not Selected"></option> <option value="Canada">Canada</option> </select> <?php echo $country_error; ?> </td> </tr> <tr> <td> <div align="right">Postal Code:</div> </td> <td> <input type="text" name="postal" value="<?php echo @$_POST['postal']; ?>"/> </td> </tr> <tr> <td> <div align="right">*Phone Number:</div> </td> <td> <input type="text" name="phone" value="<?php echo @$_POST['phone']; ?>"/> <?php echo $phone_error; ?> </td> </tr> <tr> <td> <div align="right">Fax Number:</div> </td> <td> <input type="text" name="fax" value="<?php echo @$_POST['fax']; ?>"/> </td> </tr> <tr> <td> <div align="right">*Email Adress:</div> </td> <td> <input type="text" name="email" value="<?php echo @$_POST['email']; ?>"/> <?php echo $email_error; ?> </td> </tr> <tr> <td> <div align="right">Contact me by:</div> </td> <td> <select name="cme"> <option value="Phone Me">Phone</option> <option value="Email Me">E-Mail</option> </select> </td> </tr> <tr> <td> <div align="right">*Message:</div> </td> <td colspan="2"> <textarea name="info" cols="60" rows="4"/><?php echo @$_POST['info']; ?></textarea> </td> </tr> <tr> <td> <input type="submit" name="submit" value="submit"> </td> <td colspan="2"> <?php echo $info_error; ?> </td> </tr> </table> </form> <?php } ?> </body> </html> I may have missed something blatently obvious but any help is greatly appreciated. Thanks in adavance [attachment deleted by admin]
×
×
  • 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.