How To Check If The Form Is Posted From My Server Not Other Place?
I have a form index.php, it posts the data to action.php How can I add a check to action.php to make sure that the index.php data comes from my server?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Check That Form Is Posted ?
i have a form on a php script - the php script is signup.php, i want to check that when it is submitted when user press the submit button, it will check whether the fields are empty or filled. how do i check that the user is clicking on the submit button and not going to the signup.php as a link ? because currently, when anyone click on signup.php, it immediately showed the errors (as if the user forgot to fill up the fields - when actually he is just going there from another link ). <? if(!$name&&!$email&&!$address&&!$phone) { // all not filled up echo "Error. You must fill up your name..... ";}?>
Identify Server That Posted Data.
I am looking into the security aspects of a site, and would like to know if there is any way to identify the source of the data that is posted to the php page responsible for processing the data. in other words I only wantt he php code to process the data if the data was posted from a form hosted on my server.
Name Of The Form That Was POSTed?
Is it possible to determine the name of the form that caused a page to be submitted? I have seen numerous examples of how to determine the method of the POST and how to retrieve data elements from the post, but I haven't seen any way to know the name of the form that caused the post. The page that is POSTing to my script has two forms and I'd like to know if I can determine which one of them was submitted without having to add a hidden element to the forms.
Using Referal URL, Getting Posted Data, Passing Posted To Include *HELP*
OK.. here is my problem.. I am using PHP as a frontend for executing (actually including) a vb CGI .exe file the include just does the following right now: <?php include("http://localhost/test/make.exe?f=$_GET[f]&f2=$_GET[f2]&step=$_GET[step]"); ?> What I need to do is I have a form that needs to have a "Back" button/link and a "Next" button/link .. If they click on "Back" I want it to pass the "Back" as the say... $GET[do] ... needs to equals "Back" if they click back. If they click "Next" it needs to equals "Next" .. I thought I may be able to detect what URL it is posting from because it is being posted like this: URL This would be fine except I need it to retrieve all the data from the form and I do not know if the PHP would get the data from the entire form if you passed it like this it seems like it would only get the posted info in the link.. Is there a way to make the Links as Buttons or keep them as links and then have the links/buttons submit with the different "Back" or "Next" values? Pls post code on how to do this and I would greatly appreciate it.. This is giving me a headache trying to figure it out! Thanks a lot!
Best Way To Encrypt A Form Posted URL String?
Could someone post some examples with explanations of how to encode/encrypt a form posted URL and then decrypt it, so that it is very hard or currently impossible to break? so, something like http://localhost/page.php?product=12&price=4.50 would appear obfuscated in my browser display area like: http://localhost/page.php?Ur7@7892yRyw&wq84y@$y8@$ (or whatever)
Losing Posted Form Fields Over Https
This has been driving me nuts. I have an application running for several clients. Some run on http and two run on https. Two weeks ago, the https customers started occassionally getting kicked out to the home page. This is not every time, it's generally 1 in 10 form posts. Refreshing the page asks you to repost the info and it posts as it should have in the first place. Dumping the $_SERVER variable shows me that if things go well I get the $_POST and $_GET variables and the $_SERVER["CONTENT_LENGTH"] is a number. When the error shows up, CONTENT_LENGTH=0 and there are no $_POST or $_GET variables. I can only reproduce this over https on Linux/Apache/PHP using Internet Explorer. I cannot reproduce it using Mozilla or Opera as a browser. And I also can't reproduce it using IE over https with Windows/IIS/PHP. None of the PHP code changed and there were no new installations on the server I can point to as a possible cause. We were running PHP v4.1.1 and upgraded to v4.3.4. I have been able to trap the condition to offer our users a page to inform them to refresh so they won't lose their data. Any suggestions, ideas, places to look or ask more questions, is much appreciated. $_SERVER[SERVER_SOFTWARE] => Apache/1.3.20 Sun Cobalt (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6b PHP/4.3.4 mod_auth_pam_external/0.1 FrontPage/4.0.4.3 mod_perl/1.25
Having A Form Submit To A Different Place Depending On A Variable..
I am trying to have a form submit to another source depending on a certain variable. Only problem is that the variable is not defined untill after you submit the form. Basically if a certain text field in the form is left blank i want it to be posting to a different place.
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>
Check For Server Response
I have a few websites and i am working on a little php script that will notify me by email if one of the websites is down. Now i'm not so familiar with this aspect of php so can someone please give me a few pointers in the right direction?
How Can I Check If A Server Is Up And Running?
Is there any way to check if a server is running and then refresh to it? maybe something like this: <?php $url = "http://www.mysite.com"; if(server_status($url) == true){ header('location : $url'); } else{ echo "Server down -- TRY AGAIN LATER"; } ?> I was looking at php.net and i found Memcache::getStats(), but i don't know what that does...
Server Status Check
I was woundering if there was a way to out print the status of a site. Ex: "Google.com = Online" Then if the server goes off, "Google.com = offline". I would also like to know if you use php to make an aggrement, like a window that comes up the first time you go to a new site, and you have to accept the terms, to view the site, but the next time you go to the site, the terms dosn't pop up again, because you allready accepted.
Proxy Server Check
Is it possible to check if someone is connecting to a website from a proxy server?
Check Number Off Emails On Server?
in my admin, I want to make an overview of details about my CMS. On of the details is the number of new emails on my server. Can I do this with PHP?
Check If The Page Exists On A Server
i have a set of links and that will be scrolled monthly, and i want to check if any of the links are broken and want to mail the broken links to the admin. now how do i check if the links are broken ?
Check Server Time Before Playing Next Music Track
I am making a media player, and running a webserver /php mysql database to arrange music and the playlists. However i need the music player webpage - likely using media player embeded or similiar, to break off from each track and allow my system tell it which one to play each time. I will manage this with cusomt made m3u playlists using php and mysql of track data. The php will load the media player the m3u text file depending on the time critera each one is set to. However if say after 10 songs the time is gone 6pm, and at 6 pm a new playlist is to be loaded , i need the music player to check this after everytime and not just play the m3u file through to the end so to speak? Allowing my php code to recall the mysql database for a new playist and track details at 6 oclock. Get me? any ideas how i can do this? will i force page refreshes? but this will hamper the media player i suspect?
PHP To Check Unread Emails On A Server Email Account?
I was wondering, is rhere a way, in PHP, to log in to an email account and count the unread emails? It's for a "backlog" section of my site, I was hoping to have a section where it would say "Unread emails: $count" or something.
How Do I Check If A Form Is Being Submitted?
I have a PHP code that checks if a form button has been clicked: if (isset($save)){... <input type="submit" name="save" value="Check the results..."> Upon clicking the button a PHP code runs that saves stuff to a MySQL db. The thing I'm doing is that I'm submitting the form with this code in a java script: aForm.submit(); This javascript is triggered by other user input and I do Not want to force the user to press any additional buttons to submit the form. How can I make the PHP code run when submitting a form instead of a button? = I want to submit the form but After I've run my PHP code and saved my data to the db.
Check If Form Is Submitted
I am using PHP to generate a form that submits to $PHP_SELF. The first time the script executes is should only create a data entry form based upon a MySQL "DESCRIBE table" statement. When submitted, the script will insert the form's data into a table using an INSERT INTO statement. I need a way to determine if the script should DESCRIBE and generate the form or instead INSERT the submitted data into a table. In the past I used a hidden field with name=submitted value=true and checked for that to determine if script should DESCRIBE or INSERT. However in this case I want to simply get the name/values from the HTTP header and INSERT them into the table. Form element names correspond to the desired table field names. Having the hidden field requires me to filter out the unwanted data. (I guess I need to submit the table name inorder to know which table to insert into, so there is atleast one required hidden field that is not part of the actual data to insert.)
Form Security Check
Is it possible to generate a Security Check using php or do it have to be purchased/free software?
Check For Empty Form Fields
I am just starting with php (like 2 days now) and was wondering what was the best way to check for empty form fields. The code I am currently using is below but I was wondering if there was a better way to do it. Also I would like to know if my code structure/layout is ok as it is important to me to get off on the right foot. PHP Code:
How To Check Form Input If It Has Evil Caracters In It
I have a script that accept input from a form. What should I check (and how)? I though first I shoul check with the W to find all variables with carcters other than letters and numbers. But I need to accept other caracters (caracters with accent marks) too! Please help and send me some actual code I can paste!
PHP Form Verses HTML Code Check
Hi I am a newb to this forum. I am working on a form for a site and the page that needed to be updated is in php. I am more fluent in html. Please see the following code and let me know if you can decifer where the discrepancy is. I was trying to update existing form fields and the label of the field is not appearing for the: address, city, state, and zip code. Also there are parenthesis after those form fields that are not needed. I can see them in the html but not in the php so they can be removed. Please advise and thanks in advance. <?php session_start(); require "../config.php"; ?> <?php include('login_functions.php');?> <trimmed out excess code> <tr> <td width="25%" >*<?php echo $label["advertiser_signup_last_name"];?>: </td> <td width="86%"><input name="lastname" value="<?php echo stripslashes($LastName);?>" type="text" id="lastname"></td> </tr> <tr> <td width="25%" valign="top"><?php echo $label["advertiser_signup_address"];?>: </td> <td width="86%"><input name="address" value="<?php echo stripslashes($Address);?>" size="30" type="text" id="address"/><span > (<?php echo $label["advertiser_signup_address"];?>)</span></td> </tr>
How To Check If A Character Appears In A Form Variable?
Can anyone tell me how you can perform validation on a string variable in PHP so that you can check if a specific character is contained within the string. The reason for this is i am trying to create a form for a site i am making and i want to validate the user's input for the email address field, by ensuring it contains the '@' character.
Login Form - Password Check Not Working
I have a Login Script, and it has been working fine, except I just realised its been missing one thing, a password check !!! (don't ask me how I missed that ). I'm trying to put the password check in, but its just not working for me, even though the password put in is correct, here's my script:
Check Form For Required Details Before Mysql Insert
I'm making a script that will let the users of my site enter information into a form and then submit it to a database. I've created the database and set up an sql user account that's only allowed to insert to a specific table so that's all ok. The thing i'm having trouble with, is checking the required forms have been filled in. I don't need to do any reqular expression matches on any of the inputs, i just need to let the user know when they've missed out a required field and to stop the script if they haven't. I know this could have tons of different methods, i'm after something basic that will give me an idea how to do it as a beginner. Are there any turtorials or guides on the net that will give me the information i need? Oh, i'm aware the sql part of the code isn't complete. Please remember i'm somewhat of a php noob so go easy. Code:
Notify Once Posted
While I'm writing a reply to a message, someone else writes one and posts it, now for my site I'll be making a message board. Is there anyway to tell the user that someone has posted a response while they're on the compose screen?
Escape All Posted Variables?
this works well enough when all the elements in $HTTP_POST_VARS are scalars, but it doesn't work so hot if one or more of them is an array: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> while(list($key,$val)=each($HTTP_POST_VARS)){$$key=htmlspecialchars($val);} [/code] So what I need is an easy way to tell if "$val" is an Array so that I can do something similar to each of its elements in turn.
Previous Page/Posted From
I wanna know if there's a way to find out what page/file a form was posted from. Or wich was the prevoius page/file that was linked to the currant page.
Faking Posted Variables
I have played with this some unsuccessfully and can't find any references to it on-line. What I have is a forms-based application where I POST the form. This was decided on because of security and the length limits of a URL. Now I have a need where I would like to link to a form and "fake" some of the variables that are normally posted. For example, I have a form that normally comes up where the user selects information from a combobox and on reload, the fields are then automatically filled in. I would like to be able to go to that form from other locations and fake the POST variable of the combobox so that the form will fill in when they first access it.
Editing Posted Bulletins
I have a section on my church website that pulls announcements stored in mySQL and displays them with PHP. I recently started working on a control panel so that other people could login and edit/create the announcements so as to keep it up to date and lighten my load. I use a while statement to display all of the bits of news but my question is how can I make an edit button specific to each row in the table on mysql? All I need to really be able to do is have an edit button spit out for each post that will set a session variable to that particular posts index number. I created the mysql table with this in mind and have index numbers to reference the chunks of data.
Retaining Previous Posted Values
I have a form that if submitted correctly posts back to itself with a message that says the record was entered correctly. what I would like to do is retain the last values entered in some of the fields so that they don't have to retype everything if they want to add addtional records (it's a list of species and many times phylum, class, order do not change.) i thought I could do it with session variables but it doesn't work.
PHP/ List Authors That Have Posted More Than X Comments
I'm currently trying to implement sort of a "remember me"-addon to a newsposting script I'm using (cutenews, cutephp.com). What I need is to produce an array that contains comment-authors that have posted a set number of comments to my site. If I set this numer to 5, I want all commenter-names that have posted 5+ comments to be in the array this script is to produce. The format of the comments database is this: <unique id>¦<comment-authorname>¦<url>¦<ip>¦<comment-text>¦¦ (where ¦¦ means new comment follows - no seperate line for each comment.) Can anyone give me pointers to where I should start? This problem is really bugging me. 1, I need to search a huge text-file with hundreds of these unique comments, then I need to print a list of the authornames that have posted more than the set minimum number of comments to get listed. I'm going to use this list for a form field where people can select their name...
Outputting POSTed Data On Error
Got a form, user enters information, presses submit, then info added to my database. however, it checks to see if fields are empty when the button is pressed, if they are empty ive got it to bring up an error to say for example name, postcode empty. but the form comes back with blank fields i want it so if fields are empty form comes back with the fields that have already been filled in.
Reading Data Posted With XMLHttprequest
I'm trying to post a form (using POST not GET) using the xmlHttpRequest object. I cannot work out how to get PHP (4.1.2) to read the data which I'm submitting. Everything works fine if I use GET I can just read it from $_GET. If I use POST nothing appears in $_POST. To try to use the POST method I'm encoding the fields into a URL encoded string and sending it as the parameter to the request.send() function from Javascript. /Something/ is going out because I can see it in the LiveHHTPHeaders extension to Firefox. Presumably it's being received by the server. But how on earth do I get at it!?
Make Forms Keep Data After Being Posted
I'm trying to set up a simple preview-type thing for my very first blog script (im new to php and mysql). First off, heres my code for the update (place to post a new article) page (excluding the includes to connect to the database): Code:
Removing Oldest Table Row When New One Is Posted
im trying to figure out how to make it so that a user can pick how many rows they want to keep stored in a database table before an old one is automatically deleted im guessing the query would be made, then a while loop would determine how many......ahhh i dont know there has to be a simpler way of doing it..
Reading Data Posted With XMLHttprequest
To use the $_POST global without enabling the raw data in php.ini, try the following code: objXMLHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); objXMLHttpRequest.send('var=value&var2=value2');
Where Do I Place This?
i have a script which allows users to edit their information. I can make the form edit and update the data, but when the user returns to the form to update the information, it retunrs to the first value. I am not sure where to place this tag <?=$a13?> PHP code:
Converting The Posted String To The Value Of Html Element
I've been very confused in dealing with posted strings. For example, if I fill in a text element with "(double quote), submit it and display it in a text and a textarea, I get "(backslash followed by double quote) in the textarea element but (backslash only) in the text element. Code: <input name="somename" value="<?php if(isset($HTTP_POST_VARS['submitName'])) echo $HTTP_POST_VARS['somename']; ?>" /> I made a function which correct the misbehavings:
Where Does Php Place Cookies?
This is baffling me. I am starting a session and I know it is setting a cookie on my computer - I called getallheaders() and see that it is setting the cookie, and it is also accessible in $_COOKIE. I cleared all cookies in my Cookies folder before starting the session, and everytime I run the script it does not create a cookie in the folder. For testing I even set the browser to accept all cookies to make sure. session.use_cookies is on in php.ini, session.use_only_cookies is off, and session.use_trans_sid is off. The session data file is definitely being created, but I cannot find the corresponding cookie no matter what I try.
Best Place To Transform XSL
Hi, I have a question that a friend was asking me a few minutes ago. Is it better to transform XSL on the client side, or let the server handle it? Or both, ensuring that everyone can view the site correctly.
Backslashes All Other The Place
this is the text i type into the database: this is some 'example text' and is a "test" and this is what is displayed when its in the database: this is some 'example text' and is a "test" is there anyway to stop that? or hide the backslahes?
Place And Image Onto Another
Using the GD functions how can one image be placed ontop of another.. I want to add a border around each uploaded image using another background image as the border...like place the smaller image in the middle of the larger image
Place A Tab In Between Data
I have a number of lines of code which display information to the screen. <code> $msg .= "Name : $name "; $msg .= "Address : $address "; </code> I want to be able to put tabs in between the "Name" and "$name" so I can align all the data in a column to look easier on the eye. How do I do this? I think it's something like "/t" but i'm not sure.
Place The Results In Another Table
I am trying to take the results from a query and place the results in another table. I want to take all the results from $row join them together. is this possible to do? And can the results be stored with the information from the print statement? (<br> from each row) Code:
1 Decimal Place Without Rounding
If I have a float number of say 3.478399 How can I reduce the number to 1 decimal place without rounding? I've tried it will sprintf, but it rounds the 4 to a 5 which I want to avoid. $float_number = 3.478399; $new_float_number = sprintf ("%0.1f",$float_number); Output returns 3.5 when really I need it to be 3.4
|