Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Pressing Submit Refreshes My Login


I've made a log in script but when I press submit...The script just appears to refresh. Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Session Problem - Login Screen Continually Reloads After Pressing The Login Button
I am trying to get sessions to work on a log in screen to give certain
users access to certain pages/directories. The problem is that when
the login button is pushed (or the enter key pressed) the login screen
redraws, never loading the next page. I don't get any error messages.
I am using FreeBSD-5.1/Apache-2.0.46/MySQL-4.1.0.1/PHP-4.4.3.4

I have pasted the code below:

Pressing "SUBMIT" VS Pressing ENTER
I have a little weired problem .

A PHP function attached to a form produces wrong resutls when i perss ENTER insread of pressing the SUBMIT button by mouse ? How can that be solved ?

Submit Form By Pressing Any Key.
I would like to create a hidden form which shold be submitted after
user press any key. Is it possible?

Populating The Drop Down And Pressing The Submit Button
1. The first is I have two drop down menus. The first is "year" and the second is "mfr". When a user selects a year from the drop down it then populates the second drop down, mfr, from the MySQL database. Theat is working fine. But the problem I am having is the "submit" button (which I have labeled as "browse"). When I click it. Nothing happens, no action tacks place. I have looked over the code and I can't figure it out. (See Code Box 1 Below).

2. Right now the "mfr" drop down is populated by the MySQL database and reads with a list like "Acr", "Alp", etc. These are abreviations. I need to set up an array to have them instead read the entire mfr name. Example: Instead of "Acr" it needs to be "Acura". Instead of "Alp" it needs to be "Alpine". I need these full names to appear in the drop down. I know I need to do something like this (See Code Box 2 Below) but I can't get my finger on it. Code:

Stop User From Pressing Refresh ?
i have a form that posts to a text file. how do i stop or do not post that data to the text file multiple times ? if user press refresh 10 times, the same data will be posted 10 times to the text file ?

$tmpfile = fopen("info.txt", 'a');
flock ($tmpfile,2);
fwrite($tmpfile, "
$refer1|$email1||$name1|$user1|$pass1|$today" );
fclose($tmpfile);

Problem With Pressing Enter On One-textfield Form
I have a mail form, where I would like the users to enter a secret code and
check one checkbox before the form are processed and the values can mailed.
Otherwise stop and display an error. But it won't work. What's wrong with my
nice newbie-code? Here it is:

The form:
<div>
<form method="post" action="process.php">
<p>Name:</p>
<input name="name" type="text" />
<p>Email:</p>
<input name="email" type="text" />
<p>Subject:</p>
<input name="subject" type="text" />
<p>Message:</p>
<textarea name="message" rows="6"></textarea>
<p>Enter secret send-code:</p>
<input name="secret_code" type="text" />
<p>Agree to terms?:</p>
Yes <input name="check[]" type="checkbox" value="yes" />
No <input name="check[]" type="checkbox" value="no" />
<br />
<input type="submit" name="submit" value="Send" /><input type="hidden"
name="do" value="send" /><input type="reset" name="reset" value="Reset" />
</form>
</div>

Here is process.php:

<?php

FORM MEMORY ON PRESSING BACK BUTTON
Do most browsers retain form fillup memory of previous page ? That is
when the user presses back button, the forms on the previous page come
up filled.

Pressing Browser Back Button - Form Filled Data Disappeared
When filling out a web form on a php page that is submitted to a search
which lists the results based on the criteria provided (in the form), all
works fine and as expected.

However, when I press the back button to amend the form all of the search
criteria data has gone and I have to fill it all out again if I want to do a
similar search which is frustrating. (This does not actually happen in
Firefox browser but most of my users will be using IE). How can I prevent
this from happening?

Previously I made a post about avoiding "Page has expired" and the
conclusion I came to for that was not to use a "POST" which did the trick.
But now I want to retain the data I input?

Submit Form Without Clicking Submit Button
I was wondering if it is possible to use something like Javascript to make it so you don't have to click the submit button on a form to make it submit, while using php and mysql. e.g. Code:

Submit A Form Without The Submit Button
Is there a way to submit a form without the submit button?  Do I have to use the javascript - document.formname.submit();

My Submit Script Fails To Submit All
I have been working on putting together a website for a virtual airline and one of the features I tried to get in my website is a register page in which users enter info into fields and then hit submit to e-mail the info to my e-mail address. Code:

How To Submit A Form Without A Submit Button
how i can submit a form without using a submit button, i have to use this in one of my ongoing project.

Login Lgout And Login Without Closing Session Gives Redirection Error
I am stepping through a text book that sets up different websites. The
one I am testing is user registration.

I set up the scripts and this is what I observe:

Login (verifying against a mysql db) - no problem.
Logout - no problem.

Close the browser and try again - no problem.

Login > Logout > Login WITHOUT closing browser I get:

An error occurred while loading http://login.php when it should redirect
me to http://localhost/index.php.

I read somewhere on the news group that the
header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname
($_SERVER['PHP_SELF']) . "/index.php") (in my example code) is called
once and so the error?

