473,791 Members | 2,947 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 3334
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
7407
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
4450
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
2600
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
2174
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
2046
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
3305
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
3340
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
1025
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
9793
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
1575
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
9669
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
10426
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
10207
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
10154
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3713
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.