How Can I Pick All Checked Value In Action Page?
I have a dynamic category list, I have printed those list with check box in the form. I have to check those boxes and submit. How can I pick all checked value in action page? Right now only one value passing from several check boxes while several check boxes checked. Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Pick Up Page Name In PHP?
Is there a way, within a PHP script, to pick up the name of the web page that the script is being run on?
Proper Action For A Page From A Database That Doesn't Exist.
What is the proper action to take when a user accesses a page from a database that doesn't exist. For example: User accesses http://www.example.com/parts/pn12345.html which translates to http://www.example.com/parts/lookup.php?ID=12345 where part number 12345 is not in the database. I would think 404 would be the proper response, but I need to redirect to another page. I have a parts index that I want the user taken to without having to click on anything.
Stopping <a> From Loading New Page But Still Performing Onclick Action
I want to use hyperlinks to 'load' content by changing the display of div tags. the problem i have is that unless i specify a href the anchor does not change the mouse pointer on hover even if display is set to block. it only look changes when there is a href there. but if i have a href there then when i click it will load the page, which i dont want. how can i get the anchor to look like a proper link where the users pointer changes on hover (in firefox) but a page does not get refreshed onclick only the onclick function gets loaded.
Adding Additonal Values From Forms To The Top Of The Action Page
I have form on multiple pages with one text input and two hidden fields. When the user submits the form, they are taken to: /actionpage.php?input=x&hidden1=y&hidden2=z On the action page there is a third party JavaScript that I can not change that requires the two hidden fields. I am wondering if I can setup something at the top of the action page that establishes the two hidden fields, allowing me to take them off from all my pages while still allowing the third party script to work.
How To Use A Value From A Pick List?
I'd like to have a form that does the following: User picks a site from a dropdown list from a MySQL db (that works - code below, thanks to all those on the web who posted code for this). Once the value is selected, a second query is run using the site as the 'where' clause and the results are displayed back to the user. mysql, php, htlm noob. I think once I get this bit, I'll be able to move forward with more interesting and complex code. ps - if this message shows up 3 times, my apologies but I've been having trouble posting. <html> <body> <?php // connect to db $db = mysql_connect("localhost"); mysql_select_db("test",$db); // build query $sitequery = "SELECT site from sitedata order by site"; // generate result set $siteresult = mysql_query($sitequery); // use results echo "Select a site from the list below: <br><br><select name='site'>"; while($siterow = mysql_fetch_array($siteresult)) echo "<option value='".$siterow["site"]."'>".$siterow["site"]."</option>"; echo "</select></td>"; ?> </body> </html>
Symfony + Action To Another Action ?
In symfony , if i have two modules. module A has functino to get the details and corresponding template has a list of comments to show from filesystem. But comments i want to keep as a seperate module and this asks me to skip from one action to another. is it possible to skip from a action in module A to action in module B and then come back to same action in module A ? i think after a ->forward or redirect no code after it could be reached...
How To Pick The Closest Number
I've been wondering about this for a few days. I have an array containing 4 numbers: $listofnumbers = array(0,15,30,45); Then there's a variable that could contain any number between 0 and 59. $actualtime = date('i'); Using the above I want to find out which of the numbers in the array is numerically closest to the value of $actualtime. So if $actualtime = 34 then I want to return the number 30 if $actualtime = 11 then I want to return the number 15 etc. I'm sure there's a simple solution but can't figure it out.
Checkbox Problem, He Always Pick The Variable Of The Last One
I have currently 2 awards in the database, with this script i pick them out of the database and define if they are selected and if the user unselect it then pass a variable to the database. Now it works almost good except that the script always looks to the 2nd award(last one), if the 2nd one is unselected then it updates award 1 and award 2 as unselected, when i unselect the 1st award and select the 2nd award then he updates the database with both selected(1st one and 2nd one), so the problem is that he always listening to the 2nd(last) variable/award. Does someone have a solution for this problem because i cant figure it out, greatly appreciated. PHP Code:
Identifying User's Pick From Selection List
I have an application that uses PHP to access a MySQL table and extract rows which match the user's search entry. Data from the matching rows are loaded into an HTML selection list, and the user can scan the list and highlight a selected item. My question: In PHP, what is the syntax for identifying which row is highlighted? My goal is to pass the unique row ID of the selected item to a subsequent form where all the fields will be displayed for the user to edit. I already have the code that loads the selection list and the code that displays the fields. I just need to know how to determine the highlighted item. I have two PHP books, and both discuss loading the selection list, but there is no mention of what to do next.
For Each None Checked Checkbox
I need help with foreach none checked checkbox as value, can you even do that. I tryed the !isset(); function but i'm not sure it would work because the none checked box would not of run with the $_POST ( i think ) this is an example table of what i'm looking for help with: ({num}) = the value [] = the checkbox. (1)(2)(3)(4) [] [] [] [] the person checks the one(s) they wish to keep and the none checked ones get swaped for diffrant values. I'm not quite sure if it is possible, but i will ask anyway to see if anyone as a solution.
Unlink Files That Are Checked
Has anyone written a script where you can view files in a directory and then delete them? Next to each file name is a check box. If you check the check box and click a delete button, the file will be deleted from the directory it resides in. This script allows me to upload files to the upload folder on my webserver. I can also view all files in the upload folder. The only thing I can't do is put a check next to the file I want to delete and click the delete button to delete the file from the upload directory. Any ideas???? Thanks, Jamie <html> <head> <title>File Management</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <? //check for file upload if(isset($uploadedfile)) { $directory = "upload"; $path1= dirname($PATH_TRANSLATED)."/$directory/"; // assign our path in a form PHP for Windows understands $dest = $path1.$uploadedfile_name; set_time_limit(120); // Free the memory allocated Copy("$uploadedfile",$dest) ; // Destroy the file now we've copied it unlink($uploadedfile); } ?> <p><b><font size="6" color="#400080">Georgia Power - Plant Bowen File Upload and Download</font></b></p> <p>Click on the file you would like to download:</p> <? // Here I print out the list of files from the upload directory, with a check box next to // each file. I put a check in the checkbox if I want to delete a file. $file_array = array(); $dir = "upload"; $sPath= dirname($PATH_TRANSLATED)."/$dir/"; function GetDirArray($sPath) { global $file_array; $handle=opendir($sPath); while (false!==($file = readdir($handle))) { if ($file != "." && $file != "..") { print $file_array[]= $file; print "<INPUT TYPE=checkbox NAME="checkbox".$i."" value=checked>"; print "<br>"; } } closedir($handle); sort($file_array); } // This code is supposed to be deleting files that are checked........ if(isset($checkbox)) { unlink($file); } GetDirArray($sPath); ?> //This is the button and browse button to upload files to the upload folder. <p> </p> <FORM ENCTYPE="multipart/form-data" ACTION="<? $PHP_SELF ?>" METHOD="POST"> <p> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000"> Upload This File: <INPUT NAME="uploadedfile" TYPE="file"> <INPUT TYPE="submit" VALUE="Upload"> </p> </FORM> //Here is the delete button to delete files who's checkbox is checked. <FORM ENCTYPE="multipart/form-data" ACTION="<? $PHP_SELF ?>" METHOD="POST"> <input type="submit" name="delete" value="delete"> </FORM> </body> </html>
Only Allow X Number Of Items To Be Checked
I have a function that renders out tag categories, and then all the tags within said category. Each tag has a checbox beside it, i am wondering if it's possible to only allow a user to check 4 tags. Here is the function: Code:
Limit The Number Of Checked Checkboxes
I'm making an online form-to-mail form (using mail() function) with 10 checkboxes. There's nothing complicated about this page, but the viewers shoule only choose 3 checkboxes. Is there any way to limit the number of boxes checked? It would be even better if it returns the error message when a viewer selects more than 3 boxes. Is this possible with PHP?
If Else Statement T MAke Sure A Check Box Is Checked
<input type=checkbox name=sentence1 value=1> alright say i have some TOS rules on registration page how can i make it so u have to press the checkbox to register else returns a Message Saying CLick Back and blahblahblah.
Image Won't Upload - I've Checked Form A Dozen Times
which is supposed to upload an image. I expect the image name as a var to be $uploadedFile. In the receiving function, I've this code: global $uploadedFile, $uploadedFile_size, $uploadedFile_name; echo "here is the file name: $uploadedFile, $uploadedFile_size, $uploadedFile_name; <hr> "; $uploadedFile_name = $formatTextObject->processFileName($uploadedFile_name); $uploadedFile_name = htmlspecialchars($uploadedFile_name); The line where I echo things out is just for debugging. I get the first 5 words, but no vars, nothing, no globals of that name are in global space. Below is the form. What am I missing? [color=blue][color=green][color=darkred] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[/color][/color][/color] <form method="post" action="/mcControlPanel.php" enctype="multipart/form-data" class="mcForm"> <input id="inputId1" type="hidden" name="formInputs[formSecurityRating]" value="associate" class="hiddenInput"> <div class="formElement"> Upload an image: <input type="file" name="uploadedFile"><input type="hidden" name="uploadType" value="image"></div> <div class="formElement"> Type an easy to read name (as opposed to the file name) for this image: <div class="inputBoxTitle"><input id="inputId2" type="text" name="formInputs[cbHeadline]" value="" class="textInput"> </div></div> <div class="formElement"> Type a brief description:<br> <textarea id="inputId3" name="formInputs[cbMainContent]" class="textareaInput"></textarea> <p>HTML into symbols? <input type="checkbox" name="formInputs[usingHtml]" value="y" class="textareaCheckbox"></p> </div> <input type="hidden" name="formInputs[cbWhichType]" value="imageInfo"> <input type="hidden" name="choiceMade" value="standardImageUpload"> <input type="hidden" name="fileName" value=""> <input type="submit" value="Click here when done" class="submitInput"> </form></div>
Passing Info Of Checked Boxes(array Value) Using Next/previous Links
I have a webpage which generates product information from a database, with a checkbox next to each product. There are 20 products per page, and about 220 products right now. I have next and previous buttons on top which are generated dynamically using $PHP_SELF according to the # of products in the Database. I can check off products that I want delete on one page and then click on a submit button, which deletes those products of the main page. Now my main question is this.....my array of checkboxes is named to[], can I check off products on 1 page, then click on next, etc etc. till I check all the products off i want to send delete to, but remember the values of all the previous checkboxes?? In other words when I click on submit for my last product, will it remember all the names that I checked off? PHP Code:
Action= ???
I can't find the answer!! I want to select a page from a "select" list. Click Submit and go to that page. Below is my code. The "???" is what I can't figure out. <form action="???"> Select a month <select name="???" size="1"> <option selected value="">Select Area to Update</option> <option value="<a href=Updatevent.php">Update Events</a></option> <option value="<a href=UpdateCustomer.php">Update Customer</a></option> <option value="<a href=AddCustomer.php">Add Customer</a></option> </select></tr><tr> <INPUT TYPE="submit" NAME="Update" VALUE="Submit"> </form></TABLE>
Index.php?action=1 Etc
just wondering how i could make a php page which has say an output like index.php?action=1 all it has to do is goto another webpage - so if i had URL then the user is taken to another page and so on for index.php?action=2 / index.php?action=3 / etc
Variable Action
I want to call a different php script depending on if the user clicks the Chart button or the Play button. Is this possible?
LoadModule Vs. Action
a simple question regarding ways of loading php as a dll or an exe file in httpd? What is the difference of loading php as LoadModule php5_module "C:phpphp5apache2_2.dll" or Action application/x-httpd-php "/php/php-cgi.exe" or Action application/x-httpd-php "/php/php.exe". Either way, what is the most preferable way and why?
Two Action In A Form?
can i put two actions in a form so that when i click the "submit" button, the information will be sent to both the database and my email account?
Action And Header
I have used the action= statement to send the form to a new page which can get the posted variables. I have used the header("Location: foo.php) statement after testing on the submit with isset. What I want to know is if they can be combined. That is, test first with the isset, and if no errors go to the action call. Simply going with the header call doesn't seem to send the form variables.
Action Link
Does anyone have a solution for this problem: - I would like a PHP script to execute an action before a user clicks on a link (updating the value of a variable, for instance). Is there an easy way to do this?
If() Action Within Print()..?
I'm trying to do something like this: <?php foreach($apples as $key => $value){ print("<td class=<?php if ($myvar==$key){print (class1);} else {print (class2);} ?>>$value</td>"); } ?> Hopefully, you can see what I'm trying to do, I've left out all the ' " ' etc. Obviously the syntax isn't right at all, how exactly do I achieve putting an if() action with a print()? Is it even possible?
The Power Of ACTION
how much power does <form ACTION= > have? is it only for sending the form somewere? or can i use that to acess a server? like i have a table of variable items, i check the ones i want and click my submit button, can i use the action sub tag to access mysql database and input them in there?
Selected Box Action
how to set the respond to action when user choose an option inside a <select></select> box? eg. when user select an option in the <select> box then php search for data inside mysql and then display the required data on the <input type=text>.
Advanced E-mail Action.
I want to include a reference number from a table in an e-mail. Would I just query the database and have this code, PHP Code:
Knowing The Form Action
Is there a way to know if the page is: - directly called from the browser - called by the submit button pressed in POST mode - called by the submit button pressed in GET mode
Php Variable In The Form Action
i have this in my intro.php form. Code: <form action="intro2.php" method="post" target="main"> is there a way i can assign a variable to take the name of the script, and put a two on it....then i can put that variable in place of the intro2.php? I have a lot of these files, and when it comes time to replace all those intro2.php's, its gonna be a pain in the neck.
Select/option Action?
I am trying to figure out how to click an option in a select menu and have that option act as a hyperlink/form submit without a submit button. Here is an example of what I am trying to do: Code:
How Do I Run More Than 1 Action Script From A Form?
I need to execute an sql query, then a paypal script from the same form. How do edit the code below to do this? <?php <form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" target ="paypal"> </form> ?>
Action File Being Downloaded Instead Of Being Processed
My action file which is a php3 file is being downloaded instead of being processed. I have put in apache.conf file the undermentioned which I think should be ok, but still it does not happen. ScriptAlias /cgi-bin/ "C:/apache/Apache/cgi-bin/" ScriptAlias /php4/ "c:/php4/" ScriptAlias /php/ "c:/php4/" ScriptAlias /php3/ "c:/php4/" ScriptAlias /rakesh/ "c:/php4/"
Variable Passing On A Php_self Action
i need a database id to pass it along on a few ´php pages, but i know how to do that only if the action of the page is directed to that next page (with hidden fields). but now i got this php script that executes on the same page (form action is php_self)and in the execution line it has a header("Location: whateveer.php"); as a redirect after a condition has been met. how do i pass the variable on to that page?
File Upload Action To Iframe
I have tried uploading a file using the code as //-------------------------------------------------------- // Main File <form action="importaction.php" enctype="multipart/form-data" method="post" target="targetupload"> <input type="file" name="fileimpcsv" id="fileimpcsv"> <input type="submit" name="subfileimpcsv" id="subfileimpcsv" value="Import"> </form> <iframe id='targetupload' name='targetupload' scrolling="auto" frameborder="0" height="0" src='ifimportaction.php'></iframe> //-------------------------------------------------------- In the file ifimportaction.php, there is the code to get the POST, FILES vars and upload the file. And show the javascript alert after the file is uploaded. (Alert message at the end of the file ifimportaction.php) It's working perfectly for Firefox (tested in v2.0). But for IE (v6), it's not working. After I click the submit button, it's stay there only. If I remove all the code from the ifimportaction.php and only print time(), (after changing targetupload height to say 50), there is no change in the values being displayed i.e., action is not going to that frame. How can I upload the file in IE, so that page is not reloaded.
Submit Form With Variable For Action?
So, i've got a form that is very simple. It hold three elements: username, password, and domain. The goal here is to have the form submit the login to an administrative section depending on which domain someone has chosen. For instance, let's say we have three administrative sites, that all have different URLs, but we want this one form to handle logging into any of them. So, the form itself needs to have a dynamic action element. Here's an example: Code: <form action="http://www.mysite.com/admin/index.php" method="post" name="login" id="login" > <input name="usrname" type="text"> <input name="pass" type="password"> <input name="domain" type="text"> <input name="submit" type="submit" value="Login"> </form>
Performing An Action Upon GET Autochange Dropdown
Ive got the following drop down menu and I want to perform an action every time someone uses the dropdown. How Can I determine when it has been used? Normally I would pass in a mode but because its GET, I cant and if i change it to POST, it doesnt work how I want it to? Code:
Getting Data From Address Bar Into Form Action.
Here is the problem...i have a game where a users id and encrypted password are stored in the address bar on every page of the game. e.g. main.php?P=bank&uid=15&password=faspmi9r329m2d324sd now i have a problem when trying to link to a page through a form while still keeping these variables in the link to be more specific i have a form for a user to deposit gold into their bank upon entering a value in the input box and clicking either deposit or withdraw the form is to reload the same page where the proper if(isset($_POST command will take over and do the correct job. The only problem is if i use a $_SERVER['PHP_SELF'] as the action for the form when it reads back on its self again it doesnt include the uid or password...it simply is reloading main.php ...my question is.... how do i get these variables sent back through the form button so the page will reload with the users information still there?
PHP And Frame Updates From Form Submit Action
I have created a page with two frames on it. The main frame contains a simple form that collects a username and password. The form code is as shown below :- <form method = "post" action = "getname.php"> Login Name : <input type="text" name="login_name" size=12><br><br> Password : <input type="text" name="passw" size=14> <input type = "submit" name="submit" value = "Login" > </form> The php function getname assignes the value of "login_name" to a usable variable for later use. Here's the problem, After the form's submit button is pressed I want update the contents of the second frame automatically, I also want it to contain the value for the login name entered on the form. Is there a way of automatically updating the second form so that I can fill it with dynamic contect?
Form Action To Same File Opens New Window
Two questions late at night and going stir crazy. Anybody who takes pity on me will have my undying gratitude and a virtual bottle of beer. I've tried to look them both up on the php.net, and elsewhere, but without success. 1. Am writing a php program which checks entries in a form on a previous page. It then asks for any empty fields to be filled, and submits the resulting form back to itself to check it again. In other words the file "checkblank.php" includes this line within the php: echo "<form target="checkblank.php" method="post">"; When the form is submitted it opens in a new window (in FireFox). In Firefox it is not a disaster as the variables and arrays are not lost, and the program works, but popups are not something I like. In IE the whole thing collapses in a heap as the variables appear not to be passed to the new window. Needless to say, the vast majority of users will have IE. Is there a reason I'm unaware of, and can it be stopped easily? 2. Can anybody suggest a quick and easy way to strip arrays? stip_tags is fine with variables, but converts arrays to variables. I'd like to use it for the sake of security though. I don't particularly want to translate the array into a whole lot of variables, as it's a big array.
Passing Credentials In A Form And Perform Action
All, I want to create a script that performs the following: 1. Access a page and submits authentication credentials (www.example.com/login.html) 2. Once authenticated, grab values of a form (www.example.com/logs.html) I just need to be stepped through the thought process. Unfortunately, I can't use cURL because the main page doesn't request for authentication. Instead, it's an authentication form/page. Or perhaps I can still use cURL, but not use its auth mechanism of CURLOPT_USERPWD. Here's the form parameters that must be submitted: <label>Username:</label> <input type="text" size="14" name="username" value="User" /> <label>Password:</label> <input type="password" size="14" name="password" value="" /> <input type="submit" value="Login" />
Remove Record Id From Static Name In Form Action Script
I am creating a page that has multiple dynamic forms, two of my form elements are using a static name and the record id (this is needed for another reason.) I need to remove the record id, so my post in my update script will be: $date_start=$_POST['start']; $date_finish=$_POST['finish']; <input type="text" name="start<?php echo $task_number; ?>" value="<? echo $date_start; ?>"> and <input type="text" name="finish<?php echo $task_number; ?>" value="<? echo date_finish; ?>"> In the update script I can access the input value by using the variable ${'start'.$task_number} Is there a way to remove $task_number from it so it posts as 'start' and 'finish'? Do I somehow need to provide the form action script a list of task_numbers via an array serialized and urlencoded via a hidden field to decode and unserialize? If so, does anyone know how? If not, does anyone know how I can do this?
Bizarre Phantom Bug (Calling A PHP Script From An Apache "Action" Directive)
I am using an "Action" directive in my Apache configuration to map a certain file type (by means of AddType and AddHandler) to a PHP script. I wasn't sure if this would work, since the Apache docs say the Action directive is for mapping a handler name to a CGI script in particular. But it seemed to work at first. Then a mysterious bug arose: Sometimes it works perfectly, and other times the output is a totally blank page. It seems that if I haven't viewed a page for a while, it chooses to do one of these at random (though it is blank more often than not), and then it persists in the same behaviour until I reload it many times. (That is, usually a page appearing blank will eventually display if I reload it many times; however, only rarely will a correctly-displayed page regress to appearing blank after reloads.) Checking with `curl -i', it would appear to a client program that the request was perfectly successful: all the headers are there (with the correct content-type), it has an HTTP/1.1 200 OK line, and so on (and there's nothing unusual in the server's access or error logs), except Content-length is 0, and there is indeed no content at all after the two newlines. WTF?? Since when do computers behave non-deterministically? I should hope, if a program is not going to behave correctly, that it at least do so predictably and consistently. That would make debugging it much easier. But what am I to make of this Schrodinger's Bug? How do I even approach the debugging process? (Also, if anyone could suggest a workaround, an alternate method of having a PHP script handle files with a certain extension, then that would be just as welcome. Though I'd like to stay within mod_php, avoiding a CGI-based technique, because I'd prefer to not start a process every time these pages are requested.)
Form Processing: Change The "action=" Based On Pull Down Menu
I have an html form for that uses username and password to login to a specific area of the website. The "area" the user wants to go to is based on a pull down menu. Becasue the user/password info is in differnet databases, how can I call different validation scripts based on this input ? See below please. Somethinglike this: form.html: <form name="loginform" method="post" action="login.php"> <select name="loginform"> <option value="one">Section 1</option> <option value="two">Section 2</option> </select> login.php: @extract($_POST); if($_POST[loginform] == "one") { echo "action = /forums/scc/dispatch.cgi/_admin/AVFLogin" NAME="LoginForm" > echo "<input type=hidden name="autologin" value="1"> "; echo "<input type=hidden name="formstyle" value="standard"> "; echo "<input type=hidden name="returnforum" value="_admin"> "; echo "<input type=hidden name="returnmsg" value="acahomepage"> "; } else { echo "action = /path to different cgi "; echo :different values for hidden fields". }
|