The logout.php destroys the $_SESSION variables, session itself and any
cookies so I thought it would be "like new" the second time around?

It appears to be linked to sessions but don't know enough to know how to
correct.

Bypassing "submit" Or Auto Submit With Forms Data
In a regular HTML screen where you have inputs within a FORM, you usually have a SUBMIT input tag to submit the form data to the action'ed item in the form tag.

In alot of sites, I see that you can enter a field, then to its immediate right, is a GO button to submit the choice. Has anyone had experience with this, and if so, how would you code that in PHP? I have also seen where you can choose something from a dialog box, and as soon as its chosen, the form data is submitted. Is that possible in PHP also?

Login Script Forcing Me To Login Twice?
I have built a login script and for some strange reason its forcing me to login twice. Not saying the user/pass is wrong first time, it moves the headers fine, it just show the old page with the login any ideas? Code:

Login Page Not Redirecting After Login
I've used this same snippet of code in other login forms without a problem (with some slight modifications from script to script) but this one seems to baffle me.

Basically it takes the login and validates the entries (validation works, error messages display if left blank), then checks the database for a match. If there's a match then it is supposed to forward the person onto the proper page using the 'header' function. Problem is it's not. Basically it's reverting back to the 'index.php' page (login page) and the display is completely blank. Here's the code for index.php: Code:

Php Login And MySQL Login
can anyone tell me the advantages of a login created with mySQL over just using php and writing to text files(if this is posible)?is mySQL safer and more secure in any way or just easier?

Submit
Is there a way by which I can use the submit putton on a HTML form to do both:

1. submit data to the form
and
2. open up a new link?

How To Submit Xml
is there a way to submit an xml document/file on real time without
using pear or curl? can you pls an example on how to do this?

PHP 101 (!$submit)
I have been following the php 101 tutorial and every script that uses :-

// if form has not been submitted, display form
if (!$submit){

I get an error. This is:-
Warning: Undefined variable: submit in C:/XITAMI/webpages/learnphp/push.php on line 4
I have done a bit of digging round in the forum and found out how to solve the error with
if ($submit) by using (isset($submit)). I can only turn off the errors on *my* web server not my webspace providers!

Submit
Mouse click on "submit" works, but not when I put an entry and push "Enter" on via the keyboard. (But we can't stop user right) Code:

Submit Once...
Is there any way using PHP to make sure that once someone clicks Submit if they click it again it won't send the data twice? If not is there any alternative using Javascript or something?

Automatic Submit
When you click a drop down box to display, then select the option from the drop down box after that, how do you make it submit automatically without pressing "go" or "submit" button? Can I do that in PHP?

Where Do They Go After They Submit An Email?
I have a contact page where visitors enter their text and click 'Submit.' The .php files do their thing and I get the email. The problem, however, is that after the user clicks 'Submit' they are then taken to a blank page where they are instructed to press the 'Back' button on their browser. This isn't good enough. Is there a way in which the user can be redirected to the homepage after they click Submit?

Want An Alternative Submit
When filling in a form I want to be able to go to ways,
first way when pushed "Continue" and second way by pushing "A" as
indicated below.

Problem is that input type button does not post the name, with other
words $_POST['A'] does not exist. How can I overcome this problem ?

One way is to add a checkbox in which the choice can be made and one
submit but that is a bit ugly.

<?php
if ($_POST['A']) {
echo "PUSHED ON THE A-BUTTON".$_POST['A'];
}
else {
echo "PUSHED ON SUBMIT";
}
?>
<BR><BR><BR><BR><BR><BR>
<FORM ACTION="<?=$PHP_SELF ?>" METHOD='POST'>
<INPUT TYPE="SUBMIT" VALUE="Continue">
<INPUT TYPE="BUTTON" NAME="A" VALUE=" A " >
</FORM>

Not Able To Submit With Enter Key
I am having a problem with my form, If I try to hit the enter key to submit the form, it refresh's the page instead of submitting, I have a switch so my form is like index.php?Act=Add my form has its POST as <? $_SERVER['PHP_SELF'] ?>
Is it my switch thats the problem?

Form Submit
A question is displayed and if the user types the answer and submit it, it gives the information if the question is wright or wrong and provides the link to the next question.
Now, i made few modifications to the script and show three radio buttons and where the user can select the answer and submit it.Now, after i made changes it does'nt seems to be working. PHP Code:

Submit Button Bug?
I think I've find a very VERY strange bug with form submit buttons (only tested on IE 5.5.). I've got a form in which a password can be changed, which updates a record in MySQl.

If you click the submit button, the page works fine. If you press enter whilst the submit button is highlighted, it works fine. However, if you're inside the text field where you're changing the password and you then press enter, it tries to submit the form but doesn't do anything!

Submit Buttons
Just installed apache 1.3, and php4 on a freebsd box. was playing around with phpweblog to look at some themes and get ideas for a layout but cant seem to get past the setup.

The problem is that it makes me set a pass, when i put in the pass and click on the submit button, nothing happens. I think I had this problem before with a submit button on a form before but thought it was something else .

Form Submit
The program I'm working on is a web-based CMS (content management system). There is a large editing form where users can add/update/alter content. Several parts of the editing process however require the user to navigate away from the page. The problem is that any changes made to the main form are discarded when navigating away (something I sort of forsaw but just never got around fixing early on - bad idea). To give you a better idea:

There is the main editing form called edit_buildings.php On it there are several text fields. The form is submited to a page called edit_submit.php which does all the processing and also outputs a log of changes made, to make sure everything went through ok.

However, on the edit_buildings.php page, there are links to other pages like edit_rooms.php and edit_features.php (I'm sure you can get an idea of how this works).

Is there ANY (easy) way of having the links to edit_rooms.php and edit_features.php get the form submimted and processed by edit_submit.php and then redirected to the originally intended destination (edit_rooms.php, edit_features.php) ?

Where To Submit A New PHP Extension.
I have developed an extension and I would like to see it become a part of a future distribution one day. Where can I submit it, so that it can be evaluated by the ppl, who package the dostributions?

Refresh On Submit
I have a php script with a form that insert data in a mysql db and
when I click on submit I would like the page to refresh after the
insertion, how can I do that? it's a php script that display data from
a mysql db, and the submit button modify the content of the page yet I
need to manually refresh to see the result of my insertion.

it kinda looks like this:

echo "<form method="post" action=$php_self>";
echo "<br>$dispayed_colname:<BR><INPUT TYPE="TEXT" NAME="hey"
SIZE="40">";

echo "<p><input type="submit" name="submit_the_values"
value="$submit">
</form>";

if($submit_the_values){
$sql=mysql_query("INSERT INTO $tabname($cols_to_insert)". "VALUES
($hey)");

//I would like to refresh $php_self here, please tell me if you know
:)

}

PHP Self Submit, Then Re-direct
I as the thread name indicates, i have a form that is a self submiting form. I was thinknig of breaking this up into a form handler, but i have about 50 drop down box's that need to be insterted into 4 different mySql databases. So my form will stay self submitting. But the problem i run into is after the form has been submited i want the page to then re-direct to a page that says that the form has been submited.

Form Submit
I wrote a php script to get user input from a submiited form. I want to display the processing result in a new customized window. How can I make the form result display to a new customized window?

PHP Form Self Submit ?
I'm try to figure out how to submit the Form Variable to Multiple Address. The basic form action is only post to single address like this, <form method= post action="abc.php">

If I want to post the same variable to more than one address when I click the submit button, like posting to folowing address:

1) abc.php
2) discuss.php
3) log.php
4) data.php
5) 123.php

Did your have any idea how does it work in php? Did anyone can tell me where can I find the tutorial teaching on this method or did your have any code sample that can share with me for reference.

The Submit Button?
I've just been looking a different ways to submit forms, however I find that all is not how it should be... In this incarnation, I have some php script that pulls information from a previous form so I can display it before submitting the data to a database, how ever if I do this: Code:

