Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-13-2012, 12:20 PM   PM User | #1
lumper
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 19
Thanked 0 Times in 0 Posts
lumper is an unknown quantity at this point
Exclamation Is it possible to create multiple entries from 1 form?

If i were to create a form that captured a "Topic" that would then show another form wih a "Message" textarea and a date stamp, lets say and gave the option to "Save" or "New" where "New" would post this form and show the exact same form again, but would asign it the value of "Page 2" under that topic?

Is it possible?

I have played around with a query or 2 but have had little, actually, no success.
[CODE]
if ($_SERVER['REQUEST_METHOD'] == "POST")
$topic = $_POST ['topic'];
$page = array("id" => $_POST['pageID'], "msg_txt" => $_POST['message'], "page_num" => $_POST['dueDate']);

function page_number ($pager){
$pager = page_num;
foreach as $pager ($i=0; $i<($pager); $i++){
return $pager++;
}


}

[\CODE]

As you can see I have no idea what I am doing and am trying to finish this project by Monday morning / preffeerably Sunday evening

Hopefully someone can help me .... PLEASE !!!!

Thank you
lumper is offline   Reply With Quote
Old 04-13-2012, 03:41 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,376
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
Maybe someone that understands what you want will come along and answer this, but I don't have a clue as to what you want. Why not code out the two forms you want and tell us what, in the first form, keys the second form and what from the first form is entered into the second form and then what you want to do with the information these two forms collect?
sunfighter is offline   Reply With Quote
Users who have thanked sunfighter for this post:
lumper (04-14-2012)
Old 04-13-2012, 03:50 PM   PM User | #3
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,500
Thanks: 44
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Quote:
Originally Posted by lumper View Post
If i were to create a form that captured a "Topic" that would then show another form wih a "Message" textarea and a date stamp, lets say and gave the option to "Save" or "New" where "New" would post this form and show the exact same form again, but would asign it the value of "Page 2" under that topic?
Please don't be offended but in your enthusiasm to describe your ultimately cool idea, you've forgotten to slow down and think about the best way of describing it. To put that bluntly it isn't very clear what you're wanting. It might be crystal clear to yourself (but you know what you want already so your somewhat vague description makes sense to you) but to the rest of us you're mumbling on about a form having a second page from what I can tell.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is online now   Reply With Quote
Users who have thanked tangoforce for this post:
lumper (04-14-2012)
Old 04-13-2012, 08:11 PM   PM User | #4
bucket
Regular Coder

 
Join Date: Sep 2008
Posts: 688
Thanks: 8
Thanked 17 Times in 16 Posts
bucket is infamous around these parts
I think what he wants to do it, to continuously create new messages without have to go through multiple pages.

Its like the vbulletin 'Save and reload'



Basically have 3 buttons, 'save', which returns back to the main page.

'save and reload' which creates a page, then returns that editor with the next avaliable page +1 to create and save.

'cancel' to scratch that page, and go back to the main.

I am unsure how to use 3 buttons, which might have to be done with javascript and can also add data to add another number to the previous page edited with a new blank textbox.

Did I explain it correctly?
__________________
MY MSN: Sith717@Hotmail.com
PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
PM me anytime for HTML, PHP or web design help. I will be glad to help you out.
bucket is offline   Reply With Quote
Users who have thanked bucket for this post:
lumper (04-14-2012)
Old 04-14-2012, 09:52 AM   PM User | #5
lumper
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 19
Thanked 0 Times in 0 Posts
lumper is an unknown quantity at this point
Thank you sunfighter and tangoforce - you are indeed correct, I could not see the trees for the forest

OK, slowing down a bit here.
I would like to create an interface with 3 main Elements.
  1. Topic Name Form (This is what the pages will fall under)
  2. Creat "Page" Form (This form will have preset fields for input)
  3. "Page" Explorer (A Tree View of Pages #1 - ...)

A user enters the topic and presses "Create" which in turn presents them with a "Create page" form which has several fields on it and 3 buttons :
  1. save and new
  2. clear form
  3. save (Which will close the session)

Save and New will create a "page" - a "Page" is submitted to the Database, the Page Form is refreshed (Cleared) and the "Page" that was just submitted to the DB is reflected in the "Page Explorer" as an icon.

Selecting a "Page" in the explorer will allow you to move it up and down in the range of pages or edit it or delete it.

A new page can then be submitted and reflects as Page2 and so on until the "[Save]" button is pressed and the session ended.

When the session is ended a form reflecting the every Submitted Topic and the number of pages it contains.

I think better in pictures - I am a Graphic designer by trade so I have attached the basic kinda layout thing for you of the main Interface and the list interface.


Thans again for your help and criticism ... I really do appreciate it.
Attached Thumbnails
Click image for larger version

Name:	Interface_1.gif
Views:	12
Size:	7.5 KB
ID:	11048   Click image for larger version

Name:	Interface_2.gif
Views:	10
Size:	5.8 KB
ID:	11049  
lumper is offline   Reply With Quote
Old 04-14-2012, 07:09 PM   PM User | #6
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,376
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
This is not an easy task lumper. If you don't know how to program I suggest you go here and read up on what is needed when you need it. http://www.w3schools.com/html/default.asp Notice forms in the menu on the left under HTML Basic.

I would not start with multiple topics, but with a single topic with multiple pages. Your first image is where I would start. It's a two column page, leave the left column blank. Start on the Add a Page button to open a div much bigger then what you have shown and put the clear- save -edit buttons on that div. Code those buttons and save page to a file for now. Then you can work on the left column.

That's enough for starters. You can always ask for help as you go, but we would like you to post the code your having problems with. We help, not give you code.
Good Luck.
sunfighter is offline   Reply With Quote
Old 04-15-2012, 09:12 AM   PM User | #7
lumper
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 19
Thanked 0 Times in 0 Posts
lumper is an unknown quantity at this point
Thank you Sunfighter, I have a little piece of code that I am working on, I was more looking for a way to use a form recursively under 1 topic. I will go through the Tut you have suggested and post my code in a bit.
lumper is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:06 PM.


Advertisement
Log in to turn off these ads.