Jump to content
Killersites Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About phpNOvice

  • Rank
  1. Hello killers, I have manage to create codes that could upload a image that is purposely to serve as profile picture of a certain student. My problem is how to rename it to aN AUTO COLLATE UNIQUE ID NUMBER so that i can display it specifically to a certain student account which bears the unique id number. The variable is $student_id. <?php session_start(); $session_id = $_SESSION['user_id']; if($session_id == null){ header("location:Student_Edit.php"); die(); } include 'Connect.php'; $flag = ""; $result = mysql_query("SELECT * FROM student_inform
  2. Hello Ben, i have solved the flag part but still the problem of uploading image is there even i have followed your advise in enctype="multipart/form-data" which i have missed also last time. I got brand new codes now and best thing is i got WARNING displayed. Kindly help me this out. <?php error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); session_start(); $session_id = $_SESSION['user_id']; if($session_id == null){ header("location:Student_Edit.php"); die(); } include 'Connect.php'; $flag = ""; $student_id = $_POST['student_id']; $first_name = $_POST['fi
  3. Hi there, i have recieved this notice Warning: Header may not contain more than a single header, new line detected in C:\xampp\htdocs\a\Student_Edit_Handler.php on line 53 and these are my codes. Kindly help me to fix this. <?php session_start(); $session_id = $_SESSION['user_id']; if($session_id == null){ header("location:Student_Edit.php"); die(); } include 'Connect.php'; $flag = "success"; function rollbackData(){ mysql_query(" ROLLBACK "); global $flag; $flag = "error"; if(mysql_error() != null){ die(mysql_error()); } } $student_id = $_POST['student
  4. These are my codes in the html <tr class="stylesmall"> <td>Update Learner Image: </td> <td colspan="3"><input type="file" name="image"> <span class="style3"> <span class="stylesmall">jpg or gif file only</span></span></td> </tr> <tr> <td colspan="4"><span class="stylered style6"><span class="style3">*</span> <em>fields are compulsory</em></span></td> </tr> <tr> <td colspan="4" align="center
  5. i have writen flags on theStudent_Edit.php. <?php if(!empty($_GET['flag']) && $_GET['flag'] == "success") { ?> <span class="stylered style1"><span class="style5">Learner Information updated successfully.</span></span> <?php } else if(!empty($_GET['flag']) && $_GET['flag'] == "error") { ?> <span class="stylered style3 style5"><span class="style1">Error while updating Learner Information. Please try again</span></span> <?php } ?> </td> the specific error im getting is the flag=e
  6. Hi Ben, i got new codes now that uploads the image of registered student with unique student_id. it is called Student_Edit_handler. This was in response to the idea you suggested. $student_id = $_POST['student_id']; $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $gender = $_POST['gender']; $date_of_birth = date("Y-m-d",strtotime($_POST['date_of_birth'])); $contact_no = $_POST['contact_no']; $grade = $_POST['grade']; $section = $_POST['section']; $LRN = $_POST['LRN']; $email1 = $_POST['email1']; $email2 = $_POST['email2'];
  7. ok got it ben,, i think i would accept your suggestion to keep registration process simple, that is always what im thinking all night long, thank you for confirming it. i'll work the codes now and put the adding of image on the Update profile. Please stand by Ben, i may need your help after this ;-)
  8. Yes Ben, I understand your codes in fact that is what i am using. Actually, this is still on the process when the student register themselves-Registration_handler.php'. I suppose in this instance the student_id is not yet created. This is the registration page where the student filled-up information including the uploading of their image.
  9. Sorry to bother you Ben, There has been slightly changes since i am also working in solving the scenario. here is now my current codes. if($_FILES['image']['name'] != ""){ $filename = $_FILES['image']['name']; $ext = strrchr($filename,"."); $imagename = $student_id; $imagename .="_". $filename; if($ext ==".jpg" || $ext ==".jpeg" || $ext ==".JPG" || $ext ==".JPEG" || $ext ==".gif" || $ext ==".GIF"){ $size = $_FILES['image']['size']; if($size > 0 && $size < 1000000){ $archive_dir = "images"; $userfile_tmp_name = $_FILES['image']['tmp_nam
  10. This is so far what i got Ben and i failed to rename the uploaded file to its $student_id. if($_FILES['image']['name'] != ""){ $filename = $_FILES['image']['name']; $ext = strrchr($filename,"."); $imagename = $student_id; $imagename .="_". $filename; if($ext ==".jpg" || $ext ==".jpeg" || $ext ==".JPG" || $ext ==".JPEG" || $ext ==".gif" || $ext ==".GIF"){ $size = $_FILES['image']['size']; if($size > 0 && $size < 1000000){ $archive_dir = "images"; $userfile_tmp_name = $_FILES['image']['tmp_name']; if(move_uploaded_file($userfile_tm
  11. Hello Admins and Php Freaks, I have manage to upload the image using this codes $student_id = $_POST['student_id']; $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $gender = $_POST['gender']; $date_of_birth = date("Y-m-d",strtotime($_POST['date_of_birth'])); $contact_no = $_POST['contact_no']; $grade = $_POST['grade']; $section = $_POST['section']; $LRN = $_POST['LRN']; $email1 = $_POST['email1']; $email2 = $_POST['email2']; $address = $_POST['address']; $description = $_POST['description']; $LRCardname= ""; $LRCard2name= ""; $query = "UPDATE
  12. Hello Ben, hahaha,, i am so dumb!! Why i haven't think of that....thank you for that hint Ben.. I solve it,,and for the benefit of those future reader on this thread. ill post the solution. $query = "UPDATE student_information SET learner_id='$learner_id',first_name='$first_name',last_name='$last_name',"; $query .= "gender='$gender',date_of_birth='$date_of_birth',contact_no='$contact_no',grade='$grade',section='$section',"; $query .= "LRN='$LRN',email1='$email1',email2='$email2',address='$address',description='$description'"; $query .= " WHERE student_id='{$_SESSIO
  • Create New...