Jump to content

daddyb1

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

daddyb1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. @scootstah can you give an example?
  2. table name login username password mjerry jerryjerry ssimon simonsimon ablack blackblack phenry henryhenry rjames jamesjames kpowell powellpowell this is the table in the database
  3. I am trying to get 6 usernames and passwords from a local database via a file I created called database_log.inc. note 2 columns and 6 rows How can get each password & username with the current code? here is the code for the log on: <?php function clean($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } $user = clean($_POST['username']); $pass = clean($_POST['password']); include 'database_log.inc'; //info from the database separate file if ($user == "shane" && $pass == "shane") //password and user name not in the database { session_start(); $_SESSION['username'] = $user; $_SESSION['password'] = $pass; $_SESSION['ON']="TRUE"; $lifetime=600; setcookie(session_name(),session_id(),time()+$lifetime); header( 'Location: inner.php' ) ; exit(); } else { header( 'Location: index.php' ); session_destroy(); exit(); } ?>
  4. i want each page to be included in the index page when the condition i have written is met, but i am trying to read each pagee with a unique hidden variable such as : <input type="hidden" name="state" value="1" /><input type="hidden" name="page" value="1" /> etc but i am not coding it correctly. does this explain what i am trying to do?
  5. <input type="hidden" name="page" value="1" /> <input type="hidden" name="state" value="1" /> <input type="hidden" name="page" value="2" /> <input type="hidden" name="state" value="1" /> <input type="hidden" name="page" value="3" /> <input type="hidden" name="state" value="1" /> <input type="hidden" name="page" value="4" /> <input type="hidden" name="state" value="1" /> i want these to identify each page that will be included in the index page. each page will be added to the index page based on the if conditions. its not working. is there another way to do it?
  6. how do i pass the hidden variables?
  7. -----index page----- <?php $state=$_GET["state"];?> <?php $page=$_GET["page"];?> <html><head><title>CONTROLLER</title><?php include("styles.inc"); ?></head> <body><div style="position:absolute; top: 1px; left: 1px;"><?php include("dynamicmenu.inc");?></div> <div style="position:absolute; top:15px; left: 140px;"> <?php if ($state == NULL { include("default.inc"); } //DEFAULT PAGE INCL else if ($state=="1") { include("problem1.inc"); if($page=='1' || $page == NULL) {include("problem1.php");} if( $page=='2') { include ("problem1s2.php"); } if( $page=='3') { include ("problem13y.php"); } if( $page=='4') { include ("problem13j.php"); } } else if ($state=="2") { include("problemm2.inc"); include("problem2.inc"); } //PROBLEM2 PAGE INCLUDE ?> </div> </body> </html> ----problem1.php <?php echo' <input type="hidden" name="page" value="1" /> <input type="hidden" name="state" value="1" />'; echo '<form action="index.php?page=2" method="get"> Enter Coupon State: <select name="coupon"><option></option><option>NJ</option> <option>NY</option></select> <input type="submit" value="ENTER"/> </form>'; ?> ----problem1s2 <?php echo' <input type="hidden" name="state" value="1" /> <input type="hidden" name="page" value="2" /> '; $coupon=$_GET["coupon"]; if($coupon=="NJ") { echo "<form action='index.php?page=3' method='get'>"; echo "<input type='hidden' name='days' value='5'/>"; } else if($coupon=="NY") { echo "<form action='index.php?page=4' method='get'>"; echo "<input type='hidden' name='days' value='1'/>"; } else { echo "<form action='index.php?state=1' method='get'>"; } echo"ENTER ZIPCODE LAST 2-DIGITS : <input type='text' name='code'>"; echo'<input type="submit" value="NEXT STEP"/> ?> ------problem 13y.php <?php echo' <input type="hidden" name="state" value="1" /> <input type="hidden" name="page" value="3" />'; $days=$_GET["days"]; $code=$_GET["code"]; $code2=(int)$code%(int)$days; if($code2<=2) { echo "FINAL OUTPUT:B$days$code2";} else { echo "FINAL OUTPUT:D$code2$days";} echo "<a href='index.php?state=1'>restart</a>"; ?> ----problem13j.php <?php echo'<input type="hidden" name="state" value="1" /> <input type="hidden" name="page" value="4" /> '; $days=$_GET["days"]; $code=$_GET["code"]; $code=10%(int)$code; if($code<=1) { echo "FINAL OUTPUT:A$days$code";} else { echo "FINAL OUTPUT:C$code$days";} echo'<br /><a href="index.php?state=1">restart</a>'; ?>
  8. the files are in the zip folder. i attached
  9. I have a menu that i want to be added to every page of my coding using a hidden variable, but i cannot get it to work. I using this with a few if conditions. the index page should navigate every page. can anyone help? I have attached the files to illustrate the coding i have done so far. [attachment deleted by admin]
  10. it works perfectly Robert. I would've never be able to do this without the help of you and everyone. THANK YOU 8) 8) :D
  11. Its okay and the help you have given is appreciated.
  12. Damn you're good and thank you once more. I have learned a lot tonight. I will follow your concepts and do it the future. Can I display the output only when an option is selected and a number is entered? the original works like that.
  13. is there a way to make it look like the original files? I am here at computer for over 12 hours now trying to make it work the way it suppose to. its no longer showing blank. I guess its because I am a novice. The original files are in the zip folder I've attached.
  14. This is the css. the css will be seperate div.note { font-size: xx-small; color: red ; } div.output { font-size: large; } div.block { width: 500px; border: 2px solid blue ; background: #cccccc; } attachment.
×
×
  • Create New...

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.