FORM SUBMIT
Can I pass data from one form to another on one page (what i've got is one form that when the submit button is pressed it submits the form in another window, part of my form:
PHP Code:

Query Only After Submit?
I am trying to have a query run only after the submit button is pressed. where should I be looking for the answer to this.... I know I could pass it on to another page to display the results but it would be better if I could have it all run on one page.

Confirm Before Submit!
I'm looking for a script that will give the client the ability to fill out a form, then, on the second page it will display all the information for verification by the client. If the client thinks that everything is ok, with no error, they will have the option "If there is no error press the "Submit" button.

Doing Two Things From One Submit
I have the folowing script which has two forms. the first adds a record to a
database the second uploads a file. The problem is each form has its own
button to perform the action. What I wish to do is to combine the two forms
and have one button to do the two actions. Please help

************************************************** *******************
$q= MY INSERT SQL HERE

<p class="style2"><strong>Upload A Resource </strong></p>
<form name="form1" method="post" action="">
<table width="607" height="304" border="0" cellpadding="0"
cellspacing="0">
<tr>
TABLE WITH TEXT FIELDS HERE THAT ARE SENT TO THE DATABASE
or</p>
<p>
<?php $add_order = mysql_query($q) or die('Query failed: ' .
mysql_error());?>
<input type="submit" name="Submit" value="Submit">
</p>
</div></td>
</tr>
</table>
</form>
<form enctype="multipart/form-data" action="FileProcessing.php"
method="POST">
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />

</p>
<p> Choose a file to upload:
<input name="uploadedfile" type="file" />
<br />
<input type="submit" value="Upload File" />
</p>
</form>

<p>&nbsp;</p>
<p class="style17 style9 style2">&nbsp;</p>

PHP Vs ASP On Submit Button
All about two submit button. don't know how php manage this but asp does this: PHP Code:

Submit Buttons Using Php
I'm new to using php coding. I need help with the following:
1. There is a submit button on the form and is saves information to
my database. After clicking on "Save Measurement" it redirects me to
another page in my site.

What I would like to do is change what page directs it to. Currently
the submit button redirects me to page /measure/men_measure. I would
like to be able to change this.
Please see below my page below:
<?php
include("../lib/BaseFile.php");
misc_navigation('measure/take_measure.php');
misc_auth('User_Measuring');

$query = "select * from ".DB_TABLE_PREFIX."_mes_men where user_id = ".
$_SESSION['auth']['user_id'];
$result = mysql_query($query) or die ("could not send query3");
$row = mysql_fetch_assoc($result);

foreach($row as $key =$value) {
$info[$key][$value] = " checked ";
}

if (!empty($_POST)) {
$query = "update ".DB_TABLE_PREFIX."_mes_men set ";
$first = true;
foreach($_POST as $key =$value)
{
$keys = explode('_',$key);
unset($keys[0]);
$key = implode('_',$keys);
if (!$first)
{
$query .=",".$key."='".$value."'";
}
else
{
$query .=$key."='".$value."'";
$first = false;
}

}
$query.=', filled6=1 where user_id='.$_SESSION['auth']['user_id'];
mysql_query($query) or die(mysql_error());

// update profile
$sql = "UPDATE " . DB_TABLE_PREFIX . "_user SET other=1 WHERE
user_id = " . $_SESSION['auth']['user_id'];
mysql_query($sql) or die(mysql_error());


Preview And Submit
I'm trying to be able to preview what is entered in a form before it's submited but i'm getting stuck - the preview button is submitting the form. Code:

Double Submit
I have a bank feature, players can add and withdraw money ect ect. What it seems people are doing is quickly when the server is under a load to add their money to it and buy something at the same time. So the money goes in the bank while they get the item they bought as well.

Is there anyway you guys can think of to stop people from submitting 2 forms at the same time?

Php Submit Form
what I am trying to do is make form so I can put my password in and then it sends it to my email from wherever I am. This what I have so far. For some reason I cant make it work Code:

Submit And Session
I have a registration form that if theres an error it fills back all the input boxes with the information typed... and when session returns the value of the input, if theres a > in it, it screws up the whole page

Submit Photos
I would like to create something similar to facebook idea. I would like the user to submit a photo and it must display upon next page refresh. i got an idea how to do text but the picture i dont. do the post it to a public folder on the webserver of do i store it in mysql dbase? how would i do this?

Submit Form
I have this code and when i put the amount of tickets you buy and hit Return it does not submit and there is no change to the database, yet when you hit the submit button it works. Code:

Submit Button
i want to have 3 submit fields,and a submit button,please tell me how to do this.my other question is how to connect this submit button info,to be written in a table in my Database.i have 3 fields in the table in my DB-"number", "comment" and |"date",if this could be of any help.


Copyright © 2005-08 www.BigResource.com, All rights reserved