Jump to content

Archived

This topic is now archived and is closed to further replies.

Hardwarez

How Can I post a value without using a form

Recommended Posts

Ok, my proram is working off post data.  I have run into a place where I need to be able set a post name and value without using a form.  How can I do that?

I catch submitted forms like this:
if ($_POST['looking'] == 'Button A') dosomething();

So how do I set a post value named looking to "myValue"?
Without a button or form..

Share this post


Link to post
Share on other sites
simple:

[code]$_POST['looking'] = 'myValue';[/code]

superglobals are ALWAYS initiated, whether they contain anything or not.  that means you are always able to add values to them dynamically without having to force the engine to initiate them.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.