Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

php help


ghost's Avatar
0 0

okay, so i'm new to php and setting up my site and i've got this

<input action="bugs.php" method=POST>

….ect. okay, but when i do this and they submit throught the form it goes to that php page. Do i have to change the method so it just submits it to the page and returns that to the current page?


ghost's Avatar
0 0

if this isnt enough info to understand what the problem is, lemme know


ghost's Avatar
0 0

The actual submitting of the forms is done by the browser so, short answer, no.

Just try and redirect or keep it all on one page.


ghost's Avatar
0 0

heh…..alright.


ghost's Avatar
0 0

in the php page just put a simple redirect tag to go back to the original page


ghost's Avatar
0 0

is there a way to post to a php file from a php file


ghost's Avatar
0 0

What exactly do you mean post to a php file from a php file. Do you mean like sending data from one file to another from the form? If that is so then that is what you do when you set the action to a file other than itself. Not entirely sure what you mean.


ghost's Avatar
0 0

like i have a php file doing some stuff and i want it to post to the display php file since they are different


ghost's Avatar
0 0

I think I get what you mean. Just change the action attribute of the page that is doing the work to the page that is getting the information.


ghost's Avatar
0 0

problem is there is no action element, because there is no form. the php file is only php, or is there a way to make something auto submit?


ghost's Avatar
0 0

also, when my page loads, sometimes the table size is way shrunk and the i refresh with F5 it fixes it. any ideas?


ghost's Avatar
0 0

Page load problem could be cause by incomplete caching of your browser, as to you other problem I can't quite see what you mean


ghost's Avatar
0 0

okay….like i have one page that submits data via form to a php script. that php script then does something with it and needs to submit it to another php script. (they need to be in seperate files, so i cant just do it all in one). how would i send it to the other file without making a hyperlink or javascript redirect using url vars to pass the data.


ghost's Avatar
0 0

Catch me on MSN, quickly….


SySTeM's Avatar
-=[TheOutlaw]=-
20 0

only_samurai wrote: okay, so i'm new to php and setting up my site and i've got this

<input action="bugs.php" method=POST>

….ect. okay, but when i do this and they submit throught the form it goes to that php page. Do i have to change the method so it just submits it to the page and returns that to the current page?

Are you sure you don't mean <form action="bugs.php" method="POST">


ghost's Avatar
0 0

haha…..i did mean that…. mozzer and i talked and he got me sorted out using include. thanks system for point that out for me…it was a typo, but thanks anyways :)


lukem_95's Avatar
Member
0 0

if your form is on a php page, use

markup&lt;form name=&quot;form1&quot; method=&quot;POST&quot; action=&quot;&lt;? echo $_SERVER[&#39;PHP_SELF&#39;]; ?&gt;&quot;&gt;

and it will post it to the same page.

You can then have some code with something like:

&lt;?php
if($form_variable1 != NULL){
//Your page content here
} else {
include(&#39;loginform.html&#39;);
}
?&gt;