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




Capturing Results Of A Form Submission


Is it possible, in PHP, to capture the resulting HTML of a submitted
form returning from a server and incorporate that HTML into say a
table, or some predefined layout?

I am trying to incorporate the resulting HTML into a layout I have
created in order to keep the look & feel of my site consistent, but
the resulting page is a plain "cheesy" page.





View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Capturing/using Results Of Query
I would like to display/capture/use the URL's that are displayed on a web page after making a query to a forum.
What do I mean?

I am part of a forum that uses vBulletin.  One option is to display the forum topics that have had posts that day, i.e. active topics.

Essentially, when you click on the link:
http://www.somedomain.com/forum/search.php?do=getdaily

the resultant page has a list of the active topics, highlighted as links.

What i would like to do is capture/access that resultant page and use regular expressions to grab the URLs.  I can do the RegEx but I cannot seem to capture that resultant page.

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>

Capturing Input From A Form
I currently have a search form on my website. When you type something in, it redirects you to a page that displays the results. I would also like the users searches to get input into an access database at the same time.

How would I do this?

Capturing Form Input
I will try to be short and to the point.(good Luck) I have a form
written in HTML. I have a Mysql database. I am using a linux server
and I would like to use php to write the following code:

After the user inputs their name, address, email, phone, etc. in my
html form. They will hit the submit button. I need for the information
they entered to go into my database.

I have looked now for about 12 hours and haven't been able to find an
answer. I know I must be missing something since I've been to the w3
site, codewalkers, phpfreaks,php.net(?), and many more.

If there is an easier way of doing this I would love to hear it.

If somene could point me in the right direction I could stop banging
my head and pulling my hair.

Form Submission Fills Form Values With Garbage
I'm attempting to do some form processing on a server that has register_globals off, however, I've run into a confusing situation and need some help.

Basically, the form is a multi-part/form-data form as I have it upload a file in addition to submit a number of other fields, but the error I have occurs even when no upload is done.

When I submit the form, all my input field variables get filled with garbage. Here's the html before submission for one of the fields: Code:

Capturing Chinese/Korean Characters In A Form?
I am new to PHP and have been asked to create an HTMl form that captures data onto a text file. I have that working fine.

I now need to capture Chinese/Korean characters from this same form and onto a text file. How do I do this? Is it possible to have one form that can capture US Alphabet and Chinese/Korean characters?

Form Self Submission
I have a form which I am trying to have submit to itself, but change 1 var so that it changes what is printed. how can i do this so it works? Code:

Form Submission
I print out the following after I submit a button. How can i print the following two buttons in the previous form which I'm submitting.Of course, these two buttons should appear only after the form is submitted. Code:

Form Submission
I have an event calendar. Users submit thier events and then I also allow them to edit thier entries. When they edit an event, that recorded is stored in a different table. I then go in and view the record. When I submit it, it updates the main table.

Below is the code for viewing the edited info. On some records the submit button doesn't work? I click on it and nothing happens? Why would this happen? PHP Code:

Form Submission
I am working on a PHP based web-site which is running a text based war game. So, there are lots of forms users need to submit. One of the form players submits is to ‘attack’ other player (not physically though). For that, player needs to fill out a form (let say this form is on the script1) having two or three input text fields.

After filling out the form user clicks on submit button which then calls (let say script 2) .This script 2 then does all the logic, modifies the database according to who won the attack , calls back the script 1 with the result to be shown to the player. But what is happening right now is that players are abusing the game by clicking the submit buttons or hitting (enter/return) key multiple times(very very quickly), although they are allowed to attack as many times as they want but not before the last attack is done means until they got the result of last attack.

They are clicking submit buttons before the last submission updates the database. Is there any way once the player submits the form, they cannot submit it again until the script 1(containing the form) gets reloaded again with the result. Also each script is a PHP Script. I hope I explained my problem. I heard there is way u can do it with JScript but what if they disable their Jscript.

Form Submission
On my three development boxes I run Gentoo, BSD and Windows with practically the same PHP config along with Apache 2. A project I recently completed was just uploaded to a client's server running Apache 2 and PHP (5.2.1). I can no longer submit any data from forms: Code:

Form Submission
I need help with this form submission, i understand for submission is the easiest thing to do in php. But i just can't get this to work.

Basically i have a form in which is a question. I have given users choice of 4 answers to this question in a dropdown menu. I just want the form to recognise what answer the user has chosen and put it into a table called support and the column 'category' in it. Code:

Form Value Submission Problems
I'm having a little problem with my php in that when I
submit a value with more than one word from a form, (for example,
"Cineworld Renfrew Street"), only the first word seems to get
submitted, so that when processing it after submission, only
"Cineworld" is available. Is there a way I should be formatting form
values to prevent this?

