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




Getting Data To Form


How to create when enter staff no, it will automatically generate out the name in the same form ?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Posting Form Data And Also Allow To Download Form Data
i have a client that whats to post form data to a database but he also wants users of the script to download it aswell how will i got about doing this i thought about it that i could make it save it into a txt file then echo the download link is there any ideas? because to post it to a txt file it would be posting 2 places is there a way to do this? Code:

Comparing Form Data To Mysql Data
Im interested in building a script that would take form data, a variable like an address, and compare it with a known address in a mysql table (called addresses), then if there is a match log the address information in a separate table called (addresslog), and return the visitor to a certain page. If there is no match between the address entered in the form and known addresses then the information is still logged into the addresslog database but the visitor will be sent to a different page.

I'm still new to this, and am working through the logic and the syntax, but I believe I'm close. It's still not working, I have all of the proper tables, maybe I'm way off with the coding so I thought I would seek out some expert advice. Here's the entire script with as much explanation as I could give. PHP Code:

Getting Data From Mysql To Put Into Form
i am trying to set up a page that will allow the user to select a name from a list. The details of this name(ie, last name,address, job etc) are then taken from a database and put into a form. If any changes are needed the user makes them then presses a submit to update the database.

I can get the information out of the database and into the form fields but i have one small problem...

In the address field i can only get the first part of the address...
ie

if the address is 123 Sample Street

only 123 gets put into the form field.

How do i get the rest of the address to appear?

i am sure it is quite simple but cant quite put my finger on the answer!

my code is:

Address: <input type="Text" name="address" value =<?php echo $myrow["address"] ?>><br>

where $myrow is the array holding the results from my database query.

Any help would be appreciated!

Post Data W/out Form
I want to post variables to a php script, but I do not want to use a form to do this... is there some sort of header I can use to redirect and post values to another page?

Cookies and sessions are not an option, URL line ('get') variables can't hold large enough a string...

How To Use GnUPG With Form Data
I am looking to encrypt form data that is submitted over an SSL and send that via email to my client. I understand some of the basic encryption processes, but could someone help me understand :

1. How to encrypt the data with GnUPG before it is emailed.
2. What does my client need to be able to decrypt the data?
3. My web host currently offers GnUPG so I can generate the keys - what do I do next?

I have done some searching here already but I could use some getting started help.

Reload Form Data
I am developing a web site using php. I have a form for login in page1, which has two input box and a submit button. When I click the submit button in page1, it runs page2. When I click BACK button(now in page1), and FORWARD button (supposed to be in page2). Both IE and Netscape give me a message like the following (note: the browser cache is not turned off either by php header() or by browser setting):
*********************************************
This document resulted from a POST operation and has expired from the cache. If you wish you can repost the form data to recreate the document by pressing the
reload button.
*********************************************

When I press the RELOAD button, page2 is load correctly. Now, how can let the browser automatically do the reload without showing me the above message?

Inserting Data Using A Form
I created a script to allow the user to select the number of images to enter. After that the script generates the entry fields dynamically. The final step is entering all images into one column in the db called images.
The problem is i got it to work using an advice from someone at devshed forums to use some additonal script. Please see below.

1) HTML File that allows you to enter the number of text boxes to create for each image you want.


<FORM METHOD="POST" ACTION="do_show.php">
<P><strong>Number of images:</strong><br>
<INPUT TYPE="text" NAME="num_imgs" SIZE=5></p>
<P><INPUT TYPE="submit" NAME="submit" VALUE="Go to Step 2"></p>
</FORM>

2) PHP file that shows the created text boxes for you to enter the names of these images:

Problem With Form Data.
I have a form that I need to be able to input html, such as < a href="blah">blah</ a> and store it in a database, but php automatically puts 's in front of quotations and apostrophys, is there anyway to prevent this from happening so when it is stored in the database it will be just as they typed it in the text field and not insert back slashes?


