Jump to content

p2grace

Members
  • Posts

    1,024
  • Joined

  • Last visited

    Never

Posts posted by p2grace

  1. Try this:

     

    setcookie('SITE_remember_me', '1', (time()+31536000),'/'); 
    

     

    <?php
    session_start();
    
    if(isset($_COOKIE['SITE_remember_me'] && $_COOKIE['SITE_remember_me']=='1'){
             
       setcookie('logged_in', 1, 7200 +time());
       
       $_SESSION['logged_in'] = '1';
       $_SESSION['first_name'] = $_COOKIE['first_name'];
    
    }
    
    ?>
    
    
    

     

    I added a folder path to the cookie.

     

    You should put your site name in the front of your cookie so you don't have any conflict with other website cookies.

     

    Let's start there, if it still doesn't work.  Display php errors and we can go from there.

  2. Something like this should do the trick.

     

    <?php
    
    session_start();
    
    include("checklogin.php");
    
    $username = $_SESSION['myusername'];
    
    $query = mysql_query("SELECT * FROM members WHERE username='$username'");
    if (mysql_num_rows($query)==0){
    die("User not found!");
    }else{
    $row = mysql_fetch_assoc($query);
    $location = $row['imagelocation'];
    if($location == ""){
    	echo "<img src ='/profileimages/box.png' width='225' height='275'>";
    }else{
    	echo "<img src ='$location' width='225' height='275'>";
    }
    }
    
    
    ?>
    

  3. Heredoc is a much easier way to do this.

     

    <?php
    echo <<<HTML
    <!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="jjrq.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <form method="post" name="table" id="table">
    <select name="select" id="select">
    <option value="one">1</option>
    <option value="two">2</option>
    <option value="three">3</option>
    </select>
    </form>
    </body>
    </html>
    HTML;
    ?>
    

     

    No need to escape quotes.

  4. Hi imimin, it's good to see you're still making your way through some typical coding challenges :)

     

    If you look at the html surrounding your variable within your heredoc statement, you closed your <td> and then tried adding content after it (through the db variable).  You need to put the closing </td> after the db variable.  Try the following:

     

       echo <<<HTML
       <input type='hidden' name='name' value='$prod_name' />
       <input type='hidden' name='price' value='$price' />
       <input type='hidden' name='sh' value='$weight' />
       <input type='hidden' name='img' value='https://secure.impact-impressions.com/poj/includes/img_resize3.php?src=$sitelocation$img&width=100&height=100&qua=50' />
       <input type='hidden' name='img2' value='' />
       <input type='hidden' name='return' value='http://www.patternsofjoy.com/order_more.php' />
       <input type='RADIO' name='custom20' value='Style: $selected_style' checked='checked' style='display: none' />
       <strong>Garment Style: </strong>$selected_style
       <br />
    
    
                   <a href="http://www.patternsofjoy.com/order_more.php" TITLE="Click here to change Garement Style">***Change Garment Style***</a>
    
                 </TD>
                 </TR>
                <TR>
                <TD>
                <B>Size Range:</B><BR>
                <INPUT TYPE="RADIO" NAME=custom30 VALUE="Size Range: Adult +$2.00"> Adult (Add $2.00)
                <BR>
                <INPUT TYPE="RADIO" NAME=custom30 VALUE="Size Range: Child"> Child<BR>
                
               
                *****NEW TABLE HERE VIA DB($adult_size_chart)*****
               </td>
                </tr>
                <tr>
                   <td>
                      <strong>Garment Size:</strong>
                      <select id="custom40" name="custom40" size='5'>
                         <option value="Size: Small (S)">Small (S)</option>
                         <option value="Size: Medium (M)">Medium (M)</option>
                         <option value="Size: Large (L)">Large (L)</option>
                         <option value="Size: Extra Large (L)">Extra Large (L)</option>
                         <option value="Size: Toddler (T)">Toddler (T)</option>
                      </select><br />
                      <a href="javascript:newwindow2();" >Garment Measuring Tips</a>
                   </td>
                </tr>
    HTML;
    

     

     

  5. It doesn't appear because of the <input type="text" value="valuewith"" /> (notice the double quotes). One method would be to use str_replace() to replace aprostrophe's and leave the escaped quotations.  There's probably a better way to do it but that's the first idea that popped in my head.

  6. That typically happens when the original quote or apostrophe was copied out of Microsoft Word, and they are not actual quotes or apostrophe's, but rather Microsoft symbols that look similar.  This method is used so the quotes and apostrophes resemble the corresponding font in Microsoft applications, however it is also the reason all text should be copied into a text editor (to convert the Microsoft symbols) before being entered into the database.

  7. Is there supposed to be an equal number of values in each array?  If so you could just do an array_shuffle to each and then one for loop to get the value of each key.

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