Solved

Multifile

Posted on 2006-10-21
1
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 143

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.  …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

733 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