How To Save Form Data?
There is a button on one of my www pages which changes page content. It
adds some fields to the form, which is created by php script. After
changing the page is displayed once again. What I want to do is to save
form data so after changing and reloading the page field are filled.
That button is not Submit button. Can I do such thing?

Emailing Form Data
I have a form that writes to an MySQL database just fine but would
like to email people to give them a heads up that an entry was made
under their name (1 of 6 names on writing to the database). This
server exists on an intranet and would have no 'web' function other
than using possibly the existing email server.

Is all that I need to do to make this happen, to change php.ini as
follows:

[mail function]
; For Win32 only.
SMTP = mail.servername.com
smtp_port = 25

; For Win32 only.
;sendmail_from = whoever@servername.com

My input form is as follows:
<form action="process2.php" method="post">
From: <input type="text" name="from" size="20" maxlength="20" /><br />
To: <input type="text" name="to" size="30" maxlength="30" /><br />
Subject: <input type="text" name="subject" size="30" maxlength="30"
/><br />
Message:<textarea name="text" name="message" cols="50"
rows="10"></textarea><br />
<input type="submit" name="submit" value="Send" />
</form>

and passes data to process2.php as shown in form 1:
<?php
@extract($_POST);
$from = stripslashes($from);
$to = stripslashes($to);
$subject = stripslashes($subject);
$message = stripslashes($message);
mail('$to',$from,$subject,$message);
header("location:process.php");
?>

This worked through my testbed on my SMTP 'once' and only sort of,
once so I might be missing something. :-)

Parsing Form Data
Im using Reichard Heyes Form Processor with php3 for customers to attach multiple image files to email to me. This form uses a template to print the emailbut I cant get the email to print the original file name for example:

file1.......johns image.jpg
File2.....Marys image.jpg

Sounds easy and most likely is but Im stuffed if I can get it to print So far all I can get is the Temp file name.

Form Data Not Posting
I was reading the forums and have not found the answer and could use some help. I am a novice and am learning how to do this out of neccesity for my non-profit org. I have a database with incidents that we react to during emergencies. I want to be able to have the users call up the record via ID (that works), change the status and/or details and save update mysql. It is just not saving the data. PHP Code:

Processing Form Data
I've just built a form that enables users to pick a city from a pull down menu. On the processing page i want to assign the city picked to a variable. So lets say the name of the form is "city" and i want to assign the city picked to a variable.

$citychosen = ********

What do i use to get the chosen city there. I want to use the variable in the next part of the page which uses an SQL query to show info about the city chosen. So the SQL query would look like this Select * from table1 Where city=$citychosen .

Retrieving Form Data.
I have two scripts - common.php and edit.php. The working is that common.php contains a form that is used initially for registration and later used again so that registered users can edit their information. edit.php contains the connection to the db to update the form with the current users information. PHP Code:

Web Form Data To MySQL DB
I pulled this script off of an MySQL article from the MySQL website itself. I adjusted it to my needs and I could connect to the DB, it could find the proper table, but it doesn't enter the data into the database table. So I pulled the original script off in hand, created the DB and table it had listed and still the same problem... it can't connect. Here's the script: Code:

Redirect Form Data
I've had help creating a redirect script, and that has worked successfully for inserting information into MySQL and the redirecting the user to the desired page when they clicked on a common link. A problem that I encountered is my script does not pass variables from a form, and I'd like to find a way to include those variables and redirect with the POSTed variables. PHP Code:

Form Data Will Not Post
can anyone be so kind as to look at

http://www.mysolution.ws/HYPOCRITE.php

and let me know why it isn't passing the form data to

http://www.mysolution.ws/insertHYPOCRITES.php

for the most part, the scripts were created with
http://phpcodegenie.sourceforge.net/

How Do You Add Data To A Database Via A Form?
I have a mysql database and I'm using PHP to access it. Has anyone got a piece of code that will allow me to use an HTML form to add data to the database?

