Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-26-2006, 10:13 AM   #1 (permalink)
hs1984
Junior Member
 
Join Date: Feb 2006
Posts: 2
Default Problem with cms

Hi,

I'm building a cms using php and mysql and have a page called createarticle.php which has the following form:

<form action='processnewarticle.php' method='post'>

<p>Title</p>

<input type=text name='title'>

<p>Description</p>

<input type=text name='description'>

<p>Your Article</p>

<textarea name='article' rows=5 cols=62></textarea>

<input type=submit value='Submit Form'> <input type=reset value='Reset Form'>

</form>


My processnewarticle.php page has the following code to make it enter the form information into the database:

<?php

require_once('dbconnect.php');

if ($_POST){

$connector=newDbConnector();

$insertQuery = "INSERT INTO article (title,description,article) VALUES ("."'".$_POST['title']."',".
"'".$_POST['description']."',".
"'".$_POST['article']."')";

if ($result = $connector->query($insertQuery)){

echo 'Article sucessfully added to database. Please <a href="controlpanel.php">click here</a> to return to the control panel home page.';

}else{

exit('Sorry, but there was an error submitting your article to the database, please contact your support operator through the more link on the left');

}

}

?>


However, when I submit my article through my form it goes to processnewarticle.php but just comes up blank and doesn't put the info into the db???

Has anyone got any ideas why? I've included the mysql query for the article table below. If anyone could shed some light on where I've gone wrong, that'd be great.

CREATE TABLE article(
ID int(6) UNSIGNED NOT NULL AUTO_INCREMENT,
title varchar(200) NULL,
description varchar(255) NULL,
article text NULL,
PRIMARY KEY (ID)
);


Thanks

hs1984
hs1984 is offline   Reply With Quote
Sponsored Links
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 01:22 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums