Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 08-20-2010, 11:56 AM
hostie hostie is offline
Junior Member
 
Join Date: 08-20-10
Posts: 6
iTrader: 0 / 0%
Question Problems with code - New display upon click or refresh?

Hey guys,

Let me explain a little in what I'm trying to do.

Basically, there will be a main page, and a submit text page.

The main page will have a random text pulled and displayed, the user can do 1 of 2 things to change the random text on the page by either "Refreshing" or clicking "Next"

That is where I am stuck, I can't get random text to be pulled from the database, I probably don't need the db at all, but it was for management purposes.

Also, I'm stuck on the "Submit your own text" page. I want the text they submit to be manual approval, but upon approval, I want it moved to the database.

If you think a database is not worth the time, I would be more than happy just manually adding it to a list of text that the main page would call to to gather the random text bit displayed.

If none of this makes sense, please, I'm more than happy to answer questions.

Thanks v7n
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 08-20-2010, 04:10 PM
Luxmo's Avatar
Luxmo Luxmo is offline
Member
 
Join Date: 07-08-10
Location: City of Industry, California
Posts: 36
iTrader: 0 / 0%
Quote:
Originally Posted by hostie View Post
Hey guys,

Let me explain a little in what I'm trying to do.

Basically, there will be a main page, and a submit text page.

The main page will have a random text pulled and displayed, the user can do 1 of 2 things to change the random text on the page by either "Refreshing" or clicking "Next"

That is where I am stuck, I can't get random text to be pulled from the database, I probably don't need the db at all, but it was for management purposes.

Also, I'm stuck on the "Submit your own text" page. I want the text they submit to be manual approval, but upon approval, I want it moved to the database.

If you think a database is not worth the time, I would be more than happy just manually adding it to a list of text that the main page would call to to gather the random text bit displayed.

If none of this makes sense, please, I'm more than happy to answer questions.

Thanks v7n
Random row select with mysql:
Code:
select * from tableName order by rand() limit 1
And about your moderation/approval process...pretty much the only way to do so would be to use a database...at least the most efficient way would be to use a database. You would basically setup a table for the submissions, then write a back-end process where you would view those submissions then when you approve them they get inserted into another table which would be the main table, or you could simply have a field within the main table which would be like "active" or whatever you want to call it and if it's "1" the text would be live on your site, otherwise it would be pending moderation (not live/active). Hope this helps.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get code from one website and display it on your own? DigitalAlien Coding Forum 1 07-28-2010 07:15 PM
Display HTML code daniel0012 Coding Forum 6 03-11-2007 11:49 AM
click counter code problems Tariel Zivzivadze Coding Forum 4 08-02-2004 03:02 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 01:39 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC