Jump to content

LiamH

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

LiamH's Achievements

Member

Member (2/5)

0

Reputation

  1. the first example is how the URL is currently, the second is how the example URL will look using the new system. The new system uses the articles headline and published date to create the URL.
  2. Hi all. First off sorry if this is in the incorrect place. I'm about to upgrade my site from one CMS to another which is better SEO and brings me more features. Most of the articles I have are being transferred onto the new system, but because I have so many only the more popular ones are going to be redirected to their new home to begin with. I've been searching for hours now to try and figure out what I'm doing but no luck. Basically this example page /article.php?ArticleID=614 would need to be redirected to something like /examplepage161209 How is this done because I just can't figure it out Thanks all
  3. Looking into it further, it appears this is a feature of IE Up to this point I was actually enjoying using IE8. Adding it to the MIME has sorted the problem. Thanks for the help guys
  4. Had a go on one of the other browsers with that code in, and it's just IE that for some reason is putting a p in the code. With the code you gave me, it simply displays "image/jpeg"
  5. Hi. IE is the only browser that is causing issues. This works perfectly on all the other browsers. No error messages are being displayed, expect for the message the uploader gives stating it is the wrong image type. Hvaing tried your method, I for some reason have "image/pjpeg" being displayed on the page. Which has stumped me even more. I have no idea why it is saying that!
  6. That works thanks. I needed to slightly change your code to get the else message to display. The else needed to go between the end if and end while }
  7. Thanks. That makes more sense. I've just realised I missed a bit of code when I typed the original post. It should actually read; if (mysql_num_rows($res1) > 0) { while($row = mysql_fetch_assoc($res1)) { echo "Title: ".$row['Title']."<br>"; } } else { echo 'morning'; } I'm not getting the error anymore, but it's still printing "Title:" even though there is no data in the DB.
  8. How would I do it with that code - sorry!
  9. Yes I understand. Will have a look at this and let you know how I get on. Thanks for the help!
  10. Hi all. I thought I had this sussed, but it appears not. I have a page where I want some information to be displayed if it is present in the database. If there is no data then I want it to display something else. This is what I have so far, but it's not working; if (mysql_num_rows($res1) > 0) { while($row = mysql_fetch_assoc($res1)) { echo "".$row['Title']."<br>"; } if { echo "morning"; } } I've also tried it with elseif, but same result. The error is that it's unexpected. So evidently what I want to do can't be done this way. How can it be done? Thanks
  11. Anyone have any ideas on how to get the pagination to work?
  12. Hi all. I have an image uploader which works fine in all browsers, except IE. For some reason when trying to upload any file, even though they have been defined as acceptable, IE states it is an illegal type. <?php // the image upload code has been adapted from an example that is avaialable from http://www.visualdesigncore.com/tutorial.php/PHP-MySQL/PHP-Image-Upload/?do=tut&tut=PHP-Image-Upload // the filepath the image will be saved to on the server, and the maximum filesize in KB the image can be $path = "images/articles/"; define ("maxsize","5120"); // check to see if a file has been selected in the textbox, if it has give it a temporary name on the server, if not do nothing // if a file has been selected the size is then checked. If the file is too big, an error message is displayed and the file is not sent if (!isset($_FILES['image'])) exit; if (is_uploaded_file($_FILES['image']['tmp_name'])) { $size=filesize($_FILES['image']['tmp_name']); if ($size > maxsize*1000) { echo "<td align='center'>The file is too large, please choose an image that is smaller than 5MB in size.</td>"; exit; } // the allowed file types are defined below. Only images with the extensions set out below are allowed. The extension on the selected image is checked if (($_FILES['image']['type']=="image/gif") || ($_FILES['image']['type']=="image/jpeg") || ($_FILES['image']['type']=="image/jpg") || ($_FILES['image']['type']=="image/png")) { // if the filetype is ok, a check is done to see if the file exists on the server. If it does, an error message is displayed and the image is not uploaded if (file_exists($path . $_FILES['image']['name'])) { echo "<td align='center'>This image already exists in the server. Please try another file.</td>"; exit; } $res = copy($_FILES['image']['tmp_name'], $path . $_FILES['image']['name']); if (!$res) { echo "<td align='center'>Upload has failed.</td>"; exit; } // if file passes checks, upload file with success message else { echo "<td align='center' class='confirm'>Image file ".$_FILES['image']['name']." uploaded succesfully.</td>"; } // if file is not correct file type, the other checks are skipped and go straight to an error message stating the file is of the wrong type, and the file is not uploaded } else { echo "<td align='center'>Wrong file type, please select another.</td>"; exit; } } ?> Anyone know why IE is lying to me?
  13. I went along the route of having 10 rows in the articles table, and can display the screenshots on the articles page no problem. It's when it comes to having them display in the image viewer page that I become a bit stuck. I'd only want one image to display at a time, so would need some form of page pagination, but with only the images location stored in the articles table, I'm not entirely sure how to go about doing it. And apologies for placing it in the wrong bit
  14. Hi all. I'm trying to update my website so that screen shots on an article page, when selected will open up a new window and display all of the images associated with that article. But I'm really not sure how to go about it. Would the best way to have 10 individual columns for screens in the articles table, or is it better to have just one column with all of the screenshot information contained in that? I honestly have no idea how to go forward with this, so if anyone has any helpful hints or advice, it would help greatly.
×
×
  • 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.