Jump to content

Gldnbr

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by Gldnbr

  1. Yes, he is from another city using another network. I thought XAMPP would do the work, just need to run Apache and MySQL? I mean, it worked for me when I used localhost, there has to be some way to open the ports or something to allow him in it. I opened 80 and 8080, but he still can't get in.
  2. I'm trying to show my friend my website and it's not letting him or me view it. I am using my own IP-address. (dashed out for security, but it is correct) http://--.---.--.---/index-1.php When he and I type this into our browser, we can an error called "Resource Not Found". But, when I use localhost address, it works fine. http://localhost/index-1.php Does anyone know what is wrong? Do I need to open a specific port? USING XAMPP.
  3. Okay I see that now. This time I am trying to do the same for index-2.php to index-3.php, anyone know what is up? ERROR: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\index-2.php:10) in C:\xampp\htdocs\index-2.php on line 17 index-2.php: <?php session_start(); if (!isset($_SESSION['question']) OR $_SESSION['question'] != 2){ header("Location: http://localhost/index-1.php"); } ?> <?php session_start(); if(isset($_POST['submit'])){ $number = $_POST['number']; if ($number == "oil vial"){ $_SESSION['question'] = 3; header("Location: http://localhost/index-3.php"); exit();} } ?> <html> <head> <title>PHP Test</title> </head> <b>LEVEL 2</b> <body> <p> <font face="Courier New">vhwisgtpulffjroixfztpilnlixhjkmllwprkrmxyagrtonrcimeopytyioavbvykivnyqgxvzibjxwjzvmkdbhpwlbofudzpmys</font> </p> <br/></body> </html> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> Answer: <input type="text" name="number" /><br /> </select> <input name="submit" type="submit"> </form> index-3.php: <?php session_start(); if (!isset($_SESSION['question']) OR $_SESSION['question'] != 3){ header("Location: http://localhost/index-2.php"); } ?> <?php session_start(); if(isset($_POST['submit'])){ $number = $_POST['number']; if ($number == "red hot chili peppers"){ $_SESSION['question'] = 4; header("Location: http://localhost/index-4.php"); exit();} } ?> <html> <head> <title>PHP Test</title> </head> <b>LEVEL 3</b> <body> <p> <font face="Courier New">cmVkIGhvdCBjaGlsaSBwZXBwZXJz</font> </p> <br/></body> </html> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> Answer: <input type="text" name="number" /><br /> </select> <input name="submit" type="submit"> </form>
  4. How do I make it so if I get the question right, I have access to view the next page? For example, if I get this question right in index-1.php correct, it would take me to index-2.php (like in the script below), but if you don't get the question correct in index-1.php, you cannot have access/view index-2.php. Why I need this? Well, if you change the URL http://--------/index-1.php to http://--------/index-2.php, you can easily go from index-1.php to index-2.php without having to answer the question correctly. index-1.php: <?php if(isset($_POST['submit'])){ $number = $_POST['number']; if ($number == "elephant"){ header("Location: http://localhost/index-2.php"); exit();} } ?> <html> <head> <title>PHP Test</title> </head> <b>LEVEL 1</b> <body> <p> <font face="Courier New">c291cmNl</font> </p> <br/></body> </html> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> Answer: <!-- "elephant" --> <input type="text" name="number" /><br /> </select> <input name="submit" type="submit"> </form> Thanks
  5. I am honestly confusing myself more than I should. Why am I feeling stressed out! The error is telling me that a header modification is already in use, I THINK. Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\index-4.php:12) in C:\xampp\htdocs\index-4.php on line 23 <html> <head> <title>PHP Test</title> </head> <body> <p> <font face="Courier New">ZnJ5cyBwYmFnbnZhcnEgaGFxcmVqbmdyZSBvZXJuZ3V2YXQgbmNjbmVuZ2hm</font> </p> CLUE: The base is rotated <br/></body> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> Answer: <input type="text" name="number" /><br /> </select> <input name="submit" type="submit"> </form> <?php if(isset($_POST['submit'])){ $number = $_POST['number']; if ($number == "scuba"){ header("Location: http://localhost/index-3.php"); exit();} } ?> </html>
  6. Oh okay, I see now, I didn't know you can do that. But now what do you do with this? <form action="index-5.php" method="post"> I need to remove that so it doesn't redirect to index-5.php when I click submit, instead it would redirect to the URL if correct. I can't just remove it like this, can't I? <form action="" method="post">
  7. Hello PHP Freaks forum, I am a beginner in web development and seem to be understanding it very quickly, but there is one thing that is putting this into some halt. I have this code right here, what I want to do is have a "riddle site", where if you answer the riddle correctly, it redirects you to another page (in other words to the next riddle). Object: If correct, give access to next page. If incorrect, stay on page and print "Incorrect". I've tried to start on it, but the way how HTML and PHP don't mix very well, I feel like in the middle of an ocean feeling helpless. <html> <head> <title>PHP Test</title> </head> <body> <p> <font face="Courier New">ZnJ5cyBwYmFnbnZhcnEgaGFxcmVqbmdyZSBvZXJuZ3V2YXQgbmNjbmVuZ2hm</font> </p> CLUE: The base is rotated <br/></body> <form action="index-5.php" method="post"> Answer: <input type="text" name="number" /><br /> </select> <input name="submit" type="submit"> </form> <?php if(isset($_POST['submit'])){ $number = $_POST['number']; if ($number == "scuba"){ echo "CORRECT";} } ?> </html> If possible, can you give me an explanation how to do it and a sample of it as well? Thanks, Gldnbr
×
×
  • 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.