473,811 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can PHP Post without a form?

I have a dropdown list dynamically created in a form by PHP from a MySql
table. This is the only element on the page. For some records there is only
a single selection, and if that's the case I'd like to just post that and
go to the next page. Is there a simple way to do that using POST? I know
how to do it with GET, but don't like the resulting URLs.

Or is there a simpler method I'm not thinking about?

Thanks,
Larry
Jul 20 '07
12 16284
bill wrote:
Michael Fesser wrote:
>header("Locati on: http://{$_SERVER['HTTP_HOST']}/pag2.php");
The URL must be absolute.

why ?
HTTP/1.1 spec says so.

Most browsers do support relative URLs in Location headers, but it's unwise
to rely on that.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 30 days, 17:58.]

Parsing an HTML Table with PEAR's XML_HTTPSax3
http://tobyinkster.co.uk/blog/2007/0...table-parsing/
Jul 21 '07 #11
Toby A Inkster wrote:
bill wrote:
>Michael Fesser wrote:
>>header("Locat ion: http://{$_SERVER['HTTP_HOST']}/pag2.php");
The URL must be absolute.
why ?

HTTP/1.1 spec says so.

Most browsers do support relative URLs in Location headers, but it's unwise
to rely on that.
Thanks to you both.
Jul 22 '07 #12
Larry L [in Honolulu] wrote:
I have a dropdown list dynamically created in a form by PHP from a MySql
table. This is the only element on the page. For some records there is only
a single selection, and if that's the case I'd like to just post that and
go to the next page. Is there a simple way to do that using POST? I know
how to do it with GET, but don't like the resulting URLs.

Or is there a simpler method I'm not thinking about?

Thanks,
Larry
You're looking for a Javascript solution - client side, you know.
There's a submit() function that you can programatically fire in JS to
have the page submit a form.

<a href="javascrip t:submit();">Su bmit</a>

It'll retain that hyperlink look and feel, but actually be a post
instead of a get.


Aug 3 '07 #13

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

Similar topics

6
6644
by: Angelos | last post by:
I have this list of logs stored in a MySQL DB. I display them in a list and next to each log I have a del view LINK I want to add Checkboxes next to each log and keep del and view links as well. Then you can select all the logs you want to delete, hit a delete Link and send the variables in a script... Can you do that without having a form ?
1
1629
by: Matt | last post by:
Is it possible to post the form data and open the page as a modal window? Because when I do the following, it will open page2.asp in a new window, but I still able to manipulate page1.asp. I want to make page2.asp as modal window. <form action="http://server2/page2.asp" method="post" target="_blank"> Any ideas?
17
1651
by: Justin | last post by:
How do I post a form to a specified url using an ASP.NET with a code behind? With traditional ASP I used to be able to simply use: action="https://www.domain.com/process.asp" Thanks, Justin.
8
5081
by: Gert | last post by:
Hi, I have a form (server side) because of the filling of variables through the application. But now I need to post it to an url on submit. My .HTML form looks like this, but how to translate it to asp.net vb code? !--<FORM ACTION="/test/test.php" METHOD=POST>--> <form action="https://multipay.net/transaction/mpmain.php" method="post"> ....
6
2461
by: Jason | last post by:
I have a sticky problem relating to my 'join' registration form inside our authenticatin system... We have just signed up for salesforce.com and I need to somehow integrate the canned web-to-lead form from salesforce inside my login/registraiton system without messing up the existing 'join' form. My registration form is built on top of database while the salesform form is statically generated form which is similiar but not exactly the...
3
6360
by: JimO | last post by:
Is there a way to force a post without using submit button? Thanks, Jim
4
2448
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I POST a form to a new window? ----------------------------------------------------------------------- You use the target attribute on the form, opening a window with that name and your feature string in the onsubmit handler of the FORM. <form ... target="wndname" onsubmit="window.open('',this.target,'features');return true;">
4
1419
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I POST a form to a new window? ----------------------------------------------------------------------- You use the target attribute on the form, opening a window with that name and your feature string in the onsubmit handler of the FORM. <form ... action="..." target="wndname" onsubmit="window.open('',this.target,'features');return true;">
0
9728
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
9605
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
10648
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
10389
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
10402
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
10135
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
9205
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
6890
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();...
2
3867
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.