Jump to content

flipper828

Members
  • Posts

    28
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

flipper828's Achievements

Member

Member (2/5)

0

Reputation

  1. Thank you for analyzing for me. It looks like I have a lot more to learn. I'm off to research the things you mentioned.
  2. Hello, I have the following upload script that actually worked until I tried to add file type specifications. I can't figure out what I did wrong. I have been piecing things together so there is no telling what is wrong. Help me please? <?php $fileName = $_FILES["file1"]["name"]; // The file name $fileTmpLoc = $_FILES["file1"]["tmp_name"]; // File in the PHP tmp folder $fileType = $_FILES["file1"]["type"]; // The type of file it is $fileSize = $_FILES["file1"]["size"]; // File size in bytes $fileErrorMsg = $_FILES["file1"]["error"]; // 0 for false... and 1 for true if (!$fileTmpLoc) { // if file not chosen echo "ERROR: Please browse for a file before clicking the upload button."; exit(); } if ($fileType=="image/png" || $fileType=="image/gif" || $fileType=="image/jpg") // checking file type echo "ERROR: Only file types .png, .gif or .jpg may be uploaded"; exit(); } if(move_uploaded_file($fileTmpLoc, "image_uploads/$fileName")){ echo "$fileName upload is complete"; } else { echo "move_uploaded_file function failed"; } ?> Thanks.
  3. Thank you gizmola. If I understand this properly. I should use the php upload script to get the file uploaded and then use the move_uploaded_file to move them to the proper directories?
  4. Hello again, Pros! I need an advisory jump start so I don't have any code or examples to show. And I am not asking for any code. Just advise on the best possible way to proceed with my project.. PROJECT : I am trying to build a system that will allow me to upload video files to several different categories within several different categories etc. Boy...that sounds confusing already. First let me start by saying the video files are home recordings of reviews for my whole family's use and are not illegal in any way at all. This is what I want to be able to do: I have video files that fit into several different states (3). Within the first state I have 2 cities - within the second state I have 5 cities - and in the third state I have 1 city. Within all the cities are 5 different categories. I want to be able to upload them like so..... State1 | City1 | Category1 | video lands here. State1 | City1 | Category4 | video lands here. I am familiar with the php video upload script but from everything I have read, it will only upload to one directory. I don't know how to go about getting the videos into the correct directory. I thought about using a database driven drop down menu with an upload script for each state, city, category. I am willing to setup all the directories and scripts do this if its the best way but before I spend hours and hours testing all this, I thought I would check with you experts first. Is there a better way than what I am thinking? Thanks again in advance for your time and patience with me. CR
  5. Thank you, Pyscho. I actually learned that time out script from an intro to php class. I just assumed it was correct. Shame on me for assuming!!! Your answer seems a lot easier than what i'm doing now. So now I will do some research on how to configure a time out on the server. Thank you again.
  6. Hello Pros! I have set up a secure login page. Here's what I need: When a user times out and then refreshes the page, I want the system to take them back to a login page within the formatting and styling I have set for the rest of the website. My problem: One page works exactly as I want it to work. However, every other page displays the page with just my header and footer and the message I have set up in the session check. I hope I am describing this correctly. Here is the time out script on the top of my index.php. I have the time set to 5 minutes for testing purposes. I will lengthen this after I get it to work properly. <?php session_start(); ?> <?php if (isset($_SESSION['time'])) { $current = strtotime(date("Y-m-d H:i:s")); $login = $_SESSION['time']; $active = $current - $login; if ($active > 300) { unset($_SESSION['time']); unset($_SESSION['flusers']); } } else { $_SESSION['time'] = strtotime(date("Y-m-d H:i:s")); } ?> Here is the page that works properly. In other words, after the time out, the user is directed back to the login page. <?php if (!isset($_SESSION['lnusers'])) { echo "<h2>Sorry, you have not logged into the system</h2>\n"; echo "<a href=\"index.php\">Please login</a>\n"; } else { echo "<div id=\"wrapper\"> <div id=\"ccontent\"> <div id=\"cleftcolumn\"> <p>RESOURCE<br />CENTER</p> <br /> <br /><br /> <table width=\"100%\" cellpadding=\"3\"> <tr> <td> <h3 style=\"color:#042252;\">Welcome! </h3> <br /> <br /> </td> </tr> <tr><td><strong><a href=\"index.php?content=main\">Resource Center Home</a></strong></td></tr> <tr><td><a href=\"index.php?content=contactus\"><strong>Contact Us</strong></font></a></td></tr> <tr><td><a href=\"index.php?content=holidayschedule\"><strong>Holiday Schedule</strong></font></a></td></tr> <tr><td><a href=\"index.php?content=verdochome\"><strong>Lincoln Documents</strong></font></a></td></tr> <tr><td><a href=\"index.php?content=ugitems\"><strong>Lincoln Group Items Board</strong></font></a></td></tr> <tr><td><a href=\"index.php?content=lnnews\"><strong>Lincoln Group News Listing<strong></a></td></tr> </table> </div> <div id=\"crscrollArea\">\n"; $loginid = $_SESSION['flusers']; $query = "SELECT name FROM lnusers WHERE loginid = '$loginid'"; $result=mysql_query($query); $row=mysql_fetch_array($result, MYSQL_ASSOC); $name = $row['name']; echo "<h2>Welcome, $name</h2><br />\n"; $date = date("l, F j, Y"); echo "<h2>Today's date: $date</h2><br />\n"; echo "<table width=\"100%\" border=\"0\"> <tr> <td><hr size=\"1\" noshade=\"noshade\"></td> </tr> <tr> <td><h4>Breaking News!</h4><br /></td> </tr> <tr> <td> <a style=\"font-size:10pt; color:#042252;\" href=\"index.php?content=newsItems/Lincoln\">Licoln</a></p><br /> </td> </tr> <tr> <td> <a style=\"font-size:10pt; color:#042252;\" href=\"index.php?content=newsItems/socialupdate\">Social Update</a></p><br /> </td> </tr> </table> </div> </div> </div>\n"; } ?> And here is the page that will not behave. For some reason, after this page times out and the page is refreshed, it throws out all the formatting and styles and displays "Sorry, you have not logged into the system". "Please login" is a link that leads back to the login page. <?php if (!isset($_SESSION['lnusers'])) { echo "<h2>Sorry, you have not logged into the system</h2>\n"; echo "<a href=\"index.php\">Please login</a>\n"; } else { echo "<div id=\"wrapper\"> <div id=\"ccontent\"> <div id=\"cleftcolumn\"> <p>RESOURCE<br />CENTER</p> <br /> <br /><br /> <table width=\"100%\" cellpadding=\"3\"> <tr> <td> <h3 style=\"color:#042252;\">Welcome! </h3> <br /> <br /> </td> </tr> <tr><td><strong><a href=\"index.php?content=main\">Resource Center Home</a></strong></td></tr> <tr><td><a href=\"index.php?content=contactus\"><strong>Contact Us</strong></font></a></td></tr> <tr><td><a href=\"index.php?content=holidayschedule\"><strong>Holiday Schedule</strong></font></a></td></tr> <tr><td><a href=\"index.php?content=verdochome\"><strong>Lincoln Documents</strong></font></a></td></tr> <tr><td><a href=\"index.php?content=ugitems\"><strong>Lincoln Group Items Board</strong></font></a></td></tr> <tr><td><a href=\"index.php?content=lnnews\"><strong>Lincoln Group News Listing<strong></a></td></tr> </table> </div> <div id=\"crscrollArea\"> <p><span style=\"color:#9C2431;font-size:16px;\"><strong>Holiday Schedule</strong></span></p><br /><br /> <table width=\"100%\" cellpadding=\"1\"> <td> </td> </tr> <tr> <td><p>New Years</p></td> <td><p>Tuesday December 31, 2013 & Wednesday January 1, 2014</p></td> </tr> <tr> <td><p>President's Day</p></td> <td><p>Monday, February 17, 2014</p></td> </tr> <tr> <td><p>Memorial Day</p></td> <td><p>Monday, May 26, 2014</p></td> </tr> <tr> <td><p>Independence Day</p></td> <td><p>Friday, July 4, 2014</p></td> </tr> <tr> <td><p>Labor Day</p></td> <td><p>Monday, September 1, 2014</p></td> </tr> <tr> <td><p>Thanksgiving</p></td> <td><p>Thursday & Friday, November 27 & 28, 2014</p></td> </tr> <tr> <td><p>Christmas</p></td> <td><p>Wednesday, Thursday & Friday December 24, 25 & 26, 2014</p></td> </tr> <tr> <td><p>New Year's</p></td> <td><p>Wednesday December 31, 2013 & Thursday January 1, 2015</p></td> </tr> </table> </div> </div> </div>\n"; } ?> If you need anything else, let me know. Thank you for you time and expertise ahead of time. flipper828
  7. Thank you so much Kicken and AbraCadaver for your generosity! Surprise....I've not hear of mt_rand and mt_srand in my research and studies. Thank you for the links. I want to go back and study these soon.
  8. Oh thank you so much everyone! I'm off to try this and I'll be back. You people have always been to nice and kind!
  9. The number does not have to be accurate to the number of changes to a data point spreadsheet I have available each day. However, that IS a future project. For now, I just want a different number to display each day which is linked to a .pdf which explains the data points on the spreadsheet. Does this make more sense? *fingers crossed*
  10. Oh Ok. The numbers can be reused and the ideally, I would like it to change at midnight EST. The number is not going to do anything but inform the visitor about the number of changes that have happened since the day before. It will have a hyperlink to a .pdf I have but I know how to do the hyperlink. Thank you both so much. I know this has to be frustrating.
  11. Any random number between 50 and 5000. I don't understand what you're asking about parameters. I'm sorry.
  12. Thank you for being so quick! I just pluck them out of the air when updating the site. However, I have read something about putting a list of numbers in a .txt file. There is no database connected to this site so the .txt file (if that is an option) would probably be the easiest. I hope I am making sense to you.
  13. Hello to everyone! I have a webpage that displays a number. I want this number to change every 24 hours for anyone that visits the site. Right now, I am manually changing this number each day. For the last year, I have searched help websites, consulted many many books and consulted with a couple of programmers I know that seem to not even understand what I am talking about. Would someone give me a hand in learning how to do this? Your help would be so much appreciated. To give you an idea of my knowledge level, what I have learned comes from an online php beginner and intermediate class and then some playing aorund and testing from books. Little, I know, and I apologize in advanced. Thanks
  14. Oh thank you so much for steering me to the right direction! This will be a lot easier than I thought. You lot are the best!
  15. Where to start? First, I am very much a novice to coding in general. I've had beginner and intermediate php classes and I love working with php. I've had a site with a login/password security in place for some time. However, I would like to add a page in which the user can go to see all downloads meant for them and not all available downloads. The problem is, I don't know where to start. I've done some "googling" but apparently I don't even possess the correct terminology to do a helpful search. All I am coming up with is help to create a login/pasword site. Would one of you offer some advice on where I need to start. Thank you in advance for your help.
×
×
  • 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.