Jump to content

php.ajax.coder

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Posts posted by php.ajax.coder

  1. I have got an install of opencart 1.5.1.3 which has been migrated to my remote host,

     

    All the configurations files have been altered to reflect the new host, all the file and folder permissions are set correctly 

     

    But it is not displaying the front end (it just returns a blank page no source at all), but the backend is working fine

     

    Has any one had a similar problem, or got any suggestions

     

    Thanks in advance

  2. Ran in to this problem a few days ago here's the code i use

     

    $time = the number of seconds

     

    <?php
             function format_time($time){
    	$seconds = $time % 60;
    	$time = ($time - $seconds) / 60;
    	$minutes = $time % 60;
    	$hours = ($time - $minutes) / 60;
    
    	//Format Number
    	return sprintf('%02d', $hours) . ":" . sprintf('%02d', $minutes) . ":" . sprintf('%02d', $seconds);
    }
    ?>
    

  3. I would think it is php working out the size of the image on the following line

     

    list($width,$height) = getimagesize($myimage);

     

    you could try setting the $width and $height to a constant here to see if it is indeed slowing down your script

     

    Not sure this really helps because I'm not sure of any other way of getting the size of the image dynamically.

  4. You need to change the following lines

     

    $vote = $_GET['votes'];

    if(isset($_POST['vote'])){

        echo "voted";

        echo $vote;

    }

     

    to

     

    if(isset($_POST['votes'])){

        $vote = $_POST['votes'];

        echo "Voted : " . $vote;

    }

     

    Haven't tested this but is should work

  5. I don't believe this is possible in php alone you'll need to use javascript or

    use a combination to reload the page or call a script (AJAX) at regular intervals thereby effectively

    giving you the count down effect.

     

     

  6. If you db login system is using sessions, then you should be able to read the session variable and determine if the user is logged in

     

    You will need to know the name of the session variable

     

    if($_SESSION['logged_in']){
         //Hidden information only logged in users see this
    }else{
         //Redirect to login page or display error
    }
    

  7. Views have the following benefits:

     

        * Security - Views can be made accessible to users while the underlying tables are not directly accessible. This allows the DBA to give users only the data they need, while protecting other data in the same table.

        * Simplicity - Views can be used to hide and reuse complex queries.

        * Column Name Simplication or Clarification - Views can be used to provide aliases on column names to make them more memorable and/or meaningful.

        * Stepping Stone - Views can provide a stepping stone in a "multi-level" query. For example, you could create a view of a query that counted the number of sales each salesperson had made. You could then query that view to group the sales people by the number of sales they had made.

     

     

    http://www.learn-sql-tutorial.com/Views.cfm

     

    Found this hopes it helps

  8. I need to have a which returns the number of words which don't start with A-Z

     

    SELECT COUNT(*) FROM Dictionary WHERE Word LIKE 'A%'

     

    Other than saying NOT 'A%' AND NOT 'B%' etc....

     

    is there a simple way of doing this

     

    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.