Intranet Journal

Go Back   IT Management Forum > Intranet Journal

Intranet Journal The new discussion forum for Intranet Journal readers. Leave comments and questions for IJ authors. Suggest story ideas and provide feedback.

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #16 (permalink)  
Old 01-30-2009, 05:26 PM
FaT3oYCG FaT3oYCG is offline
Registered User
 
Join Date: Jan 2009
Posts: 11
try using these as an input on the editor form

Title: Test Article
Tagline: Tag line example
Section: 1
Article: This is the content of the article, the content and all other attributes will be stored in the database by the queries that the other php files in the cms have used.

and tell me what happens, it may be because you arent entering a section value and there is no validation so when it tries to write the section value it equates to nothing which makes the query fail?

EDIT:

use this code for your editor file

Code:
<table border='1'>
	<form name='editor' method='post' action='./NewArticle.php'>
		<table cellpadding='5'>
			<tr>
				<td>Title: <br><input name='title' id='title' type='text'></td>
			</tr>
			<tr>
				<td>Tagline: <br><input name='tagline' id='tagline' type='text'></td>
			</tr>
			<tr>
				<td>Section: <br><input name='section' id='section' type='text'></td>
			<tr>
			<tr>
				<td>Article: <br><textarea name='thearticle' cols='50' rows='6' id='thearticle'></textarea></td>
			</tr>
			<tr>
				<td><center><input name='Submit' value='Submit' type='submit'></center><td>
			</tr>
		</table>
	</form>
</table>

Last edited by FaT3oYCG; 01-30-2009 at 05:28 PM.
Reply With Quote
  #17 (permalink)  
Old 01-31-2009, 09:12 AM
brunswick brunswick is offline
Registered User
 
Join Date: Jan 2009
Posts: 7
Quote:
Originally Posted by FaT3oYCG
try using these as an input on the editor form

Title: Test Article
Tagline: Tag line example
Section: 1
Article: This is the content of the article, the content and all other attributes will be stored in the database by the queries that the other php files in the cms have used.

and tell me what happens, it may be because you arent entering a section value and there is no validation so when it tries to write the section value it equates to nothing which makes the query fail?

EDIT:

use this code for your editor file

Code:
<table border='1'>
	<form name='editor' method='post' action='./NewArticle.php'>
		<table cellpadding='5'>
			<tr>
				<td>Title: <br><input name='title' id='title' type='text'></td>
			</tr>
			<tr>
				<td>Tagline: <br><input name='tagline' id='tagline' type='text'></td>
			</tr>
			<tr>
				<td>Section: <br><input name='section' id='section' type='text'></td>
			<tr>
			<tr>
				<td>Article: <br><textarea name='thearticle' cols='50' rows='6' id='thearticle'></textarea></td>
			</tr>
			<tr>
				<td><center><input name='Submit' value='Submit' type='submit'></center><td>
			</tr>
		</table>
	</form>
</table>
Hi Craig,

You get the gold star! You were absolutely right, all that was missing was an entry for the "Section" blank. With "1" in that slot it accepted the entries without complaint. I also checked the table contents using my command line and yes, it was all there.

For what it's worth I did put in a MySQL trap and got the following 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 1

Anyway, thanks to your help I can now go merrily forward and "conquer" this beast.

Thank you very much.

Best,

-Hank
Reply With Quote
  #18 (permalink)  
Old 02-07-2009, 08:24 PM
brunswick brunswick is offline
Registered User
 
Join Date: Jan 2009
Posts: 7
Creating a PHP-Based Content Management System, Part 2

Hi,

A slightly different issue in the same section.

I have a quibble and also a question. In the code for DbConnector there is the line
Code:
$settings = SystemComponent::getSettings();
which uses an operator called Paamayim Nekudotayim or double colon.

My quibble is why use an operator that took me a fair bit of googling to find and is not even in any of my textbooks, in other words a bit obscure, on a bunch of newbies? My question is: what exactly does it do?

Anybody have any thoughts on this? Any help would be much appreciated.

-Hank
Reply With Quote
  #19 (permalink)  
Old 02-08-2009, 02:49 AM
FaT3oYCG FaT3oYCG is offline
Registered User
 
Join Date: Jan 2009
Posts: 11
The doubble colon, which I myself did not know the propper name for is simply just another operator. It is used with classes, which is what the code we are using is.

SystemComponent is a class
DbConnector is a class that extends the SystemComponent class inheriting anything that is accesible by the SystemComponent class

the doubble colon just allows you to obtain the data from a function in class that you have returned a value from, so SystemComponent::getSettings() simply returns the values that you previously defined in the SystemComponent class to your current working class to be worked upon.

I was mid development of my system when my pc crashed so i have had to start from scratch again which is slightly annoying but im sure it wont take long to re create what i had, when i have set the basic system up again i will try and remember to post a link to it here and a description so you can check it out.
Reply With Quote
  #20 (permalink)  
Old 02-08-2009, 07:46 AM
brunswick brunswick is offline
Registered User
 
Join Date: Jan 2009
Posts: 7
Quote:
Originally Posted by FaT3oYCG
The doubble colon, which I myself did not know the propper name for is simply just another operator. It is used with classes, which is what the code we are using is.

SystemComponent is a class
DbConnector is a class that extends the SystemComponent class inheriting anything that is accesible by the SystemComponent class

the doubble colon just allows you to obtain the data from a function in class that you have returned a value from, so SystemComponent::getSettings() simply returns the values that you previously defined in the SystemComponent class to your current working class to be worked upon.

I was mid development of my system when my pc crashed so i have had to start from scratch again which is slightly annoying but im sure it wont take long to re create what i had, when i have set the basic system up again i will try and remember to post a link to it here and a description so you can check it out.
Thanks Craig,

I know from crashes and other disasters. Used to program (in BASIC) on a machine without a hard drive (floppy's only) and many a time wiped out an entire (pretty elaborate) program. I did find that the reconstructed version was usually better than the original, so there's hope. (It did teach me to become a back-up fiend!)

Anyhoo, thanks for the response. I'll see if I can figure it out. Good luck with your restore.

Best,

-Hank
Reply With Quote
  #21 (permalink)  
Old 02-08-2009, 11:17 AM
FaT3oYCG FaT3oYCG is offline
Registered User
 
Join Date: Jan 2009
Posts: 11
Cheers, I have got most of it sorted already. The template for the site that I was using was a bit annoying to setup again because I am using skins with my site and had already made 3 that were lost.

I had to start the cms from scratch, aswell as all of my tables and the db and everything, but yeah, I'm getting through it. I just need to go through the pains of setting up the user managmet and customising it completley to my preferences again.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 03:31 AM.





Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0