Jump to content

foevah

Members
  • Posts

    162
  • Joined

  • Last visited

    Never

Everything posted by foevah

  1. MadTechie - I just tried what you suggested and I got the same browser responce: mysql_query("UPDATE `php_blog` SET `timecode` = 'NOW(0,0,0,10,31,2006)' WHERE `id`='1'"); Browser: I am not sure how to apply our suggestions londonjustin.. This is what my blog table looks like when I view data in dreamweaver: I want to change all the 00000000 entries with the dates they were entered into the db.. for some reason they have been deleted. Once I can change these dates I will reset the blog.
  2. Hi I have tried the sql query below but it didnt work: mysql_query("UPDATE `php_blog` SET `timecode` = '".mktime (0,0,0,10,31,2006)."' WHERE `id`='1'"); The browser returned: I am trying to change the timestamp manually. Any ideas?
  3. Please click this link to see my blog: http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/index.php When submitting an new blog entry I have changed the year to 2006 but when I view the index page the date still says 2007. When I edit the new entry using my update form and I try changing the date again the date vanishes from the index page and it also moves to the last page http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/index.php?page=4 To get to the edit/update entry form I click on a edit_menu.php page which then gives me a list of entries.. On this edit_menu page the dates of the entries wrong aswel they show this: Whats wrong with my blog dates? In Dreamweaver this is what my blog table looks like when using view data: As you can see the timestamp says 00000000000 for all of them apart from the last 2 new entries...... ??? How can I change the 000000000 to the correct dates when I entered these into my blog? I have uploaded PHPS files here: index.phps blog entry form edit_menu edit/update blog entries form
  4. Ok now I am trying to display the date using this code on the index page: echo "<br /><br />".showinweb($row['dateAdded']); It is not showing? I have changed dateAdded to timestamp but still no luck.. I also have a HR and Leave Comments that should appear after each entry but they appear on the last entry on each page. Please look at my index page to see what I mean: http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/index_vege.php?page=1 Any ideas how to get the date to display and get the HR / Leave a comment to show after each entry please? This is the code on my index page: http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/index_help.phps
  5. Ok this sql line modified the timestamp: $sql = "ALTER TABLE `php_blog` MODIFY `timestamp` TIMESTAMP(14) NOT NULL"; it now shows 'dateAdded' => '0.00.0000', on the index page Any ideas why the db row is empty?
  6. I found this code but I havent tried it yet.. Please can you tell me if it is correct: $sql = "ALTER TABLE `php_blog` MODIFY `timestamp` VARCHAR '14' NOT NULL";
  7. how can I modify timestamp timestamp(14) NOT NULL in the database table without deleting everything?
  8. This is the timestamp column: timestamp int(20) NOT NULL, I have uploaded the index PHPS page that I am trying to get it to display on here: http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/index_help.phps I added var_export($row); on line 207
  9. I had that before I made it a string.. It still shows this on the index page: 'dateAdded' => NULL,
  10. This is what the index page displays: http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/index_vege.php?page=3 I changed the SQL line on the uploader page to: $sql = "INSERT INTO php_blog (timestamp,title,entry,password,image) VALUES ('now()','$title','$entry','$password','$new_name')"; On the index page it says: 'dateAdded' => NULL, Why doesnt the date display ??? I have uploaded the new phps file http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/entry/uploader_help.phps
  11. I get this error in the browser: I added the PHP code below on the index page at the end of the while loop and this is what it returns: 'dateAdded' => NULL, : var_export($row);
  12. Hi everyone I made a PHP blog that uploads an image into the db at the same time with a text entry. This worked fine until I tried adding the timestamp to the entries and everything stopped working? ??? The blog entry form phps can be viewed here: http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/entry/uploader_help.phps The index phps can be seen here: http://www.webdesignhull.lincoln.ac.uk/jecgardner/blog_test2/entry/index_help.phps Please can someone help!
  13. What I'd like to know is how to view the images that have been uploaded into the image directory back in the flash file? The link below is a file upload which allows only images to be uploaded! http://www.jamesgardner.lincoln.ac.uk/fmp/fileupload/fileupload.swf directory of the images uploaded: http://www.jamesgardner.lincoln.ac.uk/fmp/fileupload The .fla for this .swf can be found in this macromedia 8 folder: Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScript\FileUpload.fla In the flash file theres a huge drop down menu and when I select an image thats been uploaded it doesn't load in the flash window. I'm also wondering how to make the images to stay in the drop down menu when the browser is refreshed!? Ultimately i'd like the images from the directory to appear in the flash window as thumb nails and when the the user selects a thumb nail the image would expand onto the screen! ???
  14. I'm trying to apply THIS to work in my blog entry form where the images uploaded will have the expanding image effect attached to them! Ive uploaded an image called cat_small.gif using the form in the code below that I got from a phpfreaks tutorial. I uploaded an image called cat_big.gif using my ftp program because I dont want the bigger image to appear in the blog entries, I only want it to appear on rollover. Right now the images upload to a directory called files and currently they dont appear in my blog entrys alongside text. Can someone tell me how to get the images to appear in the blog entry form alongside the text please!? :scratch: I hope getting the images to load in the blog entry form is easy because I know my next question is harder! What I'm trying to do is get the javascript that does the expanding image effect on rollover to display all images with the suffix _big.gif on all images entered into the blog! :eek: Here's the code for my blog page. I've managed to add my own smiley faces and I hope I can apply something similar achieve this image expand effect! (The image upload form is at the end of the code) <script type="text/javascript"> function addsmiley(string) { var newtext = string; document.addthread.entry.value += newtext; document.addthread.entry.focus(); return; } </script> <?php if (isset($_POST['submit'])) { $title = htmlspecialchars(strip_tags($_POST['title'])); $entry = $_POST['entry']; $entry = nl2br($entry); if (!get_magic_quotes_gpc()) { $title = addslashes($title); $entry = addslashes($entry); } mysql_connect ('localhost', 'USERNAME', 'PASSWORD') ; mysql_select_db ('DB_USERNAME'); $sql = "INSERT INTO php_blog (title,entry) VALUES ('$title','$entry')"; $result = mysql_query($sql) or print("Can't insert into table php_blog.<br />" . $sql . "<br />" . mysql_error()); if ($result != false) { print "Your entry has successfully been entered into the database."; } mysql_close(); } ?> <form name="addthread" method="post" action="<?php echo $_SERVER['../PHP_SELF']; ?>"> <p><strong><label for="title">Title:</label></strong> <input type="text" name="title" name="title" size="40" /></p> <img src="../images/smile.gif" width="15" height="15" onClick="addsmiley('')"> <p><textarea name="entry" cols="80" rows="20" id="entry"> </textarea></p> <p><input type="submit" name="submit" id="submit" value="Submit"></p> </form> <form name="form1" method="post" action="" enctype="multipart/form-data"> <input type="file" name="imagefile"> <br> <input type="submit" name="Submit" value="Submit"> <? if(isset( $Submit )) { //If the Submitbutton was pressed do: if ($_FILES['imagefile']['type'] == "image/gif"){ copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name']) or die ("Could not copy"); echo ""; echo "Name: ".$_FILES['imagefile']['name'].""; echo "Size: ".$_FILES['imagefile']['size'].""; echo "Type: ".$_FILES['imagefile']['type'].""; echo "Copy Done...."; } else { echo "<br><br>"; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>"; } } ?> </form>
  15. Warning: Wrong parameter count for substr() in /home/hullweb/public_html/jecgardner/flash_upload/upload.php on line 3 ???
  16. I got this error Parse error: parse error, unexpected '{' in /home/hullweb/public_html/jecgardner/flash_upload/upload.php on line 4
  17. yayaya it works http://www.webdesignhull.lincoln.ac.uk/jecgardner/flash_upload/upload.swf Ok so I deleted it checking for jpeg's so how can I get it to work so it only accepts images?
  18. I dont think I have access to a php error_log file When the first if statement is in place nothing works. I don't know what mime type is.. I have another example of a flash uploader which is giving me the exact some problem! Right now it works because I have deleted that line of code. Heres the link for this other attempt: http://www.jamesgardner.lincoln.ac.uk/fmp/fileupload/ The file for this can be found in your macromedia flash 8 directory Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScript\FileUpload
  19. I want it to accept all images but in the php code I have jpeg.. I tried what you suggested which I already thought about trying changing this line in the AS but it still doesn't work: imageFile.browse([{description: "Image Files", extension: "*.jpg"}]); This is the flash upload is on this link now: http://www.webdesignhull.lincoln.ac.uk/jecgardner/flash_upload/upload.swf files go to: http://www.webdesignhull.lincoln.ac.uk/jecgardner/flash_upload/files/ I'm trying to upload a jpeg which it doesn't do.. If I delete the code below the uploads work insecurely: if (($_FILES['Filedata']['type'] == "image/jpeg") && ($_FILES['Filedata']['size'] < 350000)){
  20. I added print_r($_FILES); at the end of the php code. this is the action script //Allow this domain System.security.allowDomain("http://localhost/"); import flash.net.FileReference; // The listener object listens for FileReference events. var listener:Object = new Object(); // When the user selects a file, the onSelect() method is called, and // passed a reference to the FileReference object. listener.onSelect = function(selectedFile:FileReference):Void { //clean statusArea and details area statusArea.text = details.text = "" // Flash is attempting to upload the image. statusArea.text += "Attempting to upload " + selectedFile.name + "\n"; // Upload the file to the PHP script on the server. selectedFile.upload("upload.php"); }; // the file is starting to upload. listener.onOpen = function(selectedFile:FileReference):Void { statusArea.text += "Uploading " + selectedFile.name + "\n"; }; //Possible file upload errors listener.onHTTPError = function(file:FileReference, httpError:Number):Void { imagePane.contentPath = "error"; imagePane.content.errorMSG.text = "HTTPError number: "+httpError +"\nFile: "+ file.name; } listener.onIOError = function(file:FileReference):Void { imagePane.contentPath = "error"; imagePane.content.errorMSG.text = "IOError: "+ file.name; } listener.onSecurityError = function(file:FileReference, errorString:String):Void { imagePane.contentPath = "error"; imagePane.content.errorMSG.text = "SecurityError: "+SecurityError+"\nFile: "+ file.name; } // the file has uploaded listener.onComplete = function(selectedFile:FileReference):Void { // Notify the user that Flash is starting to download the image. statusArea.text += "Upload finished.\nNow downloading " + selectedFile.name + " to player\n"; //Show file details details.text = "" for(i in selectedFile) details.text +="<b>"+i+":</b> "+selectedFile[i]+"\n" // Call the custom downloadImage() function. downloadImage(selectedFile.name); }; var imageFile:FileReference = new FileReference(); imageFile.addListener(listener); uploadBtn.onPress = uploadImage; imagePane.addEventListener("complete", imageDownloaded); // Call the uploadImage() function, opens a file browser dialog. function uploadImage(event:Object):Void { imageFile.browse([{description: "Image Files", extension: "*.jpg;*.gif;*.png"}]); } // If the image does not download, the event object's total property // will equal -1. In that case, display am error message function imageDownloaded(event:Object):Void { if(event.total == -1) { imagePane.contentPath = "error"; } } // show uploaded image in scrollPane function downloadImage(file:Object):Void { imagePane.contentPath = "./files/" + file; } stop()
  21. when I did print_r($_FILES); I got Array ( ) http://www.webdesignhull.lincoln.ac.uk/jecgardner/flash_upload/upload.php
  22. yes they should but I tried changing it to Filedata and it still doesn't work! ["uploaded_file"] should it be ['Filedata'] ? I just changed that line trying with "Filedata" and also I tried change it 'Filedata': if (($_FILES['Filedata']['type'] == "image/jpeg") && ($_FILES['Filedata']['size'] < 350000)){ this still doesn't work..
  23. still doesn't work heres the PHP. I've tried changing uploaded_file in the first if statement to Filedata but nothing works.. <?php if (($_FILES["uploaded_file"]["type"] == "image/jpeg") && ($_FILES["uploaded_file"]["size"] < 350000)){ //create the directory if doesn't exists (should have write permissons) if(!is_dir("./files")) mkdir("./files", 0755); //move the uploaded file move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']); chmod("./files/".$_FILES['Filedata']['name'], 0777); } ?>
×
×
  • 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.