Jump to content

Northern Flame

Members
  • Posts

    816
  • Joined

  • Last visited

    Never

Everything posted by Northern Flame

  1. well in your code i dont see $redirect getting established and you are saying to display the error if $error is empty....
  2. i dont really understand what you are trying to do, you have a select tag, and depending on the results of what the user selects you want to echo either an input where the user puts more info or a read only input tag with pre-written info? is that what you are trying to do?
  3. you were telling the script to echo the error if the user submitted a value, that was your problem.... try this: <CENTER> <form action="index.php?body=register" method="post" class="black"> Username: <input type="text" name="username"/> Password: <input type="password" name="password"/> Confirm passowrd: <input type="password" name="password2"/> Email: <input type="text" name="mail"/> <input align=center type="submit" value="Register!"/> <?php $t_user=$_POST['username']; $t_pass=$_POST['password']; $t_pass2=$_POST['password2']; $t_mail=$_POST['mail']; if (empty($_POST['username']) or empty($_POST['password']) or empty($_POST['password2']) or empty($_POST['mail'])) { echo "<div class='border_red padding_mid back_red'>"; if ($t_user=='') echo "You left the username field blank."; else if ($t_pass!=$t_pass2) echo "The passwords you typed did not match. Please type them again."; else if ($t_pass=='' or $t_pass2=='') echo "You left the password field blank."; else if ($t_mail=='') echo "You left the email field blank."; else { echo "Thankyou for registering. An email has been sent to the email address you supplied. As soon as you click the link in that email, you'll be able to start posting!"; //register } } ?> </CENTER>
  4. I may be wrong, but every time i see a cookie called, the word cookie is always in caps, i dont know if thats mandatory, but you may need to change that. You also need quotes around basketid, also, you never set a time on the cookie, if you want a week, do this: if (isset $_COOKIE['basketid']) { $yourbasketid = $_COOKIE['basketid']); } else { echo "ohw your a new user lets create a basket fo you bitch"; setcookie('basketid',$ip.$randomcode,time+60*60*24*7, (bloody ages)) }
  5. im just editing his code, str_replace('<br />', "\t\t<br />", $the_string_in_question); i just replace the single quotes with double quotes and took out a back slash before each t, that should do the trick
  6. do this: str_replace('<br />', "\t\t<br />", $the_string_in_question);
  7. yea i agree with BlueSkyIS, not all search engines ignore that, some do, but the major ones like google and yahoo dont
  8. it would be more like <?php $page = $_GET['page']; if($page == 'loging'){ include('login.php'); } ?>
  9. replace echo $sql; with mysql_query($sql);
  10. do you mean something like http://www.website.com/?page=home if so, in your index.php page make your file include certain files depending on which page is called through $_GET['page']
  11. what version of PHP are u running?
  12. even if the password is encrypted its not that smart to put it in the cookie....
  13. well cookies can be faked so you need to make it so that you can decode it and it will be hard to fake. maybe type in a random string and mix in the member id, something like: nfitrn4ql5roqj432io4j23432oj42n-{member id}-enk34b32k5b3 (without the brackets) then do something like <?php $blown = explode("-", $_COOKIE['memberid']); $id = $blown[1]; // then make sure the id is valid $query = mysql_query("SELECT * FROM `table` WHERE `id` = '$id'"); // then show the content after checking if it exists if(mysql_num_rows($query) == 1){ // show content } else{ // show an error saying that his/her account was not found } ?> thats a simple example of how to do it, good luck.
  14. yea what you're trying to do really doesnt make sense, cURL() is more for posting data and other stuff. what you are trying to do can be done by either including that file or just simply writing that code in page1.php
  15. you can do this: <?php /* run your PHP script.... */ ?> <html> <!-- display HTML content --> </html> or it can be like this too <html> <!-- some html --> <?php /* some PHP */ ?> <!-- more HTML --> </html>
  16. it can be in an array, maybe you can put something like this on your form: <input type="checkbox" name="pepsi" value="1.00" />Pepsi<br /> <input type="checkbox" name="coke" value="1.25" />Coke<br /> <input type="checkbox" name="sprite" value="1.50" />Sprite then on the php that processes it just do something like this: <?php $soda['pepsi'] = $_POST['pepsi']; $soda['coke'] = $_POST['coke']; $soda['sprite'] = $_POST['sprite']; foreach($soda as $name => $value){ echo "You purchase a $name for \$$value<br />\n"; } // if you want to add them.... echo "Your total price is ". array_sum($soda); ?>
  17. not really, you can just make setup your server to read php in html by way of mime types.
  18. well it depends on what exactly you are trying to do....
  19. u can just insert the value (true or false) into a mysql database and then grab the value in your script.
  20. 60*60*24*100 60 - 60 seconds = 1 minute * 60 - 60 seconds * 60 = 1 hour * 24 - 1 hour * 24 = 1 day * 100 - 1 day * 100 = 100 days
  21. are you sure $id was set correctly?
×
×
  • 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.