How Do I Stop A Form Submission
I have the below code. It has a member number input box. Once a member number is entered, it validates the number against a member number in a table. If the member number is a valid number, it will submit the form, if it is not a valid number it redirects the user to a signup page. But it is not working, it is submitting always. Code:

Submission Form To Fax Machine, Is It Possible?
I got quite a question here, is it possible that from a submission form on a website the results get faxed throught the webiste directly to a fax machine? I would really appreciate any insight on this concept. And where to start.

The Woes Of A PHP Form Submission
Good evening to the skilled Ladies and Gentlemen of the PHP world. I
am fairly new to all of this but learning quickly. I have run in to a
need to remove blank lines from a form submission after its sent back
to the web server for processing by a PHP document.

I have a textarea that users can paste lines of text in to and submit
them for inclusion in to a database. Every aspect is working
perfectly, except one. No matter what I try, I cannot get rid of
simple blank lines from the form submission.

$theLines = $HTTP_POST_VARS['userSubmitted'];

This variable ($theLines) now contains the contents from the textarea.
I have tried using ...

$theLines = explode("
", $theLines);

and

$theLines = explode("
", $theLines);

But all of the blank lines are still there. If anyone has some
snippet that they would share, I would be very grateful.



Disabling Enter Key For Form Submission
Could anyone please help me with tips on how to disable a ENTER key, so that a form is submitted only when the designated button for submission is clicked.

Display Of " And ' From Form Submission
I have single and double quotes in the text field which is submitted on one page. When I display this on the next page I see ' and " in place of ' and " respectively.

Bug In IE5+ Involving Form Submission & Images With '?' In URL
I have been experiencing problems with images containing query strings in their URLs. When I land on a page containing these images having submitted a form they don't appear. I heard this is an IE bug. Is there a quickish workaround using PHP? I tried processing the form(s) with an intermediate script, then redirecting to the destination page but still no images.

PHP Form Submission Data Errors
One of my variables "link1" that is storing a bunch of urls is having random
lines being duplicated on form submission. I just recently swithed servers
from a PHP 4.3.3 to a 4.2.2 version. This error has only started appearing
on the new machine. The script worked fine on the old server and still does
on the test server. Any ideas? I think it might have to do with the ini
config. i am stumped. here is a link to my code.

Disallowing Multiple Submission Of A Form
i have a dynamic form that sends data to a mysql table. it sends data into the table according to variables that are passed in. e.g. form.php?book_title=abc

how do i block the user from sending information about the same "book_title" more than once?

Updating Text In Form Submission
I am using a text area form submission to add imformation to a html webpage, and I would like to be able to edit that text in the php form at a later date after submission.
Does anyone know how to get the origonal text back into the form text area for editting and resubmission?

Trouble With Mailing A Form Submission
I recently had to move all my php pages and MySQL db to a new server and may have overlooked a setting or two in the php.ini or somewhere else. This form worked up until the move. Here's the code:

Form Submission And Include Files
I have an index page that I want to put an e-mail newsletter signup form on. I have the form inside another page called "misc.php" that is included in the index page. So far so good. When someone submits the form, though, which page do I send the POST to? When I send it to index.php the misc.php page seems to not get the variables.

And of course if I send it to itself it works fine, but it takes me to another page, which I don't want. This is very strange.

Encrypt Form Variables During Submission?
I've been looking around the net for a solution (I'm pretty new to php) on how to encrypt a form variable before you submit it, is this possible?

To give you an idea, I have a "change your password" type form and when the user enters their new password and clicks submit the password is sent out in the open before it's encrypted (md5) and put into the database. I'd like to encrypt it BEFORE I send it though. I plan on using SSL but I'd also like to see if what I'm trying is even possible.

Coding A Form From Email Submission
I have a customer who wants his contact page customized to be a form with questions to be answered by the person trying to contact him. When they are done filling in the form it is suppose to be emailed to him. I can not get this form to work right. Code:

Prevent URL's In Form Submission
I need a way to prevent URL's from being inserted into form fields. I have not been able to discover how to do this. Our forms are being submitted with junk URL's in the form fields. I would like to either A) Kill the form processing if URL's are posted, or B) Provide a pop up message stating that URL submissions are not allowed.

Creating A Tag Cloud Submission Form
I have recently redesigned a clip dump script and I am trying to add the ability for people to submit tags for their items. Here is what I have done so far. Code:

Multiple Attachments In An Email Sent From Form Submission
Currently the user selects a document to download, fills in their details and hits submit. They get the file emailed to them, and I get an email telling me their details and which document they downloaded.

However, I'd like the user to be able to select multiple documents (using tick boxes maybe) to be emailed in one mail. There might be 5 documents up there eventually and they could download as many of them as they want.

