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> </p>
<p class="style17 style9 style2"> </p>
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving Things Around
i need to beabe to... for example ----------------------- item_id item price 1 widget 12.40 ----------------------- i need to move the item and price into a new table. here is the script i use at the moment but it only puts the item in to the item column i need the price in there as well. how do i acheive this? $sql="INSERT INTO order_line (item) SELECT shop.item FROM shop WHERE shop.item='widget'";
One $row For Multiple Things
I have a page which at the top has a select statement, further down it needs to pull one row from the DB using $row (which displays the locationname that matches the location ID. Then it needs to loop through the records that match search criteria and display them. With only one $num_results = mysql_num_rows($result); the page works fine. With more than one it all gets a bit messed up. PHP Code:
Php Newbie Want To Use Php To Do The Following Things
I wanna use a textarea and a submit to transfer the text area into a file. and then the PHP program using a .exe program open this file, processing the file, and save the output in another file then PHP will open this file and update the html within the text file and send to the customer My question is: if this possible? what if the users input is not valid for the .exe file? how to analyze this in php? what if multiple users click this php file?
What's Slowing Things Down?
I have a problem with a php page. I have a setup with Apache 2.0, PHP 5 and Postgres 8.1 on Debian 4.0. My script uses simplexml to parse large xml files ( 8 files at 2-15 MB ea. ) and do inserts into the database. The problem is twofold. One, output on the parsing page seems to come in starts and fits. I have a message to the user that gets echoed each time parsing a file is finished; but these messages come all at once, like two or three at a time. In other words, the message doesn't come when the parsing is finished; they seem to build up. It's a simple loop so I don't think the problem is in the program Also, when I am going through the parsing loop for a set of files, the rest of the site doesn't respond until the looping is over. The parsing seems to basically stop all web serving. How can I find out if the problem is with Apache, PHP, or Postgres?
Security Things To Do When Using Sendmail
Now I need to use the mail() function in some of my scripts! What security risks am I taking? I know that if I have a $email variable that tells the mail() funtion where to send email, a spammer can simply use my script to do his dirty work! Am I paranoid? I guess so, I try my best to learn security issues. But have you a work around like HTTP_REFERER or something to make sure that my script will only accept data from my server and not anywhere on the internet! I also have many security questions coming up because I am in the works of a script that creates/changes html pages online so my clients can change their specials and what not.
How Can One Variable Equal 2 Things?
I'm having a problem that is baffling me... say I set a session variable as so: $_SESSION['temp'] = "default"; Now if I test the following two conditionals: if($_SESSION['temp'] == "default") and if($_SESSION['temp'] == 0) they both return TRUE. I don't understand why this is... if anything, I would have thought testing if it == 1 would be a boolean true since the variable exists and is not NULL, but testing if == 1 returns FALSE.
Session Remember Things It Should NOT....
I use sessions to store information in $_SESSION. However, variables that are not in $_SESSION that I define myself is also remember between pages in the same session. What gives? Is $error_msg a some kind of global variable? So, I might have two pages, let say page1.php and page2.php. They both use the variable $error_msg and session_start();
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:
Forwarding PHP Data To Another Php And Password Things
I got 2 questions. First, if im in the following adress: http://somewhere.com/somewhere/index.php?id=10 That page has a form. When the form is filled, and the submit button is pressed, how do i send the id=10 with the form? Something like this: http://somewhere.com/somewhere/inde...email=something Second, in my database, if have a record like this: Name: Me Email: me@me.me password: you The question is, how do i make a php, that asks for Name and password (ok i can do that), and then VERIFIES , if the NAME and PASSWORD are correct. Then it would allow to edit the email.
Checking Things Exist On The Server
I'm trying to construct a simple checklist script which can be run when a PHP project is installed on a new server. The idea is that it would go through a number of checks to ensure things are available and configured correctly to run the installed project. As an example i wanted to ensure the Smarty template engine is installed and available. A quick test. PHP Code:
Adding Unique Things To A List
Let's say I have 100,000 pages of text in HTML files. I want to create a lexicon in my database of all the unique words used. What's the most efficient way to do it? I have a script working away right now, it's been running for over 6 hours! Here's what it does: 1) it opens a file. 2) parses all the words with a Regex. 3) loops thru the list of words, a) SELECT from the database, to see if the word already exists. b) if not, then it INSERTs the word. 4) loops back to 1) to open the next file. My database table looks like: ID - word --------- 1 abalone 2 tweezers 3 patrimony 4 kafuffle So... Which is most efficient? 1) SELECT to see if a word is there, then INSERT if it's not found. (do this millions of times) 2) INSERT all the words blindly, then after it's done, remove any multiples. (this would create a monstrously huge table) 3) Use the word itself as a Primary Key. Would I get a database error? or would the database (mySQL) ignore INSERTs that try to use a multiple primary key? 4) ... some other method? efficiency is key, since as I said, this is parsing millions of words taken from HTML pages, and it will be done rather often (maybe once a day).
Finding Things In Zip Code Radius
Does anyone know anything about how the process for typing in your zip code and how many miles to search around that zip code works? For example if i had something saying i have 500,000 members, and i want to see which live in a 20 mile radius of the zip code 32142. How would i do that? A point in the right direction or anything would great.
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:
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?
Sorting Sql Results In An Array Using Things Outside The Array To Sort Them?
I'm using PHP to connect to a database full of place names, and their associated post codes, latitude and longitude on the earth. A user types his or her post code into a form, plus a distance (in miles), and the script looks for other area codes (first half of the post code) within that distance. I can do that fine, but the results are ordered alphabetically by postcode, and I want to order it by the distance. Problem here, is that the distance isn't part of the array taken from the database, it takes the latitude and longitude of the area it's on in the while loop, and calculates the distance between the user's post code and that one, but it's not part of the array, so I can't sort the array using it. How can I sort it? Can I add the calculated distances to the array, and sort it using sort()? If yes, how do I add them to the array? Here's the page, just to explain better what the script does: http://navimaker.org/ed/owain/results.php?postcode=gl15&distance=34 Mess around with the postcode and distance vars. I'd put the source on here too but I'm doing all this over SSH and can't copy & paste very easily .
Are $_COOKIE["cookieID"] And $cookieID Two Different Things?
If you declare a cookie with header("Set-Cookie: ...") and you have tracker as $cookieID, would $_COOKIE[cookieID] and $cookieID two different things? I mean you can always access $cookieID through the $_COOKIE, but when you change $_COOKIE[cookieID], does that reflect the same change in $cookieID?
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.
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:
|