Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 5th, 2003, 02:54 AM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Article Discussion: Building a Multi-Page Article System With ASP/PHP

Building a Multi-Page Article System With ASP\/PHP If you have any questions or comments about this article then please post them here.

You can read the article here .

Reply With Quote
  #2  
Old January 5th, 2003, 09:22 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
Thumbs up

Thanks for this tutorial. It's great!

Reply With Quote
  #3  
Old January 5th, 2003, 05:46 PM
sjarvis sjarvis is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 sjarvis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
no valid HTML

It would help everyone who uses the articles at devarticles.com if authors included valid HTML or XHTML in their examples. Valid code makes better websites. Even better would be to use valid and RECENT versions of HTML or XHTML and CSS instead of using <font> tags and other deprecated code. Not doing so is akin (though not identical) to writing an article for PHP 3.0 users.

If you're unconvinced (or need to brush up) visit webstandards.org. They have all the scoop.

Thanks,

Steven

Reply With Quote
  #4  
Old January 5th, 2003, 05:52 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
Got a couple of errors on the asp version - usually of the object required variety - able to get it to work by doing a set objRS = Server.CreateObject("ADODB.Recordset") or by doing a set objRS = objConn.Execute(strSQL). Also had to include the Replace "'", "''" code since SQL inserts are being used.

Other than that it worked great.

Last edited by aspnewbie : January 11th, 2003 at 08:20 AM.

Reply With Quote
  #5  
Old January 5th, 2003, 06:04 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Thanks for the comments guys. I'm well aware of XHTML standards, etc, however that was not the focus of the article. The focus of the article was to show you the fundamentals of building a multi-page CMS, mainly concentrating on the JavaScript and PHP.

However, I've taken your comments on board, and I'll make all future articles "relevant" to standards, etc.

Reply With Quote
  #6  
Old January 6th, 2003, 01:51 AM
Mr Chocloate Mr Chocloate is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Anglesea
Posts: 12 Mr Chocloate User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Great article mytch! are you going to finish the article with edit and delete multi-page articles ? or do we have to figure that out?


Reply With Quote
  #7  
Old January 7th, 2003, 01:50 AM
adammendoza adammendoza is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: California
Posts: 8 adammendoza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool Error addding more articles

First I had to modify the connection for asp also.

I am getting errors when trying to add more articles. I recreated the bd and I was able to add only one article and one part for it. I cannot add more. why?

thx.

'db.asp
<%
Dim strSQLServerName 'Holds the name of the SQL Server
Dim strSQLDBUserName 'Holds the user name (for SQL Server Authentication)
Dim strSQLDBPassword 'Holds the password (for SQL Server Authentication)
Dim strSQLDBName 'Holds name of a database on the server
Dim objConn
Dim objRS

strSQLServerName = "server" 'Holds the name of the SQL Server
strSQLDBUserName = "user" 'Holds the user name (for SQL Server Authentication)
strSQLDBPassword = "pw" 'Holds the password (for SQL Server Authentication)
strSQLDBName = "myCMS" 'Holds name of a database on the server

'SQL Server OLE Driver
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open "Provider=SQLOLEDB;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"
'for debug only -adam
'If objConn.errors.count = 0 Then
'Response.Write "Connected OK"
'End If

set objRS = Server.CreateObject("ADODB.Recordset")

if objConn.Errors.Count > 0 then
Response.Write "Couldn't connect to database server"
Response.End
end if

objRS.ActiveConnection = objConn

if objConn.Errors.Count > 0 then
Response.Write "Couldn't connect to database"
Response.End
end if

%>


Reply With Quote
  #8  
Old January 7th, 2003, 02:26 AM
adammendoza adammendoza is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: California
Posts: 8 adammendoza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem with limit

I did more testing with just "sfsafd" and it seems to work?????

what is the limit for the sections? only a few words?

Reply With Quote
  #9  
Old January 7th, 2003, 07:02 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
adammendoza, there is no need to post the same questions multiple times in different threads.

Reply With Quote
  #10  
Old January 7th, 2003, 07:23 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
adammendoza,

Here are my revised versions of the asp code.

I also added a drop down list for the authors names (which requires corresponding fields/tables in the db).

I put my connection info in an include file instead of on these pages.

I was able to add multiple articles and multiple pages.

Hope this helps!
Attached Files
File Type: zip articles.zip (4.2 KB, 396 views)

Last edited by aspnewbie : January 10th, 2003 at 09:41 AM.

Reply With Quote
  #11  
Old January 7th, 2003, 10:32 PM
adammendoza adammendoza is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: California
Posts: 8 adammendoza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile

Quote:
Originally posted by Ben Rowe
adammendoza, there is no need to post the same questions multiple times in different threads.


sorry, it was my first time posting and I put it in the wrong place and then I posted it in the proper place.


Reply With Quote
  #12  
Old January 11th, 2003, 07:57 AM
ucap ucap is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 2 ucap User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
FYI

The file showarticle.php has a wrong hardcoded link in it. Line 20 should be
PHP Code:
<a href="fullarticle.[B]php[/B]?articleId=<?php echo $row["articleId"]; ?>">Read More...</a

Reply With Quote
  #13  
Old January 26th, 2003, 12:17 PM
nkunicki nkunicki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 32 nkunicki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Hi, i also have a problem with this. showarticle.php and fullarticle.php are both showing querystrings with no values (eg. http://localhost/fullarticle.php?articleId=). Since im a newb to PHP, i have no idea how to fix this :/

Can somebody help?

Thanks

Reply With Quote
  #14  
Old February 1st, 2003, 05:09 PM
WebGuy WebGuy is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 54 WebGuy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
I'm rather new to JavaScript, and just have a few questions about the article.

Why limit the number of pages to twenty?

And let's say I have an article with twenty pages, but five main sections. How can I have only the title pages linked to at the bottom of each page?

Thanks.
__________________
Sincerely,
Corbb O'Connor, Author at DevArticles

Reply With Quote
  #15  
Old May 4th, 2003, 01:45 AM
taintedutopia taintedutopia is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Calgary ab canada
Posts: 6 taintedutopia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to taintedutopia Send a message via AIM to taintedutopia Send a message via Yahoo to taintedutopia
Hey guys... I hate to bring this article up again, but it's really badass... and I love the javascript..

However, the javascript doesn't work in Mozilla...

Is it possible you could provide a cross-browser solution? Or break it down so i can create a multi-page system WITHOUT the javascript?

-Shade

Reply With Quote
  #16  
Old May 8th, 2003, 05:27 PM
dionysos dionysos is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 5 dionysos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
aloha to everyone

first i have to say: sorry for my bad english but i try everyday to learn more and more of this beautiful language...

but now i want to describe my problem...

all the code for putting the data into the db and delete them works fine but i canīt find a way to get the pages back to the selectbox to edit the single pages. i could imagin that this is a problem of the java script code...

i tryed to put the data back into the hidden input fields but it dont works...

PHP Code:
<input type="hidden" name="pageTitle{PAGEID}" value="{TITLE}">
<
input type="hidden" name="pageContent{PAGEID}" value="{CONTENT}"


i would be very happy if someone could help me.

BIG thx

dionysos

Reply With Quote
  #17  
Old May 9th, 2003, 10:28 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
i dont actually have the code on me to do this, but if you understand how the multi page manager works, this should make sense to you.

As you know the values are stored in javascript variables and then posted to hidden fields when you submit the page,

to modify content, you just need to manually set these javascript variables

Reply With Quote