Jump to content

PhpTim

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PhpTim's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a login. When logged in for each page we will have 5 peoples of data for that user. Which would be a more effective approach. Scenario A Once someone logs in and 5 Sessions are set. Access the sessions from there on in. Scenario B Once someone logs in and 1 Session the GUID is set. Access the information from a select using the GUID. Things I am looking for is efficiency.
  2. Thank you again. I think I will mark this topic as solved. I have decided to start with file system.
  3. Thank you I really appreciate this ... So filesystem ... is there any security concerns not addressed within this script? upload form <html> <body> <form enctype="multipart/form-data" action="upload.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000" /> Choose a file to upload: <input name="uploaded_file" type="file" /> <input type="submit" value="Upload" /> </form> </body> </html> code <?php //Сheck that we have a file if((!empty($_FILES["uploaded_file"])) && ($_FILES['uploaded_file']['error'] == 0)) { //Check if the file is JPEG image and it's size is less than 350Kb $filename = basename($_FILES['uploaded_file']['name']); $ext = substr($filename, strrpos($filename, '.') + 1); if (($ext == "jpg") && ($_FILES["uploaded_file"]["type"] == "image/jpeg") && ($_FILES["uploaded_file"]["size"] < 350000)) { //Determine the path to which we want to save this file $newname = dirname(__FILE__).'/upload/'.$filename; //Check if the file with the same name is already exists on the server if (!file_exists($newname)) { //Attempt to move the uploaded file to it's new place if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'],$newname))) { echo "It's done! The file has been saved as: ".$newname; } else { echo "Error: A problem occurred during file upload!"; } } else { echo "Error: File ".$_FILES["uploaded_file"]["name"]." already exists"; } } else { echo "Error: Only .jpg images under 350Kb are accepted for upload"; } } else { echo "Error: No file uploaded"; } ?>
  4. Things wouldn't be so hard if you both didn't make such good arguments ha ha! See either are plausible ... I am fully able to create a new MySQL database and this could solely be used for the purpose of images if desired. Mind you I am not using this for all the images on the site. Only for managing users images. Out of interest I am slightly baffled on the process of extracting the images from the database and showing them on site. It would be for a listings page where 20 items could be listed with 1 image each. What drew me to liking the database method at the beginning of this post was the ease of keeping things tidy where a listing becomes redundant the image will also be removed ensuring efficiency in the long run.
  5. This has been turned out to be a decent post. Thanks to everyone who added to this post. I still haven't decided which method whether file system or database storage. I feel I am leaning to file system ... originally I was just worried about redundant images sitting on my server. but I think if I keep things really structured with good naming conventions I shouldn't have issues. I will let you guys know what I decide in the end.
  6. google analytics is decent. crazy egg offers free tracking for 4 pages. if you have the ability to install software on your server ... try webalizer. Personally I recommend google. ALOT of detail.
  7. I have the requirement to allow my users the ability to upload a file ... and attach the image to there profile. This is not something I am expeiranced in myself so I have security concerns. Researching on the internet I see some people have allowed a user to just upload an image on the filesystem. or some people seem to encode images and put them into the database. Anyone have any preferences? Or have any reason to perfer one over another?
  8. Certainly that would solve my problem. What has happened as I had this site dumped into my hands. I don't really want to have to repair someone elses failures. they have unwisely used sessions everywhere making the above suggestion such a pain and time consumer.
  9. Hi Everyone, Basically I have moved a website from a Linux based system Running PHP to a Windows based sytem with IIS 6 with PHP 5 isapi plugin. (Not my decision) Both version 5.2.3 My troubles lay with Sessions. session_start(); // Session not previously set if( $_SESSION['Sname'] != '' ){ //Condition } The above statement works on the linux box but fails on the windows box. with the error being: Notice: Undefined index: Sname and every session variable after that receives the error Notice: Undefined variable on the windows box I have the right permissions I believe set for the session files. I can even visually confirm the sessions files are being created. Any help would be appreciated as trying to fix this website would take too long (not written by myself trust me) Thanks in Advance
  10. Hi Everyone, I am currently running PHP 5. My goal is to be able to send email without it being constantly detected as spam. I have no requirements for attachments. HTML would be nice though. Does anyone have a working basic Php Emailer? that works with gmail, hotmail and yahoo? Sorry if this is abit vage. I can send emails using the 'mail' function. However it is always detected as spam 100% Thanks in advance, Tim
  11. Thank you very much ... tested it ... works ... TOPIC SOLVED
  12. Hi Everyone, I appreciate the time that you dedicate to my problem. I am working with a form <form name="form" ... etc When I submit the form it produces a form collection. which can be used via $_POST['<name of field>'] but what I am looking for is when I submit the form I get an array or list of the form fields. Does anyone know how to do this? I tried $var1 = $_POST; for($i = 0 ; $i < $var1; $i++) { echo "FieldName $i = ".$var1[$i]."<br />"; } with little results.
×
×
  • 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.