Solved

Multifile

Posted on 2006-10-21
1
161 Views
Last Modified: 2010-05-18
Hi,

I would like to ask how to code in PHP

ex.

if ($_POST['statechange']!="")
{
session_start();
session_register("statechange");
setcookie("accstate", $statechange, time()+3600);  /* expire in 1 hour */
{ header("Location: default_.htm"); }
}

But i want the Location: default_.htm will be automatically changed to seletected state in the form posting

ex.

if I choose state "Virgina" then click GO then the Location: default_.htm -> Location: default_VA.htm
if I choose state "Florida" then click GO then the Location: default_.htm -> Location: default_FL.htm
and soon

Thanks


0
Comment
Question by:abangbatax
1 Comment
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 17779798
I assume the value of $_POST['statechange'] contains the value VA , FL ... etc ?
otherwise you need a lookup array to translate Florida into FL etc...

if (@$_POST['statechange']!="")
{
$state = $_POST['statechange'];
session_start();
session_register("statechange");
setcookie("accstate", $statechange, time()+3600);  /* expire in 1 hour */
{ header("Location: default_$state.htm"); }
}
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now