Form With To Submits, Which One To Default To?
Say, I have a form. Both cancel and save (in that order) are submits, then in the code I check which button was pressed. The point is that I want the save button (2nd) to be default, not the cancel. Is there a way (in js?) to "focus" the other button? One other way to be some simple js, which submits the page anyway......
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Server-Side Form Submission - Form Submits To Form, Which Autosubmits. BAD!
I have a php form from which the user fills out their name and address and clicks "Submit". The form goes to a page that stores the data in a mySQL database, then, using hidden fields, populates another form and actives with a javascript onLoad=submit() to send the information on to the final destination. I cannot control or edit the final destinations web page, which is why the interim page is needed. What I would like is for the user to fill out the form, and upon submission have the data recorded into the database and have the data passed on in a "form like way" on to the final destination BY THE SERVER, not by the use of a hidden form page that auto submits. Any suggestions? Here is the interim page's code below: <? $link = @mysql_connect($db_host_name, $db_name, $the_decoded_password) or die; @mysql_select_db($db_name) or die; $query = "INSERT INTO web_link VALUES ('', '$a', '$b', '$c','$d', '$e', '$f', '$g', '$h')"; $result = @mysql_query($query) or die; ?> <html> <head> </head> <body onLoad="document.contactme.submit();"> <form name="contactme" method="post" action="http://www.test.com/cgi/storethisdata" > print "<input type="hidden" name="first_name" value="$first_name"><br>"; print "<input type="hidden" name="last_name" value="$last_name"><br>"; print "<input type="hidden" name="email" value="$email"><p>"; print "<input type="hidden" name="phone" value="$phone"><p>"; ?> </form> </body> </html>
How Do I Make A Normal Textlink That Submits A Form?
I've got the following search form: <form name="search" method="get" action="main.php"> <input type='text' name='searchquery' size=ཇ' value='Search'> <input type="submit" name="Submit" value="search"> <input type="hidden" name="section" value="home"> <input type="hidden" name="topic" value="search"> <input type="hidden" name="subtopic" value="results"> </form> Now I want, instead of the grey submit button, a normal (text) link that can submit this form. I see this on many sites but I have no idea how to make such a 'submit link'. Some people said it has something to do with an onClick() function, but they don't know the value for it.
Form Submits Every Time You Request Something From Another Class?
I have html form from time to time I access methods from class forms since it contains all of the function are needed to work with forms. in the form it self I request 2 different functions from class form, the thing is when I press submit button, the form submits it self the ammount of times as the function that request data from forms.php class. Code:
Entering The Date As Default Within A Form
Anyone know how to enter the time into a form or a website that might tell how? I'm using the following html code and trying to get the time to default into the text box. thanks html code <tr> <td><b>Date:</b></td> <td align="left"><input type="text" name="date" size="8" maxlength="8"></td> </tr> php code <? print strftime("%m/%d/%Y"); ?>
Automatic Select Form Field Default
I would like to allow registered users to my site the ability to change your personal information. Let's say the country in which they are in. The country field is a drop down list. So its supposed to read from the table and make the value the default. How am I going to do this?
Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10. I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???
Explode What The User Submits
I have an form that inserts stuff into the table but one of fields could have a "/" in it so in my insert script page I have all m y insert script stuff. You'll notice that I put in the explode stuff but perhaps not in the right spot and in my sql statement I just put $positions rather than '".$positions."'
2 Submits Useing The Same Inputs....?
I have a page that has like 50 inputs... (to create an image) so many that I want a preview button and a submit button the submit will add the info to the database like it should but the preview button will make a pop up with a new page my problem is that i need all the info sent to both pages....if they click preview i need all the inputs send to preview.php and if the user clicks submit i need all the inputs to go to generate.php how do i do this?
Multiple Submits Broken In PHP5
I have a page with multiple submit buttons. Call them "ok" and "cancel". I have the coding in PHP as: if (isset($ok)) { something } and if (isset($cancel)) { something else } This works fine in PHP 4.X. In PHP5 it doesn't work at all (no action at all). What is the replacement coding and how can I code so that it works in all versions of PHP?
Custom Fields - When User Submits It Goes To Admin's Email Or PM
I would like to create another page on my phpBB that would have customizable fields that users could enter information into and then submit the page. The info would then be sent to the Admin's email or PM. Here's a screenshot to illustrate, this would be a registration for a car show: <snip> Any ideas how to add these custom fields and then submit to an email or PM?
GD Default DPI
I'm currently making a website that needs to edit images with adding text, the problem is, the picture starts at 300 DPI (pixels/inch), but after GD edits the image, it's set to 72 which i read to be the default value GD always uses. is there a way to edit that default to a higher number, if not are there other ways to edit images through php and still keeping the original DPI.
Magic_quotes_gpc On By Default In PHP 4.3.3?
Prior to upgrading to PHP 4.3.3 (Windows), magic_quotes_gpc was turned off in the php.ini file. However, when I upgraded, I told the installer overwrite my previous php.ini files. I didn't have anything special in my previous version of php.ini and I wanted a clean slate. After I upgraded to 4.3.3, I noticed that my scripts were acting strange, specifically form input. I checked php.ini and found that magic_quotes_gpc was turned on. I unzipped the installer exe and upon inspecting the php.ini, I found the default php.ini included had magic_quotes_gpc On. I thought they were going to set magic_quotes_gpc off by default in the later versions. Anyone know why they did this? Was it a mistake?
What Is Better As A Default Value: NULL Or ''?
I would like to collect some statistical data and then make some reports on it. I'm creating tables for this task and i'm not sure what is better for filling default values: NULL or ''. What is optimal for storage purposes and for further reports creation?
Default Image
How can I write a function in such a way that it would look for a specific image to load. If that image exists on the server it will load it, if not it will load a default image.
Dropdown - Default Value
I want to be able to have a drop down list that doesn't necessarily have the first item as the default. The content is being populated by PHP so I have no idea how to do it.
Default Variable Value
Does php provide a built in way to use a variable's current value if that variable is already set but to use a default value otherwise. That is, a more compact syntax for: $some_var = isset("$some_var") ? $some_var : "default value";
Set Column Default
we have a table sistock with column cameramodel varchar(30) and try to set default value to blank with the following: ALTER TABLE SISTOCK CHANGE COLUMN CAMERAMODEL CAMERAMODEL ENUM ('INSTOCK', 'BACKORDER','SERVICE','OBSOLETE') DEFAULT ''; and we get an error at the mysql prompt;
ImageString: How Do I Use A Font That Is Not One Of The Default 5?
I am playing with imagegd for generating images, and was wondering if there is a way I could use a font that is not one of the default 5? I remember reading somewhere about a TT font library for imagegd, but don't remember the specifics. If someone could point me in the right direction I would appreciate it.
Problem On Default Value : : MySQL
Problem on default value : : MySQL I am facing problem in this line `datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, when I tried to crate a new table in MySQL(version 3.23.47-nt)
Using Default DB, User, Password
How do I use odbc.default_db, odbc.default_user and odbc.default_password defined in php.ini in the mssql_connect() function? I do not want to define these vars globally at the application level for many reasons. Shouldn’t calling the function without any parameters force PHP to look at the INI file for the defaults?
Object Default Value In Constructor
I'm trying to write a class with a constructor that takes a single object parameter. So far so good, but I can't for the life of me make the parameter optional. I understand how to do it with a numerical or textual parameter, but not with an object. I tried null, but it doesn't work. class A { } class B { function B($a = ???) { if (!isset($a)) $a = new A; } }
Default Selection From Query
I'm having difficulty trying to have a DEFAULT selected record from a query in my dropdown box (code below). I have about 20 records in a 'facility' table, which listed names of our company's locations. I want to default select one of those records "exton" to be selected in my dropdown box. Code:
PHP Default Host Best Practices
I've got my dev and production environments all setup, and the mysql DBs working fine. What need to do is set the mysql.default_host option in php.ini to be one thing on dev, and something different on production. Unfortunately, my web host doesn't allow me to mess with php.ini. So, what's the best way to specify a different host to mysql_connect() on dev and production. Yes, I could manually edit the variable everything I FTP, but I'd rather not. Should I use a global variable in a separate include file? Other options?
Default Argument Values
something like this possible in PHP: function foo($a=1, $b=2, $c=3) { //... } foo($b=2); Will this assign $a and $c to default values?
How To Overwrite Default Php Installation
On my linux system php seems to have been installed by default. When I type: "which php" it tells me /usr/bin/php I installed php and it has put an executable in the /usr/local/bin/php "which php" still says /usr/bin/php "whereis php" php: /etc/php.ini /usr/bin/php /usr/local/bin/php /usr/local/lib/php /usr/local/lib/php.ini /usr/local/lib/php -v shows the new version but php -v shows the old version. How can I correct this problem? I want to run the command php -v and it shows the newest version. I have already tried removing /etc/php.ini /usr/bin/php
Default Value To Insert Into MySQL
What should I insert as the default value if a form field is blank? My fields don't currently accept null. if($_POST['height']) { // error checking $height = $_POST['height']; } else { $height = ''; } Should $height be equal to '', NULL, or maybe 'NULL'? I'm thinking 'NULL' incase I or someone else decides to change the field to accept null?
PHP Session Default Timeout
what is the default Session Timeout for php...is there a way to increase this on the web server I am hostign my php scripts on..
Default Date Drop Down
Ive got the following drop down which works perfectly, although the default date is set to todays date. Could you please advise me on how to set it to show -- -- ---- instead of 31 05 2007? Code:
Php's Default Character Set
Where does it say that on php.net, that iso8859 is the default charset for strings? Can't find anything about it.
Display A Default Image?
Is there an "if" statement I can use to check if an image exists in a certain directory, and if it does display it, but if it doesn't exist then display another image in a different directory? I've written simple "if" statements for text display, but nothing like this. Is this possible? It might help to tell the scenario. I am putting together templates for teacher web sites. If they wish, they can upload their own logo into their upload directory to display at the top of the page, but if they choose not to upload their own logo I want the default (district) logo to appear there. The default logo is located in another directory on the same server.
Default Error Page If No Rows
If there are no rows in the result of my query, instead of just showing some text in the browser saying no rows found, could i redirect to a standard error page using this function?
Need Access To Default File Attributes
When I was first learning php, I created an upload script. The basics of the script had: <form method="POST" ENCTYPE="multipart/form-data"> <input type="file" name="FILE"> <input type="submit" name="SUBMIT" value="Upload"> </form> Then in the submit section, it accesses the filename and filesize by virtue of a default php ability to extract these attributes by using: $FILE_name and $FILE_size (where _name gives the name of $FILE and _size gives the size of $FILE). if($SUBMIT) echo " Filename: $FILE_name <br> Filesize: $FILE_size"; Also, I did add the necessary lines to handle the post variables, like so: $FILE = $_POST['FILE']; $SUBMIT = $_POST['SUBMIT']; I have tried to mimic this script in a new upload script, but am unable to access those same attributes (_name and _size). At the time of my original upload script, we were running it on a Linux server (but I don't remember what we were running for a php version). Currently, I am running PHP 4.2.3 on Mac OS 10.2.8 server. One thought I had was that maybe PHP 4.2.3 no longer supports _name and _size. Or, maybe I am not handling the retrieval of the POST var for the file correctly? I wonder this because I did try print_r($_POST) and I only got the submit returned as a post var.
Dropdown List - Trying To Get Default Populated From Db.
Nooby question but when I try and get this to work (it should identify which rows in the database have GK, MID, DEF, FWD against them and then put SELECTED into the option value to give a default of what the entry is currently) it just adds SELECTED to all the results as if $row["Position"] is returning true against all four conditions? What am I doing wrong? CODE:..
Default Function Argument Issue
function test($foo=array()) { echo gettype($foo); implode(' ',$foo); } foo(); This code will output: null and generate the error Bad arguments. in .... on line x ( bad implode args ) what's the deal? $foo should be an array!
Send Default Apache 404 Error From Php
How can I trigger the default Apache 404 error from PHP? I don't want to specify a custom handler, I want the default handler. The reason is that I am using mod_rewrite with Apache for my site. If certain a certain page is requested that is not published, then I want to send the apache default 404 error page. Currently, I am doing this to return a custom error. if($pageNotPublished) { header("HTTP/1.1 404 Not Found"); // How do I send the default apache 404 message // instead of the message below? print("<html><body>HTTP 404 - Not Found</body></html>"); exit(); } The default 404 error page has more details,
Default Home Page Under Xampp.
Is there a way to change default home page under Xampp, so that when I type http://localhost it would go to a home page other than page with popup asking for Xampp authorization.
How To Change PCRE Default Delimiters
I try to use alternative delimiters for a regular expression. When will it be supported? www@mike:/home/www > /usr/local/bin/php -a Interactive mode enabled <?php preg_match('m!A(d*)B!', 'A12345B', $X)); ?> X-Powered-By: PHP/4.2.3 Content-type: text/html <br /> <b>Parse error</b>: parse error in <b>-</b> on line <b>2</b><br /> http://perldoc.com/perl5.8.4/pod/perlrequick.html
How Can I Delete The Default Apache And Php On Linux?
I installed php4.0.2 and apache 1.3.12,but I use the function phpinfo() checked the version of the php,it always tells me it is 3.0.15,so I want to delete the default apache and php on linux,so I can install new php4 and apache and it can connect to the mysql.By the way how can I get rid of the php and apche which the in linux when I installed the linux.
Default Select Drop Down Menu?
I have a drop down menu populated via a script that pulls all categories from the category table. However, when a user clicks to view a specify category (i.e. Toys), I want the drop down menu to display toys as the default value. Code:
MYSQL: How To Set A User's Default Database?
Is it possible to set a user's default database for MySQL database? Instead of having an additional line of command, i.e: mysql> use database <database_name> Perhaps there are parameters I can set up a default database for a user when she log on to mysql.
Default Redirect To Webpage For Authentication?
I'm hunting for a script that would allow me to place a wide-open wireless access point in my client's business. Then, anyone connecting and then surfing a webpage would be redirected to a default webpage for their username/password. Once they log-in, they can surf as normal until they close their browser. Each new browser session would require a new cookie/login to surf the web. Has anyone seen a script that can do this? Or, should I be looking at some sort of proxy server product?
Setting An Image Field As A Default?
In my application I have 6 image fields. If a user uploads an image they must upload an image 1 which is the main image. So I dont want them to be able to jump to the 2nd or 3rd fields and upload their file there. I am just not sure how to go about defaulting them to upload image 1 first?
Default Selection Radio Button
I have a table where users input a date, time, and quantity for a reservation. On my page ... because I have a junk calendar and coding, every time you click a different month on the calendar or click the "book now" button without entering all the necessary data, the page refreshes and erases all the data. One significant problem is that the times display as radio buttons. Some tours have one time and some have multiple times. On the page, if there is only one time, then to make it easier for users to book tours, I inputted CHECKED into the html code. But unfortunately if the tour has multiple times, then CHECKED doesn't work for the first radio button, it defaults the last radio button because of the php loop. Code:
Mysql - DEFAULT '' Defined Yet NULL Inserted
My database was inserting NULL for empty strings so I changed the field definition with this query: ALTER TABLE `myTable` CHANGE `myUrl` `myUrl` VARCHAR( 255 ) NOT NULL DEFAULT '' No error was reported following the query and yet I still get NULLs on insertions.
|