473,418 Members | 1,993 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Pass values from form using URL

I am creating a search box that the user types a value in, and then
this gets passed to another page called search.php

I would like to be able to pass these values through the URL, but I
cant seem to figure out how. Right Now I have a simple html form that
passes the value through posting, which I can then pull with a
$_POST['name']. But I need to have this value be passed through URL.

Jun 27 '06 #1
3 3465

drec wrote:
I am creating a search box that the user types a value in, and then
this gets passed to another page called search.php

I would like to be able to pass these values through the URL, but I
cant seem to figure out how. Right Now I have a simple html form that
passes the value through posting, which I can then pull with a
$_POST['name']. But I need to have this value be passed through URL.


Hello Drec
Your problem can be solved by replacing the $_POST with $_GET['name']
I guess that the value of method in the form tag is :
<form .... method="POST"....>
so u have to replace it with method="get" in this case u can see what u
r passing in the url.

Chamirame Sadaki

Jun 27 '06 #2
<comp.lang.php>
<drec>
<27 Jun 2006 07:10:55 -0700>
<11**********************@m73g2000cwd.googlegroups .com>
I am creating a search box that the user types a value in, and then
this gets passed to another page called search.php

I would like to be able to pass these values through the URL, but I
cant seem to figure out how. Right Now I have a simple html form that
passes the value through posting, which I can then pull with a
$_POST['name']. But I need to have this value be passed through URL.


$_REQUEST['name']
$_REQUEST['demo']
$_REQUEST['blah']

whatever.php?name=ONE&demo=TWO&blah=THREE
--
www.emailuser.co.uk/?name=KRUSTOV
Jun 27 '06 #3
drec wrote:
I am creating a search box that the user types a value in, and then
this gets passed to another page called search.php

I would like to be able to pass these values through the URL, but I
cant seem to figure out how. Right Now I have a simple html form that
passes the value through posting, which I can then pull with a
$_POST['name']. But I need to have this value be passed through URL.


If you want to pass them onto another URL, there are several ways of doing it.

If, for instance, the URL accepts GET variables, you can just do

header('www.example.com?name=' . "$_POST['name']).

If you must pass them as $POST variables, you could build a form with them as
hidden fields, send the page to the browser and with javascript immediately
submit the page. But depending on the user's browser, this might cause an
unwanted flask in the window. Additionally, it depends on the user having
javascript turned on.

A better (but more a little more complicated) way is to user Curl to submit the
values to the new page.

The most complicated (but doesn't depend on outside libraries) would be to open
a socket to the new site, send the HTTP headers, fetch the response and send it
to the user's browser.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 27 '06 #4

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

Similar topics

3
by: Nath | last post by:
Please help!? I am new to writing html, javascript, pretty new to MySQL but quite proficient at writing Perl and i'm a quick learner. I am building a database driven website and i am a little...
1
by: JM | last post by:
Hello, Using Access 2000 queries, you can reference(pass) form values directly using syntax like Forms!frmPaint!txtColor. I want to do a pass through query to SQL Server 2000, but I don't know...
4
by: tom | last post by:
Hi Experts, I want to pass the selectedDate value from my calender form to another web form or a web user control. Could you please show me how to do this? Thanks in advance.
2
by: KFactor | last post by:
Is it possible to pass form variables to a page on another server using response.redirect? Or is there a secure way of passing sensitive information from one site to another such as a userID? ...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
3
by: Aussie Rules | last post by:
Hi, I have a few aspx (.net2) form. The first form allows the user to enter into text box, and select values from drop downs The second form needs to use these values to process some data....
14
by: =?Utf-8?B?Umljaw==?= | last post by:
I have seen examples of passing data from FormB to FormA (Parent To Child) but I need an example of passind data from FormA to FormB. My main form is FormA; I will enter some data in textboxes and...
5
by: Rob | last post by:
I have a control (Button) on a Parent form which opens a Windows form... all I want to do is pass a value from the child form back to the parent... it should be so simple... i.e....
24
by: =?Utf-8?B?U3dhcHB5?= | last post by:
Can anyone suggest me to pass more parameters other than two parameter for events like the following? Event: Onbutton_click(object sender, EventArgs e)" Event handler: button.Click += new...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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,...
0
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...
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...

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.