Would anyone be able to take a nose at the code below and tell me how it might be adapted for multiple attachments? I was thinking maybe to loop the attachment section, but I don't know how to do it, or what variable to use to come out of the loop. Code:

A Mystery (how To Mimic Form Submission With Headers)
I have this simple html form with only one field and a
submit button which uses the POST method. It works
fine.

I have been trying to learn php headers and found that
one could do exactly the same thing using headers.
Using ieHTTPHeaders v 1.6 - agreat FREE utility - one
can see the headers being sent when the form is
submitted, and then the php script with headers is
written.

It has worked fine always but in this particular case
although the headers are sent correctly .. the form
field value for some reason is not accepted by the
server. I was wondering if there are variables
(predefined variables) that are required by the server
but not being included in the headers.

Has anyone come across a similar problem?
How could one mimic the browser 100% - including all
the browsers predefined / environment variables?

Form Submission (no Button) Using PHP+cURL+ Transfer Control To Other Site
I'm trying to send data using the POST method and also have control of the browser be turned over to the website that's receiving the POST data (note that this is NOT the same as sending the data via POST method and then redirecting to the website after). I need it to work exactly like hitting the submit button on an html form, and I need it to work from PHP. It needs to POST the data to the site and also let the other site have control at the same time.

I've tried a couple of methods using both cURL and an fsocket function, but it seems like in both cases that (1) the data gets sent to the other site first, (2) then my program gets a response back, (3) and then it redirects to the other site afterwards. The data gets sort of POSTed to the other site (I get a 200 response back, and I get info showing it was posted correctly), but since the other site does not get control, it seems to dump (not save) the posted data. Code:

PHP Form Submission <input Type="hidden"> Security Issues?
Someone has said to me that when using a form (method = post), that storing data in "hidden" tags

ie <input type="hidden" name="myField" value="something">
means that the user can set the value to whatever they like

So my questions are:

1.  How would they do this
2.  How can I stop it
3.  Do I have to abandon the hidden values and go with sessions?

Email Form Results
I have a form and I need the results emailed to me how would I be able to do this.

Form Results To Email
Im very new to PHP and so this might seem like childsplay to some people.

Ive got a form on a web page, with different fields.

When the user clicks on submit, I want the fields that they have filled in, to be emailed to me with the structure of the form.

The purpose of the form is so that the users of my site can submit written articles to my email.

Email Form Results?
how i to email php form results so i looked it up and i have got pretty far but i am stuck my code doesn't seem to work properly. Code:

Secure Form Results Sent Via Email
I have a client who does not want a cart but instead wants a form to send him an order with credit card information included. The form is PHP and at present just drops an email on the owners mail server that's insecure. In my limited experience https wouldn't give security here, and if not what whould?

Search Form And Results Page
I have a table called "lista" into my mysql database.This table has 5 text columns : "TRANSLATEDTITLE" "ORIGINALTITLE" "ACTORS" "DIRECTOR" "YEAR" , and 1 image column called "COVER".

I want to create a page with a form to search entries into this table (ex. with Title, Actors, Director, Year), and anotger php page with the search results shown inside, everyone with a link that opens a pop window (ex. 400X320). Code:

