x10Hosting Forums

Corporate Free Hosting for the Masses.



Register

Reply
 
LinkBack Thread Tools Display Modes
x10 Sophmore

Join Date: Feb 2008
Posts: 100
Credits: 2,849
Conmiro is on a distinguished road
Quote  
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
Reply With Quote
Conmiro is offlineReport Post
x10 Elder

VPmase's Avatar

Join Date: Nov 2007
Posts: 832
Credits: 17,396
VPmase will become famous soon enough
Location: Dixon, IL, USA

Send a message via MSN to VPmase
Quote  
09-30-2008, 10:41 PM
Re: Need help- Will pay

I suggest you replace your password and username with *****'s
__________________
Visit my site!
Always use the search function before posting a new thread!
Extra10 | BuxBank | NeoBux

Extra10 | BuxBank | NeoBux
Help me out <3
Helpful suggestions: Read the rules on every forum, follow said rules, and if you are unsure or need help, search first
Reply With Quote
VPmase is offlineReport Post
x10 Sophmore

Join Date: Feb 2008
Posts: 100
Credits: 2,849
Conmiro is on a distinguished road
Quote  
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
Reply With Quote
Conmiro is offlineReport Post
The Terminator

DeadBattery's Avatar

Join Date: Mar 2008
Posts: 1,891
Credits: 14,226
DeadBattery is a glorious beacon of light
Location: localhost

Send a message via AIM to DeadBattery Send a message via MSN to DeadBattery
Quote  
09-30-2008, 11:11 PM
Re: Need help- Will pay

Thread Moved to Marketplace
__________________
Do not PM me for hosting support.
Use the Hosting Support forums instead.
Thank You


Useful Links:
Server Status | Terms of Service | x10 Commandments | Inserting Ads | Unsuspend Your Account

My Sites:
Your PTC Guide | PrimateTech

Sites I Work At:
x10Hosting | SohailTech

If you found this post helpful, please click on +REP.

Reply With Quote
DeadBattery is offlineReport Post
x10Hosting Member

Join Date: Aug 2008
Posts: 25
Credits: 488
Nahid_hossain is on a distinguished road
Location: Dhaka, Bangladesh

Quote  
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);
?>
Reply With Quote
Nahid_hossain is offlineReport Post
x10 Lieutenant

Join Date: Oct 2007
Posts: 438
Credits: 4,200
mattura is just really nice
Quote  
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
Reply With Quote
mattura is offlineReport Post
x10Hosting Member

Join Date: Sep 2008
Posts: 66
Credits: 727
exemption is on a distinguished road
Quote  
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.
Reply With Quote
exemption is offlineReport Post
x10 Lieutenant

Join Date: Oct 2007
Posts: 438
Credits: 4,200
mattura is just really nice
Quote  
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
Reply With Quote
mattura is offlineReport Post
x10 Sophmore

Join Date: Jul 2008
Posts: 144
Credits: 1,416
xav0989 is on a distinguished road
Quote  
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); 
?>
__________________
Use a great CMS, try eaCyMS (not available now... yet!)

Pain is weakness leaving the body.
Reply With Quote
xav0989 is offlineReport Post
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

Credit Card Consolidation | Per Insurance | Adult ADHD | eHarmony Coupon | Bad Credit Mortgages