473,471 Members | 4,625 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Form Sending

When you use a form to insert data into a MySQL database, how can you
set it up so that the fields are not sent via the address bar.

For example:

page1.php
___________
<form action="page2.php">
<input type="text" value="whatever">
<input type="submit" value="Send">
page2.php
___________
// Inserts variable $whatever into database.

The problem that I have is that I don't want the address bar to appear
as http://web/page2.php?whatever=cheese but as http://web/page2.php

Any ideas?

Many thanks in advance
Shaun Demellweek
Jul 17 '05 #1
3 3317
write this:
<form action="page2.php" method = "post">

Kolja

Jul 17 '05 #2
Shaun Demellweek wrote:
When you use a form to insert data into a MySQL database, how can you
set it up so that the fields are not sent via the address bar.

For example:

page1.php
___________
<form action="page2.php">
<input type="text" value="whatever">
<input type="submit" value="Send">
Change the first line here to read:

<form action="page2.php" method="POST">
page2.php
___________
// Inserts variable $whatever into database.


Then to get the variables here you can use
$whatever = $_POST["whatever"];

Or you can import all POST variables via import_request_variables
(http://www.php.net/manual/en/functio...-variables.php) or
$_REQUEST
(http://www.php.net/manual/en/reserve...ables.request).

I recommend the second option:
import_request_variables("P","p_");

This will import all variables from the form and name them $p_whatever.

--
- Michael J. Astrauskas

Jul 17 '05 #3

"Shaun Demellweek" <sh***@shaund.com> wrote in message
news:37**************************@posting.google.c om...
When you use a form to insert data into a MySQL database, how can you
set it up so that the fields are not sent via the address bar.

For example:

page1.php
___________
<form action="page2.php">
<input type="text" value="whatever">
<input type="submit" value="Send">
page2.php
___________
// Inserts variable $whatever into database.

The problem that I have is that I don't want the address bar to appear
as http://web/page2.php?whatever=cheese but as http://web/page2.php

Any ideas?

Many thanks in advance
Shaun Demellweek


There are different methods to process your form - specifically, POST and
GET and I think you are using GET (which will limit form data I think to
1024 characters)... I suggest you change to POST to resolve your problem in
addition, to allowing you to pass more content, either now, or the future...
You can do this by adding METHOD=POST inside your <FORM> tag.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Brian Keating EI9FXB | last post by:
Hello again, I've already placed a few posts on this topic. This time i've a simple application that exhibits my problem, I've placed sample solution 8k on my website should anyone be interested...
1
by: Prosper0 | last post by:
Hello, I have a problem sending special characters from a form to another page. The sending page is in ISO-8859-1 (meta tag), and the recieving page too. (Using post) The characters show OK in...
27
by: Scott | last post by:
I've been trying to come up with a way to ensure user input is coming from the form on my site, and not auto-submitted from elsewhere, and I don't want to use the "enter the code shown in the...
7
by: GeorgeAtkins | last post by:
I want to create a web-based form or page that consists of a series of formatted questions and answers. The form will resemble an existing paper form. When the form is filled in, I want the user to...
5
by: fergallydon | last post by:
I'm sending some data in a HTTP POST to an asp page. The data contains some + characters. When I try to access the data using Request.Form("data") I get the data but the + characters are replaced...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
7
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
0
by: sheel331 | last post by:
Hello, I am new to coding in vb.net and have run into an issue with some code that I am looking over. This is a webform that is filled out and once it is filled out, it takes the responses from...
1
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi...
0
Dormilich
by: Dormilich | last post by:
this is a follow-up thread to this one. http://bytes.com/topic/html-css/answers/863662-form-not-submitted-sometimes I figured out that the mail sending class triggers the described error....
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.