Jump to content

suma237

Members
  • Posts

    282
  • Joined

  • Last visited

    Never

Posts posted by suma237

  1. <?php
    echo "
    
    <!DOCTYPE HTML>
    
    <html>
    
    <head>
    
    <meta name=\"author\" content=\"MontyTheWebmaster.com\" />
    <meta charset=\"ISO-8859-1\" />
    <meta http-equiv=\"refresh\" content=\"5;url='Login.php'\">
    
    <title>Admin Area</title>". spAdminLinks()."
    
    </head>
    
    <body>
    
    <div id=\"siteContainer\">
    
       <div id=\"topContainer\">
           
       </div>
    
          <div id=\"topMenuContainer\">
             <div id=\"topMenu\">
                 
             </div>
          </div>
    
       <div id=\"contentContainer\">
          
          <div id=\"mainContent\">
    
              <h1>Incorrect User Name or Password.</h1>
    
             <p>You will now be re-directed back to the login area to try again, or <a href=\"Login.php\">click here</a>.</p>
    
          </div>
    
          <div style=\"clear: both;\"></div>
          
       </div>
    
       <div id=\"footerContainer\">
    
         
    
       </div>
    
    </div>
    
    </body>
    
    </html>
    ";
    
    
    function spAdminLinks()
    {
    return "test";
    }
    ?>
    

  2. <?php
    $date = '31-01-2011';
    $beggin_hour = '13:30';
    $end_hour = '14:00';
    
    
    // Hours
    define("SECONDS_PER_HOUR", 60*60);
    	// Calculate timestamp
    	$start = strtotime($date." ".$beggin_hour);
    	$stop = strtotime($date." ".$end_hour);
    
    	// Diferences
    	$difference = $stop - $start;
    
    	// Hours
    	$hours = round($difference / SECONDS_PER_HOUR, 0, PHP_ROUND_HALF_DOWN);
    	#
    // Minutes
    
    $minutes = ($difference % SECONDS_PER_HOUR) / 60;
    
    echo $hours. ":" .$minutes;
    
    ?>
    

  3. //echo "previousfri would be 28/01/2011 and previousmon would be 24/01/2011.";
    $d = new DateTime();
    $weekday = $d->format('w');
    $diff = 7 + ($weekday == 0 ? 6 : $weekday - 1); // Monday=0, Sunday=6
    $d->modify("-$diff day");
    echo "previousmon". $d->format('Y-m-d') . ' - ';
    $d->modify('+4 day');
    echo "<br>previousfri". $d->format('Y-m-d');
    

  4. please refer this article

     

    http://php.net/manual/en/function.http-build-query.php

    <?php

    $post_url = '';

    foreach ($_POST AS $key=>$value)

        $post_url .= $key.'='.$value.'&';

    $post_url = rtrim($post_url, '&');

    ?>

     

    You can then use this to pass along POST data in CURL.

     

    <?php

        $ch = curl_init($some_url);

        curl_setopt($ch, CURLOPT_POST, true);

        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_url);

        curl_exec($ch);

    ?>

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