Output Results In Link Form
I have script that includes a query that should output a link. The link is actually an image. So from the table it will get "image.jpg" while i will be providing the full href for it so that i becomes a link. My question is how do i use PHP (or PHP with JS to open up the image according to the image's size. Thus i dont need to define a fixed size always. PHP Code:

Passing Form Results Problem
I have a form that validates itself when the user submits it. I have another page that formats the form results and sends an email. But I don't know how to pass the form results from one page to the other. Here's the form: PHP Code:

Form Results To Email Especially Checkboxes ?
Does anyone know of a simple script that will send the results of a form to email that works with checkboxes. I've seen a lot of scripts that'll send basic form inputs direct to email but none seemto work with checkboxes/radio buttons.

I have got a script I'm using that works but I have to edit all the script for each checkbox and unfortunately my forms have lots of checkboxes. At the moment I use this routine for checkboxes #lineup=one of the checkbox names

$MailBody .= "lineup: ";
$items = 2; //initiate possible # of items
for ($i = 1; $i <= $items; $i++)
$MailBody .= "$lineup[$i] ;
"; //put results in variable MailBody

but don't know if it could be included in some script to do all without a separate entry for each form field.

Search Form To Results To Details
I have created a Search form in html that is processed by a php script via the POST method. All this works pretty well and lists results from my DB. Now i want to be able to click on 1 particular result to bring up a details page. I would like to create this via php so I don't have to create heaps of pages but just a template that uploads data from the DB.

Is this possible, and if so, where do i go from here???

Checkboxes In A Form To Determine Whether To Display In Results
I am making an effort to put checkboxes in my form that will determine whether to display that column or not. This is my first time doing this with PHP and I am hoping you gurus can assist. I have gotten some extremely great assistance in the past, so I am looking forward to any recommendations.

currently my form is as follows:

Link To Form Results Page Dynamically
I have a dropdown box that pulls information from a database. What I want to achieve is that when a caller selects an option, the option determines that page that comes up.

I tried setting the form action to the name of the option, but this down not bring up anything; actually the resulting page is .php. I also tried moving the form action statement after ther selection, but that does not work either - the Submit button does not work. PHP Code:

Form / Results / Navigator's Back Button
I have a research form script, a result list script and an item page. Just
classic!

form page => result list page => item page

When I'm at the item page and I click on the Navigator's back button I have
the following message:

Avertissement : expiration du délai pour cette page

La page requise a été créée en utilisant les informations fournies dans un
formulaire. Cette page n'est plus disponible. Par sécurité, Internet
Explorer ne renvoie pas automatiquement les informations vous concernant.

Pour envoyer vos informations à nouveau et afficher cette page Web, cliquez
sur le bouton Actualiser .

The normal use in fact .

Is there any way to get to the list again?

Sending Form Results To An AOL Email Account.
I have the following:

$msgtxt = "$message";
$header = "To: ".$friend."";
$header .= "From: ".$you."";
$mailresult  = @mail("",$subject,$msgtxt,$header);

And AOL users do not receive the message. Does anyone know why?

Html Form Results To Excel Spreadsheet
This sounds like overkill, but is there any way I can take the results of an html form, and plug them into their respective cells on a excel spreadsheet?

Populating Form From Database, Then Passing Results To Next Page
I have a multiple select input in a form that's being populated by a row
from my database as such:
<input type="checkbox" name="subm[]" value="$row[ID]">

That part is working fine as I can check the displayed page using View
Source and see that the value is the correct row number from the
database. It is then being submitted on a form by $_POST method to
another page where I want to evaluate the checkboxes and display the
contents of the entire row that corresponds to each value="$row[ID]"
that have been checked. But I can't seem to get it to work. I'm having a
problem passing the selected value. Can someone point me in the right
direction?

$query = ("SELECT * FROM `table`");
$result = mysql_query($query);

print "<p>Data for Selections:";
print "<table border=2><tr><th>You chose:";

foreach ($_POST['subm'] as $value) {
print "<tr><td>";
print "$row[ID];
";
print mysql_field_name($result, 1) . ": " . $row[name]."<br>";
print mysql_field_name($result, 2) . ": " . $row[address]."<br>";
print mysql_field_name($result, 3) . ": " . $row[city]."<br>";
print "</td></tr>";
print "</table>
";
}

if (!isset($_POST['subm'])){
print "<p>No matching entry ";
}

mysql_close();

Curl: Posting Form Variables Results In Redirection
I'm using the curl functions in php to scrape the wan ip address from my
home router (the router is an SMC product). This is a two step process:
1. post the password value to the login.htm page
2. capture and parse the content from the status_main.htm page

On the SMC's login.htm page there is a form with the following elements:
<form name=tF method=post action=login.htm>
<input type=password name=pws>
<input type=hidden name=page value=login>
<submit value='LOGIN'>

Here are three test cases - only the first two work as expected. I need to
understand why I got that third response... posting the variables causes a
the SMC to give me a redirection to index.htm which does not exist?

COMMAND LINE TEST (returns login.htm and status_main.htm accurately):
curl -d page=login.htm -d pws=mypassword http://10.10.10.1/login.htm
curl http://10.10.10.1/status_main.htm | grep 'wan_ip'

PHP NO-POST TEST(returns login.htm accurately):
$ch = curl_init("http://10.10.10.1/login.htm");
$strIP = curl_exec($ch);
curl_close($ch);

PHP POST TEST (returns an unexpected result):
$ch = curl_init("http://10.10.10.1/login.htm");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "page=login&pws=mypassword");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$strIP = curl_exec($ch);
curl_close($ch);
print "<!-- $strIP -->";

<!-- <html><head><meta http-equiv=refresh content=&#390;
url=/index.htm'></head></html> -->

Sort Search Results - Query Made From Form Variables
I have created a search engine with multiple search fields, the results.php page shows the results.
My question is, how can I allow the user to sort the results (name, description, price etc), simply by clicking on the column title. This wouldn't be a problem if the SELECT query was constant - just add a $var at the end where ORDER BY should be, but how can I do this when the SELECT statement is made up of $_POST VARS? Surely if I reload the page with the sort command, it will have forgotten the $_POST vars that made up the query?
I have searched EVERYWHERE for help on this PHP Code:


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