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
Solved

Multifile

Posted on 2006-10-21
1
172 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 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

Title # Comments Views Activity
php mysql check email already in database. (second check) 7 65
PHP Echo with auto submit 8 28
ajax to record click 3 16
Php logic to add to date card 9 19
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

839 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