473,602 Members | 2,767 Online
Bytes | Software Development & Data Engineering Community
+ 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.p hp">
<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 3327
write this:
<form action="page2.p hp" 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.p hp">
<input type="text" value="whatever ">
<input type="submit" value="Send">
Change the first line here to read:

<form action="page2.p hp" 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.c om> wrote in message
news:37******** *************** ***@posting.goo gle.com...
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.p hp">
<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
7390
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 in having a look. http://briankeating.net/transfer/test.zip To recap the problem I expected (and found). I've a main GUI thead (main form), this GUI thread has an UpdateTextBox function that appends a string in a textbox and It also has a button...
1
4442
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 the sending page (in textboxes), characters are eg: å (a with a ring, &Aring; ) ä (a with two dots, &auml; ) ö (o with two dots, &ouml; ) etc.
27
2580
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 image" method. I know the $_SERVER contents can be spoofed, so I thought of doing something similar to this: <?php session_start(); $code = mt_rand(0,1000000); $_SESSION = $code;
7
2162
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 submit the form via e-mail and have the complete form with answers sent, not just the data. That is, the recipient should be able to open the attachment and see (and print) the complete, formatted form. It seems to me that solutions simply...
5
2039
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 by spaces. Any ideas?
19
3283
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 (md5) the password field using a random one-time salt (nonce) -- generated by php and pasted in the form -- that is then posted with the hashed password
7
3328
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 guests added. form.php function createGuestNameAndEmailElements() {
0
1017
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 the form and appends it to an email which it then sends out to one specific user (for testing purposes, it's sending to me). My problem is that the code somehow is sending two identical emails to me. I am almost certain that the code looks ok,...
1
9740
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 script which receives all the data and creates a file in the specified directory. If I am uploading only the file all works well, however I want to send data of other fields too (field1, field2 ..etc), this fails the post request and even the file is...
0
1556
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. unfortunately, no error message is given by the system. <?php class Mail_Tabelle extends Mail_DB { protected $description = false; const TBL_HEAD = ' <thead>
0
7993
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7920
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8404
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
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.