Jump to content

AlexanderBlade

New Members
  • Content Count

    4
  • Joined

  • Last visited

Everything posted by AlexanderBlade

  1. So I took CroNiX's advice and put this php redirect function at top of the page. <?php function redirect_to($new_location){ header("Location: " . $new_location); exit; } $page_ok=$_POST['firstName']; if($page_ok=="userFirstName"){ redirect_to("http://www.google.com"); }else{ redirect_to("http://www.msn.com"); } ?> My page is designed to post to itself but after saving the data to the database, assuming it passes validation, I want to send the user to another page. With the php code at the top of the page, as soon as I type the page in the browser's address field it redirects to the second url: redirect_to("http://www.msn.com"); How can I make the function fire only after the button click?
  2. Hi, I'm trying to submit a form to itself and then have go on to another page. I've tried a few things but the form only returns to itself. How can I redirect the form after posting to itself. My HTML code is between <?php ?> tags. <head> <title>untitled</title> <script src="respond.min.js"></script> </head> <body> <form id= "formId" action="goToUrl.com" method ="post"> Name: <input type = "text" name ="firstName" value=""/> <input id="formButton" onClick="self.location='www.msn.com'" type="submit" name="submit" value="Submit" /> <br/> </form> </div> </body> </html> also tried puting this script just after the closing form tag: <script type="text/javascript"> $('#formButton').click(function(){ location="www.google.com" }); </script> In both cases the form seems to ignore the script. Thanks for any help with this!
  3. Thank you so much!! I"m embarrassed to say that I spent a few hours well on this trying all kinds of combinations. Thanks again!
  4. Hi everyone, I'm trying to get my head around blending in and out of php and html. I've seen some simple examples which work great but now I have this variable that comes from the database and I would like to style the variable in-line with html markup. Here's what I'm trying to do: <?php echo "Price : ",'<Font size="100"> $tournament["pricePerPlayer"] </font>'; ....more of the same code goes here... ?> I can't get $tournament["pricePerPlayer"] to be controlled by the font tag. How do I do this? Any help would be greatly appreciated. Thanks,
×
×
  • 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.