Jump to content

SEVIZ

Members
  • Posts

    93
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

SEVIZ's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks. No the amount is pulled from the database on load. And then edited when the page is submitted. The issue is the amount to spend is pulled into the page in a form field. So when they hit back button nothing is executing and its just showing the page as how it was before they left with the form field already showing the number. If I use http refer can I use it so that the page only displays in full if refer = x.php. And if its anything else it shows a message? Would it work like this: <?php $referer = $_SERVER['HTTP_REFERER']; if ($referer == 'http://55.55.55.55/uniform/index.php') { header('Location: http://55.55.55.55/uniform/order.php'); } else { header('Location: http://55.55.55.55/uniform/nono.php'); } ?>
  2. Here is my problem. Hopefully you all can help me figure out a solution. I have a php page that a user logins to and it pulls from a database a number. This number is an amount of money to spend. Once the user fills out the form on the page it then on submit does an UPDATE query and changes the amount to minus what they just spent. The problem I am having is that on the next page the person is hitting the Back button and the previous page shows with the original amount and allows them to submit again. How can I make that page not be able to be seen from the back button? Does this make sense? Is there a way in php that if page referrer = x.php display: no no? Thanks for any help.
  3. Here is my code <?php include('mobile_device_detect.php'); mobile_device_detect(true,true,true,true,true,true,'mobile.php',false); ?> <?php session_start();?> <?php $password = "hellothere"; // Modify Password to suit for access, Max 10 Char. ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Text Tool</title> <style type="text/css"> .style1 { background-image: url('bg.jpg'); } .style2 { background-image: url('t_bg.jpg'); } .style3 { background-color: #FFFFFF; } .style4 { text-align: center; } .style5 { text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: Large; font-weight: bold; } .style9 { text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: Medium; font-weight: bold; color: red; } .style7 { font-family: Arial, Helvetica, sans-serif; font-size: small; } .hint { text-align: center; margin-top: 2px; border: 1px solid #a1a1a1; padding: 10px 10px; background-color: #e2e2e2; width: 98%; } .box { border: 1px solid #dcdbdb; padding: 2px 2px; background-color: #f0f0f0; text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: Medium; } </style> </head> <body style="margin: 0; background-color: #000000"> <?php if(isset($_SESSION['errors'])) { echo $_SESSION['errors']; unset($_SESSION['errors']); } // output form ?> <?php // If password is valid let the user get access if (isset($_POST["password"]) && ($_POST["password"]=="$password") || ($_SESSION['login'])) { ?> <!-- START OF HIDDEN HTML - PLACE YOUR CONTENT HERE --> <form action="send.php" method="post"> <table width="98%" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td valign="top" class="style5"> Who do you want to text?<br /></td></tr> <tr> <td valign="top"> <select name="recip" class="box"> <option value="none">--- General ---</option> <option value="all">All North and South</option> <option value="sl">All Sups and Leads</option> </select> </td> </tr> <tr> <td class="style5">What do you want to say?<br /></td></tr><tr><td class="style5"><textarea name=message wrap=physical" cols="47" rows="6" id="comment" maxlength="142" class="box"></textarea></td></tr><tr><td class="style7" align="right">Characters Remaining: <input readonly type=text name=remLen size=3 maxlength=3 value="142" /> </td> </tr> <tr> <td> <!-- Reply to email (If applicable):<br /> --><input name="email" type="hidden" id="email" size="20" value="sys@sys.com"></td> </tr> <tr> <td valign="top" align="center"><input type="submit" name="Submit" value="Send Your Text!"></td> </tr> </table> <!-- END OF HIDDEN HTML --> <?php } else { // Wrong password or no password entered display this message if (isset($_POST['password']) || $password == "") { print "<p align=\"center\"><font color=\"red\"><b>Enter Password</b><br>Please enter the correct password</font></p>";} print "<form method=\"post\"><p align=\"center\">Please enter your password for access<br>"; print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\"><input value=\"Login\" type=\"submit\"></p></form>"; } ?> </form> </body> </html> When the user logs in it lets them fill out a form which submits to a second page. That page then auto reloads back to this page. When it does that it currently asks for the login again. I want it to know its the user and to not have them login again. Someone tried to offer some help with sessions but the code does not work. It doesn't even keep you logged in. Any help is appreciated.
  4. Ok I am using this code <?php // If password is valid let the user get access if (isset($_POST["password"]) && ($_POST["password"]=="$password") || ($_SESSION['login'])) { ?> The above says if the password is right or session login is there let them in. But where do I start the session login? It seems like I should start it in the same place since the session should be started when they are logged in. Any help is appreciated
  5. Your post in my other thread helped already. Thank you for your help.
  6. Any links to how sessions work? I am extremely new to this and have no knowledge of these. Thanks for any tips!
  7. Currently my Submit button loads to a second page. Is that a problem for these helpful examples?
  8. I am using this simple code for a password protect on a php page. <?php // If password is valid let the user get access if (isset($_POST["password"]) && ($_POST["password"]=="$password")) { ?> After the above it displays the content or a login depending on if they entered the password. How can I edit the if statement to also allowed access if the user is coming from a certain address? The reason is that this password gains access to a form that on submit goes to a second page that actually does the query and such. Once done that page redirects back to the form. Currently it then asks for the password again. I want it to just display the content since they are coming from that link. Thanks for any ideas.
  9. I have a dropdown with choices. Inside I have titles for sections with a value of "none". Is there a way via php that if value = none it errors on submit? Most importantly is there a way to do this WITHOUT javascript? Thanks
  10. And that was it. Thank you Andy for spotlighting the obvious.
  11. Andy> Yes I am using nl2br on the message. Like this: $MESSAGE_BODY = nl2br($_POST["message"]);
  12. Maybe I am not explaining this right. The user is typing a message into a messagebox form. THEY are hitting enter for a new line and in the message that is sent it is inserting <br> all by itself. I cannot edit the code as I did not code that in.
  13. I can try that but I do not know how I could do that. Nowhere in the code did I set it to use <br> it is doing it by itself. Is there a way in the code to tell it to use /n instead of <br>?
  14. Hey guys. I have a script I made that emails a message to peoples phones via text. Its very simple and just emails using normal php mail command. Everything is awesome except for one detail. I cannot hit enter in the message or else in the text you actually see "<br>". Is this a flaw in my code somehow? Obviously it is using html by adding the <br> and the phone cannot display an html message. How can I get it to insert a break when enter is hit without showing as <br> in the code? Or is there simply no way? Thanks I would post my code but its just a messagebox and submit. Let me know if you need it though.
×
×
  • 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.