Jump to content

metrostars

Members
  • Posts

    169
  • Joined

  • Last visited

    Never

Posts posted by metrostars

  1. I've not done PHP for a while so forgive me if I'm wrong.

     

    You can only use the cookies on the domain you set them on.

     

    i.e. If you set the cookie on sitea.com, then you cannot access this cookie from siteb.com and vice versa. I think you'll have to look into databases and IPs to get what you want.

     

    Or set a file in sitea.com to handle all cookie set functions for both sites.

  2. You could either make each image a different contact us:

     

    $rightbox = array(

      'faqs' => '_img/faqanswers.jpg',

      'contact-us' => '_img/contactsuccessful.jpg',

      'contact-us2' => '_img/contactpotential.jpg',

      'contact-us3' =>  '_img/contactwinner.jpg',

      'login' => '_img/loginexperience.jpg',

    );

     

    or a multidimensional array:

     

    $rightbox = array(

      'faqs' => '_img/faqanswers.jpg',

      'contact-us' => array('1' => '_img/contactsuccessful.jpg', '2' => '_img/contactpotential.jpg', '3' => '_img/contactwinner.jpg'),

      'login' => '_img/loginexperience.jpg',

    );

     

  3. This won't work as     

     

    while($row = mysql_fetch_assoc($OrderDetails)) {

     

    can only be defined once.

     

    You should do

     

    
    <?php 
    
    $result2 = mysql_fetch_array($OrderDetails);
    
    ?>
    
    

     

    and then

     

    
    <?php
    
    while($row = mysql_fetch_assoc($CustomerDetails)) {
       
         Pass customer_id from $CustomerDetails query to $OrderDetails in inner loop below
       
         foreach($result2 AS $key) {
       
               Use customer_id value to drive this inner query      
         }
    }
    
    ?>
    

  4. if (isset($_GET['sec']) == '2') { $type = "imgExp"; }

    if (isset($_GET['sec']) == '3') { $type = "imgPub"; }

     

    isset only can only == 1 or 0, not 2 and 3.

     

    isset only checks if $_GET has a value set, not what that value actually is.

     

    You should have it as

     

    if ($_GET['sec'] == '2') { $type = "imgExp"; }

    if ($_GET['sec'] == '3') { $type = "imgPub"; }

     

    and the same for the one further up.

  5. include 'tax.php'; should work. Just make sure both files are in the same folder, or use ../ or foldername1/foldername2/ etc.

     

    There is also a problem with tax.php itself:

     

    Parse error: syntax error, unexpected ';', expecting '{' in /usr/www/users/medbqq/jaco/sams2/tax.php on line 2

     

    so make sure you fix that as it may be the problem.

  6. Try:

     

    <?php
    
    include ("hostinfo.php"); //removed the code starters and enders
    
    mysql_connect("$dbhost", "$dbuser", "$dbpass")or die("cannot connect");   
      
    mysql_select_db("$dbname")or die("cannot select DB");   
         
      
    $username=$_POST['username'];   
      
    $password=$_POST['password'];   
      
    $sql="SELECT * FROM $tbl WHERE username='$username' and password='$password'";   
      
    $result=mysql_query($sql);   
        
      
    $count=mysql_num_rows($sql);   //changed this line
         
      
    if($count==1){   
         
    session_start();   
    $_SESSION["logged"] = 1;   
    header("location:userspage.php");   
    }   
    else {   
    $_SESSION["logged"] = 0;   
    header("location:index.php");   
      
    }   
      
    ?> 

  7. It will slow down the site, it can't be helped, you code may have some areas to improve upon, but it will be slower using external pages. can't be helped.

  8. I suppose a mysql query could be used, and may be the easiest way of doing this, you can also put username, date made fields into this, and it would be make a search page easier if you plan to implement that.

     

    OR

     

    you could place all of the pages into a single directory and then use some file functions which i can never remember to list them into an array, which would have less functionality.

  9. 1) I do it that way.

     

    2) It's best to use htaccess if you know the number of varialbes that are going to be posted to each page, if not, you can have 2 /'s in the url. ie blahblah.com/egpagename/number-4434,change-yes/

     

    which will transfer to blahblah.com/?pagename=egpagename&vars=number-4434,change-yes

     

    which can be manipulated to form the normal URLs that you are using. I'll send you the script for htaccess if you're running apahce.

     

    3) I think it's by far the easiest. I don't know what you mean about the problem, please make it more clear.

  10. Try

     

    <?php $search = "SELECT * FROM photos WHERE weeks >= CAST('$today' AS DATE)"; ?>

     

    OR if it's only going to be todays date

     

    <?php $search = "SELECT * FROM photos WHERE weeks >= NOW()"; ?>

     

    You could also try to use

     

    <?php 
    
    $today = date("Y-m-d");
    
    $search = "SELECT * FROM photos WHERE weeks >= $today";
    $query = mysql_query($search) or die(mysql_error());
    
    $total = mysql_num_rows($query);
    
    	//if($total == 1) {
    		while ($row = mysql_fetch_assoc($query)) 
    		{	
    		echo "$row[photo]";
    		}
    				//	} ?>

     

    to see if there are more than 1 rows being returned.

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