|
|
 |
|
 |
x10 Sophmore
Join Date: Feb 2008
Posts: 100
Credits:
2,849
|
|
09-30-2008, 10:35 PM
|
|
Need help- Will pay
When ever I load a certain page on my website, I get this message:
http://conmiro.com/submit.php
Here is the script of submit.php:
<?php
$con = mysql_connect("localhost","conmiro_conmiro","***** ***********");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("my_db", $con);mysql_query
("INSERT INTO websites (sitename, description, email)
VALUES ('$_POST["age"]', '$_POST["age"]', '$_POST["age"]')");
mysql_close($con);
?>
If you can help me, il give you some points.
Edit:
VALUES ('$_POST["age"]', '$_POST["age"]', '$_POST["age"]')");
Thats line 8.
__________________
Find me helpful? Click on the Blue Check mark at the top right corner of my post! It helps my reputation! 
http://chaoclub.exofire.net
Last edited by Conmiro; 09-30-2008 at 10:48 PM.
Reason: Automerged Doublepost
|
|
|
|
x10 Elder
Join Date: Nov 2007
Posts: 832
Credits:
17,396
Location: Dixon, IL, USA
|
|
09-30-2008, 10:41 PM
|
|
Re: Need help- Will pay
I suggest you replace your password and username with *****'s
|
|
|
|
x10 Sophmore
Join Date: Feb 2008
Posts: 100
Credits:
2,849
|
|
09-30-2008, 10:48 PM
|
|
Re: Need help- Will pay
there i fixed my password, i accidently added a space. Does that help more?
Edit:
oh, replace it. Oops. :D My bad. Sooo can you help?
__________________
Find me helpful? Click on the Blue Check mark at the top right corner of my post! It helps my reputation! 
http://chaoclub.exofire.net
Last edited by Conmiro; 09-30-2008 at 10:48 PM.
Reason: Automerged Doublepost
|
|
|
|
The Terminator
Join Date: Mar 2008
Posts: 1,891
Credits:
14,226
Location: localhost
|
|
09-30-2008, 11:11 PM
|
|
Re: Need help- Will pay
Thread Moved to Marketplace
__________________
Do not PM me for hosting support.
|
|
|
|
x10Hosting Member
Join Date: Aug 2008
Posts: 25
Credits:
488
Location: Dhaka, Bangladesh
|
|
10-01-2008, 03:57 AM
|
|
Re: Need help- Will pay
Here is the corrected code
PHP Code:
<?php
$con = mysql_connect("localhost","conmiro_conmiro","***** ***********");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
mysql_query("INSERT INTO websites (sitename, description, email) VALUES('".$_POST["age"]."', '".$_POST["age"]."', '".$_POST["age"]."')");
mysql_close($con);
?>
|
|
|
|
x10 Lieutenant
Join Date: Oct 2007
Posts: 438
Credits:
4,200
|
|
10-03-2008, 04:13 AM
|
|
Re: Need help- Will pay
erm... $_POST["age"] three times?!!!
__________________
----
Please donate credits if you had a really good reply from me! Rep is also appreciated. Thanks
matt.elementfx.com
|
|
|
|
x10Hosting Member
Join Date: Sep 2008
Posts: 66
Credits:
727
|
|
10-03-2008, 10:39 AM
|
|
Re: Need help- Will pay
First of all you do not need 3 $_POST actions
PHP Code:
<?php
$con = mysql_connect("localhost","conmiro_conmiro","***** ***********"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); mysql_query("INSERT INTO websites (sitename, description, email) VALUES('".$_POST["age"]."')"); mysql_close($con); ?>
Corrected code
__________________
I program PHP..so if you need help lemme know!
Last edited by exemption; 10-03-2008 at 10:39 AM.
|
|
|
|
x10 Lieutenant
Join Date: Oct 2007
Posts: 438
Credits:
4,200
|
|
10-04-2008, 05:29 PM
|
|
Re: Need help- Will pay
perhaps you meant:
$_POST['sitename'], $_POST['description'], and $_POST['email'] or similar?
__________________
----
Please donate credits if you had a really good reply from me! Rep is also appreciated. Thanks
matt.elementfx.com
|
|
|
|
x10 Sophmore
Join Date: Jul 2008
Posts: 144
Credits:
1,416
|
|
10-04-2008, 09:05 PM
|
|
Re: Need help- Will pay
Here is the final complete code.
I edited it a bit so that you may use it and put your personal info without modifying the handling code. I also removed a whitespace at the beginning that could ruin your script.
PHP Code:
<?php
$db_host = "localhost"; //keep the same
$db_user = "conmiro_conmiro"; //this is your username
$db_pass = "PUT PASSWORD HERE"; //this is your pasword
$db_name = "conmiro_PUT DATABASE NAME HERE"; //this is your database name. it starts by conmiro_
// change the name between the brackets [' '] to what you want i.e sitename , description , email
$values = array($_POST['age'], $_POST['age'], $_POST['age']);
//You do not need to edit below
$query = "INSERT INTO websites (sitename, description, email) VALUES('" . $values[0] . "', '" . $values[1] . "', '" . $values[2] . "')"
$con = mysql_connect($db_host, $db_user, $db_pass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($db_name, $con);
mysql_query($query);
mysql_close($con);
?>
|
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:08 PM.
Powered by vBulletin® Version 3.7.3 Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
Credit Card Consolidation | Per Insurance | Adult ADHD | eHarmony Coupon | Bad Credit Mortgages
| |