Retaining Form Data
I want users to be able to go back to an assessment form after viewing the results. Here is a bit of the code I am trying. When I go "Back" the radio button is always selected in the last field. What am I doing wrong? Code:

Form Data Validator
Can any one recommend a class for form data validation?
Seems something all of us need to do.

I am constructing a large on line app and my validation needs are going
to be quite wide in range.

Array Of Form Data
After submitting form data to a page called procform.php, I want to be
able to see a list or array of all the inputs that were submitted from
the form. I scoured the PHP books I own and did some google searches,
but found nothing in this regard. I know I can use $myformvar in
procform.php if I know the form had an input like this: <input
type=hidden name=myformvar value=190> But, surely, there must be a way
to get a list of all the variables assigned from the form in PHP, right?

Form Data Loss
I have recently started experiencing form data loss. Here is an
example:

====test_form1.php====

<form method="POST" action="test_form2.php">
<input name="textboxvalue" type="text" size="20">
<br>
<input type="submit" value="Submit">
</form>

======================

====test_form2.php====
<?
echo "textboxvalue: ".$textboxvalue;
?>
======================

(note: these are incomplete examples, I have left out the <html> tags
for example)

After putting in data into the textboxvalue textbox and pressing the
submit button, on the second page only "textboxvalue: " is displayed.
The weird thing is that when I restart my computer, this works fine,
but then stops working again. These pages are encrypted with 128 SSL
encryption (mod_SSL 2.8.15).

This problem has plagued an online app that I am developing and is a
company-wide problem that happens on computers in other offices too.

Here's my info:

SERVER
Apache 1.3.28
PHP 4.3.6
MySQL 3.23.39
mod_SSL 2.8.15
phpMyAdmin 2.50

CLIENT
Windows XP Pro
Internet Explorer 6.0.28

Formatting Form Data
I have a problem understanding how I can submit form data to a mysql database and preserve the formatting that the user wants. Essentially the problem is line breaks. When a user inserts data into a text area the text automatically jumps to the next line when the one line fills up with text.

Yet when the data is submitted to mysql it doesn't preserve the breaks. I've tried several solutions like the <pre> tag. Basically I want the break that the html textarea creates automatically when it reaches the end of the text area to generate a <br /> tag in my data submission.

Prefilling A Form With PHP Data
I'm trying to fill out a form with data pulled from a database. Look at the first entry for my form, the First Name. I have a PHP in the value section but it is not pulling down the data and inserting it. Not sure why. Code:

Data From A Form To A Template
I have a PHP script that gets data from a form and sends it to an email address. Got that working no problem. now I would like to take the data form the form and instead of just emailing it I need to put it into a template that I have created using html and tables and then emails this template to a specific email address.

Passing Form Data
I have a project that consists of a large quiz that displays multiple questions per page from a database and then saves those answers to another database table. The issue I'm having is with a form that consists of radio buttons and check boxes. The form is only submitting the last checked value for the check boxes rather than all checked values. I'm sure this is an easy fix but my mind is about to explode from a full day's work and a lot of time trying to figure this out, so I was wondering if someone could give me a hand. Code:

Persistent Form Data?
I've set up a form with captcha and if someone enters the wrong captcha info and returns to the form to fix it, the previously filled in data is wiped out. What do I need to add so that the information persists? Would it be a session or cookie or ?

Form Data Pass Through
I have a site that uses pay pal subscriptions. The only problem with their service is that it only allows me to pass two user inputted variables from that form to the paypal site. I'd like to pass a number of other variables describing the user and their subscription preferences.

The best way i can think of doing this would be to first run a php mailer to email me the additional data along with the user's identity, and then have that php mailer submit the info to the paypal cgi script.

Is this possible? i'm a complete php newbie, but i'm willing to earn. Hopefully someone can point me in the correct direction so that i can figure out how to modify my current php mailer to accomplish this.

PHP To Create PDF With Form Data?
Is it at all possible to create a PDF file using input that is entered from a form?  What I'm interested in doing is creating a detailed online application that the applicant fills out, then once submitted, a PDF is created of the application, where it is then sent to the hiring coordinator and the applicant has an opportunity to view/print their application via the same PDF. 

