Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About baxt01

  • Rank
  • Birthday 07/03/1980

Previous Fields

  • Languages

Contact Methods

  • MSN
  • Skype

Profile Information

  • Location
  1. spot on I was trying to do it after the SELECT statement using PHP lol
  2. Hi I have been working on building a custom post a result set to a database which thankfully I have now managed with some help, now I am working on the other end of this project the displaying the saved data back to users, From the start of this I have an online tournament hosting group that go to my form and post a list of player names with points earned per tournament. Once the form is submitted it's sent to my form_processing.php where the results are exploded and split into 2 arrays "$player_name, $points" Then on the INSERT I have an INSERT $sql = "INSERT into `bg_points` (`player_
  3. <?php error_reporting(E_ALL); ini_set("display_errors",1); include_once 'db_connect.php'; include_once 'functions.php'; sec_session_start(); // Our custom secure way of starting a PHP session. if (isset($_POST['email'], $_POST['p'])) { $email = $_POST['email']; $password = $_POST['p']; // The hashed password. if (login($email, $password, $mysqli) == true) { // Login success header('Location: ../protected_page.php'); } else { // Login failed header('Location: ../index.php?error=1'); } } else { // The correct POST variables were
  4. yes that's exactly it I had not noticed it before but INT is the default field setting in phpmyadmin left myself feel a little silly on this one but hey hoe its all working I can now go on to look at the next step in this project thanks very much I see you said the html is not right yes I know I leaves plenty to be worked on I just threw the basics codes in to make the pages display what I wanted I have to actually merge 2 pages now into a final result its a kind of point keeping sys I'm making so I want to add the form input field onto the same page as my out put narea and I want to cha
  5. <?php 2.error_reporting(E_ALL); 3.ini_set("display_errors",1); 4. 5. if (isset($_POST['submit'] ) ) { 6. $host_name = "localhost"; 7. $database = "DB name"; 8. $user_name = "user name"; 9. $password = "my p/w"; 10. 11. $db = mysqli_connect( $host_name, $user_name, $password, $database ); 12. 13. if (!$db) 14. { 15. die("ERROR please try reloading or email mike@mnvb.co.uk: " . mysql_error()); 16. } 17. 18. // example of inserting data into that table: 19. $sql =
  6. /* index.php */ <html> <head> <title>Puddins's Page</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body background ="/puddin/files/BG_image.jpg"> <?PHP // open this directory $myDirectory = opendir("./files"); // get each entry while($entryName = readdir($myDirectory)) { $dirArray[] = $entryName; } // close directory closedir($myDirectory); // count elements in array $indexCount = count($dirArray); Print ("$indexCount files<br>\n"); // sort 'em sort($dirArray); // print 'em print("<TABLE border=1 cellpa
  7. <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual image or fake image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; } } ?> I have been working through the w3school tutorial on file upload but t
  8. ok with a busy weekend with the kids I have now had the chance to sit and work out what was wrong in my coding and it is working again ( well kind of ) my page now loads again the form is there showing signs of validation presence on submit although the validation is showing up it is still posting data to my DB even if the content is not valid the odes say if field * is empty give error message but I can not work out how to make the code end or stop when there is an error I was wondering would something like: if ( ! $fname->valid() ) { die("field First Name in
  9. Ok i think i just seen some errors with how i have laid my codes out meaning it will not work as i have changed the variable names while the code validates so the stm call is now invalid also the section where i call the post values in the db conect code is still trying to call the orignal post values not the validated version so it becomes pointless * sigh * i will look when i get home from work i cant edit code from the iphone lol
  10. HAHAHAHA that is just too funny! after my last comment to you as I said it should have been a easy fix problem well maybe for anyone else in the world perhaps............ I went to my codes figured I do not need to make a back up seen as I am not changing my codes im just re arranging them so I did it live I went onto my server and used copy and paste to re organise the codes so that my DB connect was at the end and my form was at the start leaving the validation codes in the middle sounds ok so far so I saved the work and loaded the page and well im now getting HTTP 500 internal server
  11. yes this is one of them moments where im sat here feeling rather stupid, that moment where I have had a nights sleep and come back to it and read your comment looked down my codes thinking OMG what was I thinking coding is always set out by logical argument order of execution and I told the code to post form data to DB before I validate the $_POSt data that should be an easy fix then
  12. right at the literal beginning 1. open code tag 2. and 3. error checking 4. - 15 if isset setting up connection and test 18 - 19 insert values MySQL comand
  13. that was the missing line yep that was everything I needed right there LOL ok seriously though that just took me around 30 - 40 minutes of re - ordering spell checking AND finally that whole code does execute pretty perfectly! we have only 2 more things to ask of anyone who can help lol just looking at my TEST + Err system there is not any line there to tell the code to end before posting the incorrect data to my DB in my code it has a double IF check on the same field of the form first IF empty msg required field secondly c
  14. i hear ya on the ssss I only added that error on here to show what was been thrown back but had already corrected as I fell into deep zzzZZZZZZ land tehe anyhow now is a fresh day bring yet another new set of errors and more mud to throw at my mental fan now the line issue is fixed with the array not having enough sss in i re mention the error researched on stack overflow above, from what I read this issue is way beyond my control on my server the PHP and MySQL versions and install are down to my system admin its not something I can change from my control panel I can view config data but
  15. after I read your post I had to give myself a slap for not adding that error checking as I have been told about it before hey hoe its 2 am here lol ok so I added the error checking and corrected the silly typos and my form re appeared leaving these 2 error messages Warning: mysqli_connect(): Headers and client library minor version mismatch. Headers:50540 Library:100016 in /home/mnvbcou1/public_html/index1.php on line 9Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables in /home/mnvbcou1/public_html/index1.php on line
  • Create New...