Jump to content

Northern Flame

Members
  • Posts

    816
  • Joined

  • Last visited

    Never

Posts posted by Northern Flame

  1. 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?

  2. 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>
    

  3. 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))
    }
    

     

     

  4.  

    Immediately after running you nl2br run...

     

    str_replace('<br />', '\\t\\t<br />', $the_string_in_question);

     

     

     

    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

  5. "Crawlers will ignore the parameters (everything after the ?), so the only page that gets indexed is the default page."

     

    Incorrect. Not that it's a bad idea to optimize your URLs as described, but I've got hundreds of ?=blahblah pages indexed in all search engines.

     

    yea i agree with BlueSkyIS,

    not all search engines ignore that,

    some do, but the major ones like google and yahoo dont

  6. ahh

     

     

    so it would be like

     

     

    if($page == loging){

    include login.php?

    }

     

    it would be more like

     

    <?php
    
    $page = $_GET['page'];
    
    if($page == 'loging'){
    include('login.php');
    }
    
    ?>
    

  7. I think you should store their member id and their encrypted password. Then on every single page you should check to make sure the user id matches the encrypted password. This is because it is easy for users to edit their cookies and view their cookies.

     

    It's better to use sessions though. To the coder they work almost exactly the same, but a user can't edit session variables. So once you've checked their password you don't have to check it again.

     

     

    even if the password is encrypted its not that smart to put it in the cookie....

  8. 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.

  9. 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

  10. 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);
    
    ?>
    

×
×
  • 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.