I know it sounds like a lot, but it's just a thought. Is this remotely workable? If so, where do I start? I'm creating such a form now, but i'm not sure the steps to take after this..

Grab Data From One Form To Another
I have a text box which I am using for inputting quantity and I have a unencrypted paypal buy now button. Here is the code for the 2 forms:

PAYPAL:
<input type="hidden" name="undefined_quantity" value="1">

No Of Tickets:
    <LABEL for="ticketno">How many tickets would you like: </LABEL><BR>
              <INPUT type="text" id="ticketno" size="25"><BR><BR>

Now what I want to do is when I press the paypal button I want to quantity of the quantity field added to the paypal quantity field. Im thinking of using a php script to grab the field data and paste it into the specified field.

Enctype='multipart/form-data'
If you are processing a form and you have a choice to upload a file or not you use to use something like this.

Sending Form Data Without Actually Clicking?
Is this possibe? Say you wanted to test that a form was working correctly, every so often you could with a cronjob run a script to process the form for you.

Embedding Form Data In A String
Forgive me for this beginner post. It is a simple question to a simple problem but I'm very new to PHP and programming.

I'm simply trying to pass some form data to a mail script.

Below is the mail script I'm using. The $message line is what I can't get to work. I'm picking up "$txtFName" through a form on this same page. Obviously, the single quote I show in this line doesn't work. The email I get back only shows the '', leaving it blank inside the single quotes, where the form data should be.


// send a CONSULTATION ALERT TO ME


echo "<html><body>";

$recipient = "jane@doe.com";
$subject = "Consultation Alert";
$message .= "A consultation has been requested by '$txtFName'

";
$extra = "From: URL
Reply-To: URL
";

mail ($recipient, $subject, $message, $extra);

What am I doing wrong?

How Can I Maniplute The Form Data Nicely?
In a HTML form, there is a 'textarea', user may fill in block of chars with newline character.

In the PHP script:

Sending Form POST Data To SSL
I've seen posts on here before about this, but I could never figure it out. I even downloaded the code that was posted and tried to pick it apart to get it to do just what I need, but never succeeded.

What what I understand it deals with using Sockets and sending the header information. Maybe that's where my lack of knowledge lies.

For a regular post it should be sent to port 80, and for SSL 443 right?

How do you go about forming the header of the data? I've never seen that kind of thing, and I'm guessing that's where I'm goofing up.

I'm trying to set up a test:

index.php posts data to test1.php and then displays the results.

$var1 = 'test'

then test1.php would do something very basic like drop it into a line of text.

"This is a <? echo"$_POST['var1']";?> of the gotspy broadcast system."

So I would assume if everything worked right, going to index.php should return: "This is a test of the gotspy broadcast system."??

Yes, no?

Retrieve Data Into Html Form
I want to retrieve fields from mysql table into html form to update those fields.

How To Post Form Data After Validation
I'm posting the contents of a html form (I have the html form on the same file as the php mail()) to itself in order to validate and then send an e-mail. However, I'd like it to post it to another php file after upon successful validation. Can someone tell me how to do this?

Just a bit of background - the reason why I'd like to do this is because I have multiple contact us forms on a site, and for efficiency purposes, I'd like to have a single form mail script so that I don't have to keep editing the php.

PHP4 Not Sending Form Data?
I'm running PHP4 and Apache on my local Win98 box and have created an e-mail form using PHP4 (taken from www.thickbook.com). When I enter in the subscriber's info on the form and click the submit button, I'm taken to the php page that gives me a "thank you <insert name>" type message. The subscriber's info is then sent via e-mail. When executed through http://localhost, everything works like a charm.

