Jump to content

robcrozier

Members
  • Posts

    175
  • Joined

  • Last visited

    Never

Everything posted by robcrozier

  1. i just can't understand how to get PHP to treat a string (in the form of a time: HH:MM:SS) as a time var?
  2. OK, thanks for the reply Ken but im a bit of a novice when it comes to time functions in PHP. How would i process it with PHP strtotime() function. Also, i might mention that i would also like to convert some user input in the form of HH:MM:SS to a valid php time var so that i can compare etc.. cheers!
  3. Hi all, what im trying to do is add or take away one minute from a time which comes from a databes. what im currently doing is calling a 'datetime' field from the database and then using the explode() function to seperate the date and the time. once i am left with the time, how can i get PHP to treat it like a time and either add or remove one minute? I think i'm over complicating things at the minute! Any help would be great! Cheers!
  4. thanks for that. The system that i intend to create for the UNI project will be an online auction. Obviously not as large as eBay etc, though, because it's for UNI they expect me to address the issues (i.e. concurrency that larger online auction sites like eBay would face. This would also be based on the number of potential transactions that would take place if the proposed system were the size of eBay. Have you any idea how many transactions, as an average MySQL can handle and also how can the speed of the statements be increased etc? cheers!
  5. Hi all. OK, I'm doing a bit of a project for University at the minute and i need to address database concurrency as an issue. Basically what I'm trying to find out is - how concurrent is MySQL as standard (i.e. how many simultaneous transactions can it handle with ease?) and also how can it me made more concurrent? I've come across a few things while 'googling' the issue, like 'lock tables' for example however I'm not exactly sure how this works. If anyone can offer any help or useful links it would be much appreciated! thanks a lot!
  6. sorry about the wrong forum but that doesn't seem to work?
  7. HI all, i wonder if someone can help me with this. Im not very good with regular expressions but i would like to use the ereg() function to check for a date in this format: yyyy/mm/dd. any help appreciated! Cheers all!
  8. solved: (eregi("^[[:alnum:] ]{1,}$", $var))
  9. Hi all, i'm pretty new to the preg_match() function and what im simply trying to do it find out if a string contains only letters and numbers, nothing else! Here is what i have so far, tough it does not work: if (preg_match('/^[a-zA-Z0-9]+$/', $catagory)) { //OK } else { // NOT OK } Nay help would be appreciated, cheers!
  10. NO... there was no protection/filtering at all in this particular case
  11. No, not in this particular case i wasn't that's the problem. I usually prevent silly things like '(' or '$' signs within usernames and password etc... However like i say this time i wasn't. What i'm trying to find out is what sort of things to look out for and thus filter via PHP when users are inputting data via text boxes on the website.
  12. OK, i've got a mysql database set up on my server and someone once mentioned that it is possible to delete tables and even the whole database by using the text boxes on the web pages that are supposed to be there to enter data records into the database. They were right, someone has just deleted (dropped) my database this way! Im not sure what code they used obviously but i want to be able to prevent this in the future. Has this ever happened to anyone here and what did you do to stop it happening again? Cheers!
  13. sorry yes you are correct mail(). No the messages are not showing up at all??? I tried sending the same message to a Pipex supplied DSL account and it works fine, yet not to 'gmail' account??? Not in spam etc! The from: header is also configured as an appropriate and valid email address. HELP!
  14. Ho, i use the sendmail() function quite a bit and im having a few issues when receiving the emails. It seems like a couple of accounts do not receive the intended emails (for example 'gmail' and 'AOL' email accounts)??? Can anyone suggest a valid explanation for this, or have you came across the problems yourself? Any ideas on how to solve it? Cheers!
  15. OK what i have is a bunch of variables defined as follows: $m1 = $row3['machine1']; $m1t = $row3['machine1_taken']; $m1c = $row3['machine1_client']; $m2 = $row3['machine2']; $m2t = $row3['machine2_taken']; $m2c = $row3['machine2_client']; $m3 = $row3['machine3']; $m3t = $row3['machine3_taken']; $m3c = $row3['machine3_client']; $m4 = $row3['machine4']; $m4t = $row3['machine4_taken']; $m4c = $row3['machine4_client']; $m5 = $row3['machine5']; $m5t = $row3['machine5_taken']; $m5c = $row3['machine5_client']; These are just called from a database... no problems here. However... now what i want to do is use a loop in order to generate the number associated with each variable. For example the '3' in this variable '$m3'. This is just so i can first check if there's some data in the variable and then print out some data if there is. Here's the loop i have: for ($i = 1; $i < 6; $i ++) { if ($m[$i] != "") { echo "<td height='10%' align='right' valign='top' class='style11'>Machine [$i]:</td> <td>$m[$i]</td> <td height='10%' align='right' valign='top' class='style11'>Machine [$i] Taken:</td> <td>$m[$i]t</td> <td height='10%' align='right' valign='top' class='style11'>Machine [$i] - My percentage</td> <td>$m[$i]c</td>"; } else { //display nothing } } The problem is i just cant seem to get anything to print. What am i doing wrong? Can anyone help, cheers.
  16. Try: $password=md5($_POST['password']); Instead of: $password=md5($password); and then insert $password into database instead of $_POST[password]. Hope that works...
  17. Hi, thanks for that, but how will the page displaying the gif know if the file upload process has completed? Im thinking that i could display a small window on top of the main upload page which displays the gif, they can then see that the website is also still there. Cheers!
  18. Hi, i want to add a basic progress bar into my website when a user uploads an image. Just so they don't think that the website has died on them whilst the image is uploading. Can anyone help me with a very basic solution? Cheers!
  19. Hi all, i want to find a simple way of incorporating into my website the number of people which are currently viewing. I just want to be able to display a simple message saying "there are ??? people online". How can this be obtained using PHP, or does a database need to be used too? thanks!
  20. Hi, what im trying to do is allow a user to upload their pictures using an online GUI, however as the images are being uploaded and saved to the server i would like to reduce the file size some what. The reason for doing this is to save on download times and disc space alike. I know how to temporarily change the image size as the image file is actually being called, however this is not permanent and the image file size is never actually changed and thus disc space is not being saved. Does anyone have any suggestions about how i can do this? thanks a lot!
  21. SMASHING MATE! Thats done the trick! thanks a lot! :
  22. Unfortunately mate its on my localhost, the first line of image.php is <? however? here is exactly what i am doing: image.php <? ob_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <?php // The file $filename = $_GET['img']; $percent = 0.5; // Content type header('Content-type: image/jpeg'); // Get new dimensions list($width, $height) = getimagesize($filename); $new_width = $width * $percent; $new_height = $height * $percent; // Resample $image_p = imagecreatetruecolor($new_width, $new_height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); // Output imagejpeg($image_p, null, 100); ?> </body> </html> reduce_image.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <img src='image.php?img=banner.jpg' /> </body> </html>
  23. Hi mate, ive tried what you suggested however the outputted image will not display, as if im calling an image which is not on the server (the white square with the red cross inside)??? ive also tried moving the whole image file inside my images folder and calling it from there, not working! any suggestions?
  24. Hi, ok as far as im aware there is a method which enables you to reduce the file size of an image using PHP. This is obviously great for creating smaller sized, fast loading thumbnails of a larger image without having to manipulate the image yourself at all. Great for people who dont really know anything about image manipulation too! Ok then so my question is: "Does anyone know how this is done!?" Or can anyone suggest a better way to do this without having to manipulate the image yourself and then upload it to the server before it can be accessed. cheers!
×
×
  • 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.