Jump to content

9911782

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

9911782's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi Can somebody please help me by showing me the step-by-step on how store procedure works? Thanks
  2. Hi vbnullchar thanks, but we just need someone to guide us through give us basics. I have new pool of programmers from Tech.
  3. send me your code please.. thanks
  4. I am based in Cape Town. Can somebody help me. I need an institution that provides PHP course - Model view Controller & Classes. I would like to improve my web development standards. I am desparately looking for that Training Institution that provides that course. Thank You
  5. Just need logic for doing this.Im desparate really. When do I register these trasanction to DB. Can you please expand for me please.
  6. Thank you John. I will try and once im stacked will let you know. I appreciate your help on this BIG TIME! thanks D
  7. Hi I would like you to help me here, now sure if this should go under PHP Help or MySQL Help... I need help regarding Audit Trail. Im expected to do An audit trail that must be kept of access to the system as well as of all create and update transactions to the database. This implies the details of the relevant person(s) who transacted as well as time and date of transactions. This does not apply to the load process – only to the user intervention in the system. Can somebody run me through the steps I should take to do this for my application. Thanks D
  8. I just wanted to thenk you all for your help.
  9. Hi I need help please... I've created a MySQL database. Capturing the data per financial year. Every year when the date is 1st April 2008, I want the autonumber to start at 1 again. How do i do that in MySQL. Thank you S
  10. Hi HaLo2FrEeEk I dont understand you now. Because the code I posted here is the very same post that is giving me the errors I posted.Here is the Code: Here is My code: ================== <?php //@Language=VBScript?> <?php include("../Connections/fetwebsite.php"); if($_REQUEST["enter"]=="yes" ){ include("../connections/fetwebsite.php"); $sql="select MAX(ImageID) as maximageid from galleryImages"; //execute sql statements $rsUsers = mysql_query($sql, $fetcolleges) or die(mysql_error()); $rows_rsUsers = mysql_fetch_assoc($rsUsers); $total_num_Users = mysql_num_rows($rsUsers); $maximageid = $rows_rsUsers['maximageid']; $GalleryID = $_REQUEST['GalleryID']; $ImageID=$_REQUEST["ImageID"]; $Caption = $_POST["caption"]; $GalleryID = $_POST['GalleryID']; $ImageStatus = $_POST['ImageStatus']; $ImageFull = $_FILES['ImageFull']['ImageFull']; $tmpNameFull = $_FILES['ImageFull']['tmp_name']; $ImageThumb = $_FILES['ImageThumb']['ImageThumb']; $tmpNameThumb = $_FILES['ImageThumb']['tmp_name']; $fileName = $_FILES['ImageThumb']['name']; $tmpName = $_FILES['ImageThumb']['tmp_name']; $tmpName2 = $_FILES['ImageThumb']['tmp_name']; $file_size = $_FILES['ImageThumb']['size']; $fileType = $_FILES['ImageThumb']['type']; $DateAdded=date("Y/m/d H:i:s"); // you can change this to any directory you want // as long as php can write to it $uploadDir = '../photogalleries/'; //$DefaultPasswords['program'] = crypt('program'); // the files will be saved in filePath /// $filePath = $uploadDir . $fileName; $maximageid = $maximageid + 1; $ImageThumb = "thumb"."_".$maximageid."."."jpg"; $ImageFull = "photo"."_".$maximageid."."."jpg"; $filePath = $uploadDir . $fileName; $filePath2 = $uploadDir . $ImageThumb; $filePath3 = $uploadDir . $ImageFull; ///RESIZE THUMBNAIL/// // Set a maximum height and width $width = 115; $height = 147; // Get new dimensions list($width_orig, $height_orig) = getimagesize($filePath); $ratio_orig = $width_orig/$height_orig; if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } // Resample $image_p = imagecreatetruecolor($width, $height); $image = @imagecreatefromjpeg($filePath); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output $thumbsize = imagejpeg($image_p, null, 100); $thumbsize; if (function_exists('imagecreatefromjpeg') || function_exists('imagecreatetruecolor') || function_exists('imagecopyresampled') || function_exists('getimagesize')) { echo 'OK, you already have GD library installed'; } else { echo 'Sorry, it seem that GD library is not installed/enabled'; } ///END RESIZE THUMBNAIL/// // move the files to the specified directory // if the upload directory is not writable or // something else went wrong $result will be false //$result = move_uploaded_file($tmpName, $filePath); $result1 = move_uploaded_file($tmpNameThumb, $filePath3); $result2 = move_uploaded_file($tmpNameFull, $filePath2); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } $uploadDir = '../photogalleries/$fileName'; $sql="INSERT INTO galleryImages(Caption,GalleryID, ImageStatus, name,size, type, path,DateAdded,ImageThumb,ImageFull) values ('$Caption','".$_REQUEST['GalleryID']."','$ImageStatus','$fileName', '$file_size', '$fileType', '$filePath','$DateAdded','$ImageThumb','$ImageFull')"; $execute = mysql_query($sql, $fetcolleges) or die(mysql_error()); if($execute){ mysql_close($fetcolleges); //header("Location: galleryImages_setup.php"); } } ?> ================== Can you explain more about what you mean?
  11. Hi Lumio I did use those board serached, but im still getting the errors. I have used the code provided in this forum, but still getting the same errors. Can u perhaps, explain to me what does above errors means? Ps Lumio help me. thank you
  12. Hi I've been trying to Uploading Images/create Thumbnails to insert into my DB. I get so many errors when running this code. Here is My code: ================== <?php //@Language=VBScript?> <?php include("../Connections/fetwebsite.php"); if($_REQUEST["enter"]=="yes" ){ include("../connections/fetwebsite.php"); $sql="select MAX(ImageID) as maximageid from galleryImages"; //execute sql statements $rsUsers = mysql_query($sql, $fetcolleges) or die(mysql_error()); $rows_rsUsers = mysql_fetch_assoc($rsUsers); $total_num_Users = mysql_num_rows($rsUsers); $maximageid = $rows_rsUsers['maximageid']; $GalleryID = $_REQUEST['GalleryID']; $ImageID=$_REQUEST["ImageID"]; $Caption = $_POST["caption"]; $GalleryID = $_POST['GalleryID']; $ImageStatus = $_POST['ImageStatus']; $ImageFull = $_FILES['ImageFull']['ImageFull']; $tmpNameFull = $_FILES['ImageFull']['tmp_name']; $ImageThumb = $_FILES['ImageThumb']['ImageThumb']; $tmpNameThumb = $_FILES['ImageThumb']['tmp_name']; $fileName = $_FILES['ImageThumb']['name']; $tmpName = $_FILES['ImageThumb']['tmp_name']; $tmpName2 = $_FILES['ImageThumb']['tmp_name']; $file_size = $_FILES['ImageThumb']['size']; $fileType = $_FILES['ImageThumb']['type']; $DateAdded=date("Y/m/d H:i:s"); // you can change this to any directory you want // as long as php can write to it $uploadDir = '../photogalleries/'; //$DefaultPasswords['program'] = crypt('program'); // the files will be saved in filePath /// $filePath = $uploadDir . $fileName; $maximageid = $maximageid + 1; $ImageThumb = "thumb"."_".$maximageid."."."jpg"; $ImageFull = "photo"."_".$maximageid."."."jpg"; $filePath = $uploadDir . $fileName; $filePath2 = $uploadDir . $ImageThumb; $filePath3 = $uploadDir . $ImageFull; ///RESIZE THUMBNAIL/// // Set a maximum height and width $width = 115; $height = 147; // Get new dimensions list($width_orig, $height_orig) = getimagesize($filePath); $ratio_orig = $width_orig/$height_orig; if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } // Resample $image_p = imagecreatetruecolor($width, $height); $image = @imagecreatefromjpeg($filePath); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output $thumbsize = imagejpeg($image_p, null, 100); $thumbsize; if (function_exists('imagecreatefromjpeg') || function_exists('imagecreatetruecolor') || function_exists('imagecopyresampled') || function_exists('getimagesize')) { echo 'OK, you already have GD library installed'; } else { echo 'Sorry, it seem that GD library is not installed/enabled'; } ///END RESIZE THUMBNAIL/// // move the files to the specified directory // if the upload directory is not writable or // something else went wrong $result will be false //$result = move_uploaded_file($tmpName, $filePath); $result1 = move_uploaded_file($tmpNameThumb, $filePath3); $result2 = move_uploaded_file($tmpNameFull, $filePath2); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } $uploadDir = '../photogalleries/$fileName'; $sql="INSERT INTO galleryImages(Caption,GalleryID, ImageStatus, name,size, type, path,DateAdded,ImageThumb,ImageFull) values ('$Caption','".$_REQUEST['GalleryID']."','$ImageStatus','$fileName', '$file_size', '$fileType', '$filePath','$DateAdded','$ImageThumb','$ImageFull')"; $execute = mysql_query($sql, $fetcolleges) or die(mysql_error()); if($execute){ mysql_close($fetcolleges); //header("Location: galleryImages_setup.php"); } } ?> ================== These are the errors I get: ======= Warning: getimagesize(../photogalleries/darkie_02.jpg) [function.getimagesize]: failed to open stream: No such file or directory in C:\Program Files\Business Objects\ThirdParties\apache\htdocs\fetcolleges\admin\galleryImages_upload.php on line 68 Warning: Division by zero in C:\Program Files\Business Objects\ThirdParties\apache\htdocs\fetcolleges\admin\galleryImages_upload.php on line 70 Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in C:\Program Files\Business Objects\ThirdParties\apache\htdocs\fetcolleges\admin\galleryImages_upload.php on line 78 Warning: imagecopyresampled(): supplied argument is not a valid Image resource in C:\Program Files\Business Objects\ThirdParties\apache\htdocs\fetcolleges\admin\galleryImages_upload.php on line 80 Warning: imagejpeg(): supplied argument is not a valid Image resource in C:\Program Files\Business Objects\ThirdParties\apache\htdocs\fetcolleges\admin\galleryImages_upload.php on line 83 ============ I have GD library installed, and check the php.ini all is well, but still getting this erros. I dont know what to do now. Ps help me!
  13. thank you for your response. I will go and test it now.
  14. Hi All Can somebody ps send me the php script that could help me to be able to kick out(time-out) users out of the page once they dont take the action for 5mins. _________________ Thank you for your Help 9911782
  15. Hi bqallover Thank you very much for ur quick response. I have manage to get the code http://www.plus2net.com, but Im still faced with small problems. According to you tips. I have done these: 1. Storing the login information in a table called active_users_online username,userid, session,time logged in, username, and status(ON/Off). 2. Updating the status of the member, where I have the status stored in in active_users_online where I have set the status to ON by defualt. Now I have to update this status to ON and update the new time (field name tm) on every time the member opens inside the member area. 3. When click logged out, change the system status to OFF and destroy the session. I have the problem with this part because when click logout, now the status doesnt change to status="off". 4. Then I display who are active at site. Which is where my problem is, because it only shows the 1st user even though I loop them. here is my code: ---------------------------------------------------------------------- <?php $session=session_id(); $time=time(); $time_check=$time-600; //SET TIME 10 Minute //open connection to the database require_once('inc_conn.php'); // prepare query $sql="SELECT * FROM active_users_online WHERE session = '".$session."'"; //execute sql statements $sessions = mysql_query($sql, $connwmis) or die(mysql_error()); //retrieve one row of records $rows_sessions = mysql_fetch_array($sessions); //determine the number of records in recordset $num_rows = mysql_num_rows($sessions); if($num_rows=="0"){ $time=date("y-m-d"); $sql1="INSERT INTO active_users_online(session, timestamp,username,ip)VALUES('$session', '$time','".$_SESSION['svusername']."','".$_SESSION['svip']."')"; $result1 = mysql_query($sql1, $connwmis) or die(mysql_error()); } else { $time=date("y-m-d"); $sql2="UPDATE active_users_online SET timestamp='$time', status='ON' WHERE session = '$session'"; $result2 = mysql_query($sql2, $connwmis) or die(mysql_error()); } $sql3 = "SELECT * FROM  active_users_online"; $result3 = mysql_query($sql3, $connwmis) or die(mysql_error()); $count_user_online=mysql_num_rows($result3); // if over 10 minute, delete session $sql4 = "DELETE FROM active_users_online WHERE timestamp < $time_check"; $result4=mysql_query($sql4, $connwmis) or die(mysql_error()); mysql_close(); // Open multiple browser page for result ?> ------------------------------------------------------------------ Here is the code for Displaying active users at site: -------------------------------------------------- <?php //open connection to the database require_once('inc_conn.php'); // prepare query $sql="SELECT * FROM active_users_online"; //execute sql statements $sessions = mysql_query($sql, $connwmis) or die(mysql_error()); //retrieve one row of records $rows_sessions = mysql_fetch_array($sessions); //determine the number of records in recordset $num_rows = mysql_num_rows($sessions); ?> <?php require_once('inc_conn.php'); $gap=10; // Gap value can be changed, this is in minutes. // let us find out the time before 10 minutes of present time. // $time=date ("Y-m-d H:i:s", mktime (date("H"),date("i")-$gap,date("s"),date("m"),date("d"),date("Y"))); $ut=mysql_query("update active_users_online set status='OFF' where timestamp < '$time'"); $ro = mysql_query("SELECT username,timestamp FROM active_users_online where timestamp > '$time' and status='ON'");   $active = mysql_num_rows($ro); // sets $active as the number of active users     echo "Logged users: <b>".$rows_sessions['username']."</b><br>"; // lists the username of active users   echo "Last Logged: <b>".$rows_sessions['timestamp']."</b><br>"; // lists the number of active users ?> </td> </tr> <tr> <td><?php // Actually lists the users   do { $name = $rows_sessions['username']; // Sets $name as the users' names $i= 0; // Lists the users names if ($i != ($num_rows - 1)) { // if $i doesn't equal $active minus 1   echo "<b>".$name." | "; } else { echo "<b>".$name."</b>"; } $i++; // increase temp variable } while ($rows_sessions = mysql_fetch_array($sessions)) ?></td> </tr> -------------------------------------------------- Something is wrong, I dont know. Can somebody help me please????
×
×
  • 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.