Now, my webhost just installed PHP4 (running on an NT server) and is new to it like me. I moved the form and php file to the live site for testing (http://www.wholisticfitness.com/show_form.html) and here's where we have a problem.

The form submits fine, but none of the subscriber's data is captured. Bottom line, I get an e-mail that has no subscriber data, other than the field names.

We think it has something to do with his php.ini (since it works fine locally), but can't figure out why.

Form Fields Not Carrying Data
I'm having a problem with the following form; Code:

Incrementing Array Of Data From A Form
I'm trying to take a set of data generated by a form (web) which will basically be a set of yes/no data. I need to take that information (it's a poll/survey we're conducting on customer satisfaction) and increment a stored text file with the results.

If I have 25 ppl hit the page, 20 say no, 5 say yes (to up to 30 questions), I need to see that in the text file: 30 questions with 2 columns of info and possibly a 3rd column for the few questions that ask "if not, please explain" -- OR if someone has a better way to generate the file.....??

Posting Form Data To Two Php Scripts At Once
How do i post the form data to different php files at once. I tried the
following code but it doesn't work. the data is sent only to the first
php file.

<form method="post" action="insert.php" action="mail.php">
Email<input type="text" name="email" value ="" size="20" />
<input type="submit" value="submit" />
</form>

Is there a solution?

Dot Turns Into Underscore In Form Data
I've seen some weird (to me) behaviour where PHP (I think PHP is the
culprit) turns dots into underscores in the names in my form data.
Below is a simple example (play.php):

<?php
print "<html><head><title>Test Page</title></head><body>
";
foreach($_GET as $key => $value) {
print $key . " => " . $value . "<p>
";
}
print '<form method=GET action="play.php">'
print '<input type=submit NAME="go.name" VALUE="go.value"><p>'
print "</form>
";
print "</body></html>
";
?>

When I click on the "go.value" button, the URL I get is:

http://localhost/play.php?go.name=go.value

But the returned page prints the following:

go_name => go.value

i.e. in the $_GET array, the key "go.name" has been turned into
"go_name".

(and POST does the same thing).

As far as I can see, the HTML spec clearly allows the NAME field to
contain the "." (dot) character. So why are my dots turning into
underscores? Is this a PHP "feature", or something else?

(I am running Apache on a RH9 Linux machine; with no non-default setup
variables for either Apache or PHP, as far as I am aware).

Selective Form Data Processing
I have *quite a bit* of form fields for a certain form that needs to be eMailed. The problem is that when completely filled out, there is quite a bit of information to be emailed. How would I go about telling the PHP to ignore any forms that are not filled out -- letting it process less code? If this helps, the coding for the page that does the actual processing is: Code:

Pass Form Data Through PHP Redirect
I have to pass 2 form variables through a PHP URL redirect an I can not get it to work.
The two values look like this:

input type="hidden" name="account" value="00000000"
input type="hidden" name="reqtype" value="secure"
They are submitted through the form POST method.

Here is my current redirect PHP code:

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.

Defaulting Data In Form Fields
in a lengthly form, is it possible to use PHP3 to automatically fill form fields with data that has already been entered into a previous place on the same form?...or from a previously filled out form?..likewise, is it possible to perform a math calculation on a number entered into a field and have the result automatically defaulted to another subsequent field?

Need Help Passing Form Data To A New Window.
I have a form that one can enter their nickname for a IRC Java Applet. They enter their nickname and when they submit it should pass the nickname onto the applet.

It will work if I use the normal form method="post" action="blah", but I need it in a new window, and it's not working out that way. PHP Code:

How To Create A Form Which Submits Data To Itself?
how can i create a form which is when submitted calls itself

i mean what to write in action property of form element

Saving Form Data Without Submit?
I could need some advise on a form / form processor I am working on. Normaly I store all form data through php into a class variable for later use. I do this by submitting the form. However I would like to ease the usage of my form and would want each form field to store its' information "onChange".

I did this before with "onChange=thisformSubmit()", but that's not acceptable in this case. Is there any other sensible method to save fields individually? maybe using Ajax? Maybe there's a good tutorial somewhere?


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