Forum Moderators: coopster

Message Too Old, No Replies

Creating forms / Admin login?

Oh no not forms...

         

Sypher_5

1:41 pm on Dec 29, 2004 (gmt 0)

10+ Year Member



Well I have the hard part done, I think. The form/s I did works perfectly, I'm so amazingly chuffed with myself for working them out with little to no help.

My problem?

I want to turn the three pages into one page. Currently it goes:

Content Input -> preview -> Saved -> Back to start.

And from preview go back to Content Input to modify anything that's not working.

Now these are three different php files and I know they can be put all into one and just a different section loaded up on each submit.

How do I go about doing this? I have a download script that does ( submit new item - edit - delete etc ) this but I cant make any sense of it, it's coded in german I believe so the comments aren't helpful.

A really basic version of this would be great to work off if possible.

Of course this is for site administration and I'm wanting to add some sort of login, my problem is I dont understand how "sessions" or anything like that works, the php & apache manual's are too "tech" for me to get my head around. A nice simple to understand explaination ( demo even better ) would do wonders for my comprehension. I dont have mySQL access either :S

Thanks to those that take the time to look and read this, and a bigger thanks to those that can offer some help.

mcibor

4:13 pm on Dec 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For the pages you can make a new variable, eg $action
past it as _GET, or _POST. That means if you're sumbitting a form then it should be
<input type="submit" name="action" id="action" value="preview"/>
etc.
and if it's just a link do:
<a href="index.php?action='preview'">preview</a>

and in php just write

<?PHP
if(!($action = $_POST["action")) $action = $_GET["action"];

if($action == "preview") include("preview.php");
elseif($action == "Saved") include("saved.php");
else include("start.php");
?>

Hope it solves at least one of your problems. With sessions I don't use them yet, but I heard that you have to just to pass session_id through $_GET or _POST.

Have a nice New Year!
Best regards
Michal Cibor

PS remember that in <a> there cannot be any blank spaces