Jump to content

Chikwado

Members
  • Posts

    287
  • Joined

  • Last visited

About Chikwado

  • Birthday 05/27/1987

Profile Information

  • Gender
    Male
  • Location
    Nigeria

Recent Profile Visitors

13,922 profile views

Chikwado's Achievements

Member

Member (2/7)

3

Reputation

  1. Good day admin Please a newbie is struggling here and needed a help. <?php $db = new SQLite3('test.db'); $userlog = "Chikwado"; $userpass = "wizard&33"; $sql = "SELECT * FROM user WHERE username = '$userlog' AND password = '$userpass' LIMIT = 1"; $result = $db->query($sql); while ($row = $result->fetchArray(SQLITE3_ASSOC)){ if($row['username'] === $userlog && $row['password'] === $userpass) { echo "Login was successfully."; }else{ echo "Invalid credentials."; } } unset($db); ?> To run the code above, I get http code failure. I need help and advice. Your advice is greatly appreciated.
  2. SELECT * FROM table WHERE id = '1' AND firstname = 'Smith'
  3. Good day administrator Please how to rotate image on my website, that is, each time I refresh the page it display new image. Below are my JavaScript so far. [code] <html> <head> <script> var photo = ["image/image1.jpg","image/image2.jpg","image/image3.jpg"]; var i = Math.floor(photo.length*Math.random()); document.getElementById("show").src = photo[i]; </script> </head> <body> <img id="show" src="" alt="Image"> </body> </html> [/code] <html> Thanks.
  4. Good day admin. Please where can I find w3schools APK file that I installed in my Android phone some time ago, the APK just disappeard and could not be seen any where. I would like to read offline to manage high-cost of data. Any information about that offline installation is greatly welcome. Thank in advance.
  5. Someone help with better explanations on code below. I want to test uploading picture in database using the script below. The code is not showing success or error and I'm unable to figure out what to do. [code] <html> <head> <?php $servername = "server"; $username = "username"; $password = "passme"; $dbname = "mydb"; $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } if(isset($_POST["submit"])) { $name = $_FILES["fileupload"]["name"]; $username = $_POST["username"]; $text = $_POST["textdata"]; $target_dir = "upload/"; $target_file = $target_dir . basename($_FILES["fileupload"]["temp_name"]); // Select file type $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); // Valid file extensions $extensions_arr = array("jpg","jpeg","png","gif"); // Check extension if( in_array($imageFileType,$extensions_arr) ){ // Upload file if(move_uploaded_file($_FILES['fileupload']["name"],$target_dir.$name)){ // Convert to base64 $image_base64 = base64_encode(file_get_contents('upload/'.$name) ); $image = 'data:image/'.$imageFileType.';base64,'.$image_base64; // prepare and bind $stmt = $conn->prepare("INSERT INTO messagebox (image, username, reg_date, text) VALUES (?, ?, ?, ?)"); $stmt->bind_param("ssss", $image, $username, NOW(), $text); $stmt->execute(); echo "<>Success!"; $stmt->close(); $conn->close(); } } } ?> </body> </html> [/code]
  6. How to use while looping, to access element in array in c++.
  7. Just like we use ajax to navigate XML, Then, Is it possible to navigate JSON as well? Example of the xml are here
  8. I have just heard the word "Polymorphism" And I discovered that it is javascript, but do not know how to apply it.I am wondering if this could be part of it example
  9. What is javascript polymorphism?
  10. While creating javascript source file, Is it possible to add two file in one script. example: Js file
  11. Chikwado

    Need a cue

    Oh my goodness, I have not so far seen it. Thanks.
  12. Chikwado

    Need a cue

    Some one help with a cue. I don't understand what this properties really does. The first example was clear to me but the second example was not. Can you explain more.
  13. I did not, Is it available anywhere for installing?
×
×
  • Create New...