Includes and forms

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Includes and forms

Post by John Cartwright »

Okay I have my index file ( index.php ) which loads up admin.php in it when clicked on a certain link. Now if I wanted to add to my database from admin.php ( loaded from index.php ) would I have to change the form action to index.php or admin.php. I tried setting the form action to admin.php but that doesnt work, neither does php_self


Or what. The variables that load admin.php are

?p=4&a=2 and this is what my form action looks like.

Code: Select all

<?php
	   "<form action="{$_SERVER['PHP_SELF']}"\n".
?>
I also want to keep the result msg in index.php and not in a seperate window.
Last edited by John Cartwright on Tue Feb 17, 2004 1:05 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Okay problem fixed I just had a bit a bad coding :S...

But how to I add those variables when the form is submitted aswell?>

Edit* another problem is that index.php is the one that checks the variables :S and sets the includes depending on whats being loaded. Is there a way around this? so that even though is xe/admin.php being loaded index.php still checks the variableS?
Post Reply