Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6567645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:21:43+00:00 2026-05-25T14:21:43+00:00

<?php class Baddriver{ // Constructor – open DB connection function __construct() { $this->db =

  • 0
<?php

class Baddriver{
// Constructor - open DB connection
function __construct() {
    $this->db = new mysqli("localhost", "root", "password", "dbname");
    $this->db->autocommit(FALSE);
}
 // Destructor - close DB connection
function __destruct() {
    $this->db->close();
}

// Main method to redeem a code
function bad() {
    if(isset($_POST["plakano"]) || isset($_POST["secim"]) || isset($_POST["sehir"])){
    $sehir=$_POST["sehir"];
    $plakano=$_POST["plakano"];  
    $aciklama=$_POST["aciklama"];
    $secim=$_POST["secim"];
    $plaka = str_replace(",","",$plakano); 

    $stmt = $this->db->prepare("INSERT INTO veri (plakano,aciklama,tarih,sehir,secim) VALUES (?, ?, CURDATE(),?,?)");
        $stmt->bind_param("ssss", $plakano,$aciklama,$sehir,$secim);
        $stmt->execute();
        $stmt->close();
        $this->db->commit();
    }
}

}

$api = new Baddriver;
$api->bad();
?>

This is my php file i search for 2 days now i understand 2 things first is i need to put

#!/usr/bin/php -q 

at the top (honestly don’t know why) and i need to connect to my webserver open the shell and write the cron code like

PATH=/usr/local/sbin:/usr/local/bin:/home/user1/bin
MAILTO=user1@nowhere.org,user2@somewhere.org
0 2 1-10 * * du -h --max-depth=1 /

is it all than cron will work or something that i am missing? thanks for patiance and time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:21:44+00:00Added an answer on May 25, 2026 at 2:21 pm

    #!/usr/bin/php -q tells your server that this script should be run with php.

    The cron code which you add to crontab will run your script at the specified intervals.

    But that’s not all. Your script uses $_POST, but you cannot post to a PHP script if you run it as a cron job. So those values won’t be available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one PHP class thus: class DB extends mysqli{ public function __construct( {
<?php class Box { var $contents; function Box($contents) { $this-&gt;contents = $contents; } function
I have this PHP class class myclass{ function name($val){ echo this is name method
class_1.php class class_1 { public function __construct() { require_once $_SERVER['DOCUMENT_ROOT'].'/array.php'; } } class_2.php class
I have following php class class User implements IUser { public function __construct($i_objParent =
I currently have my PHP class variables set up like this: class someThing {
I'm getting a Call to a member function process_data() on a non-object in page.class.php
I'm looking for a PHP library/function/class which can create Identicon s.
I have a PHP class with a static function: <? echo view::getUserSelector() ?> Which
I have this PHP class, whose purpose is to fetch some configuration data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.