LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-02-2004, 11:20 AM   #1
agallant
Member
 
Registered: Oct 2003
Location: D.C USA
Distribution: Redhat 9. Thinking about Slackware
Posts: 166

Rep: Reputation: 30
PHP If statment


HELP!!!!!!!!

I usailly can figure out these things on my own but my boss told me that i have to have this done in a few hours.

What i need to do is have a field box on my home page that some one can enter a code in to and be redirected to a page depending upon entering the code and clicking ok. Any thought would be verry much appreaciated.

-AG
 
Old 07-02-2004, 11:49 AM   #2
hfawzy
Member
 
Registered: Aug 2002
Location: Egypt
Distribution: Debian Sarge, Slackware 10.0
Posts: 163

Rep: Reputation: 30
Try this :

<?php

$myfield = $_POST["thefield"];

header("Location: thePage.php?code=".$myfield);

?>

If for example the code entered is 1001, when clicking on the button, this will redirect you to thePage.php?code=1001
 
Old 07-03-2004, 09:15 PM   #3
agallant
Member
 
Registered: Oct 2003
Location: D.C USA
Distribution: Redhat 9. Thinking about Slackware
Posts: 166

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by hfawzy
Try this :

<?php

$myfield = $_POST["thefield"];

header("Location: thePage.php?code=".$myfield);

?>

If for example the code entered is 1001, when clicking on the button, this will redirect you to thePage.php?code=1001
Could you define thefield? I assume that thepage.php is the page that i want it to go to and $myfield is the text field where they are entering the data.
 
Old 07-04-2004, 09:02 AM   #4
dfownz
Member
 
Registered: Jan 2004
Posts: 35

Rep: Reputation: 15
Thefield is the text box. myfield is the data collected from thefield, but its just saved as a variable called $myfield. And yes thePage.php is the page you would go to after the submit button has been pressed
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
using 'echo' in a system statment in php evilchild Programming 3 09-23-2004 02:27 PM
so much errors (if statment ) huno Programming 4 07-20-2004 10:18 AM
not able to run mysql statment Robin01 Linux - General 1 03-19-2004 07:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration