Jump to content

DjMikeS

Members
  • Posts

    140
  • Joined

  • Last visited

    Never

Everything posted by DjMikeS

  1. Have you also "cranked up" the max_script execution time ? Otherwise your script will be terminated by php before uploading is complete...
  2. Could it be because <input type="hidden" id="text" name="text" /> has no value assigned to it ?
  3. Have you tried setting wrap="physical" in your textarea element ?
  4. I'm using a custom build framework and I found out that the script itself is working. So I'm thinking that the framework is corrupting the data somewhere...I will have to dive in to this. For the time being, I could store the attachments (mostly images, screenshots) as BLOB in the database... Is there a reason not to save the image as BLOB ?
  5. I've tried that and it gives the same error. The filesize isn't zero because when I remove the header, it does output the raw data of the PNG. For some reason, I can't get the image to display properly.
  6. I've tried that but as soon as I uncomment the image/png header, FF starts complaining about the image containing errors and IE just outputs raw data... Is there anything else I can try to figure this out ?
  7. Of course, how could I forget the @... I've removed the @ and the header. The output is: �PNG ��� IHDR�����l���+�8���sRGB�������gAMA And a lot more of the same... What am I missing ?
  8. I tried removing the force-download header. Now IE gives me the option to download the png and FF wants to download the file.png.htm When I try downloading and opening the file in FF I get the bytestream instead of the actual image, so I'm thinking that's a header problem. I've changed it into this: <?php $url = arrayUrl($_GET['url']); $file = $html->includeAttachment($url['2'], $url['3']); header("Content-Type: image/png"); @readfile($file); ?> But that gives me the following error: The image “http://172.16.32.24/pecs/tickets/attachments/000001/screenie.png” cannot be displayed, because it contains errors. I can confirm that the image on the server is correct. What am I doing wrong ?
  9. I've tried your solution, MadTechie, it doesn't work as expected, but I want to show the image in the browser instead of forcing a user to download it. Is that possible ? I was thing about something along the lines of what ninnypants said. So I thought about using readfile() and then turn that outputstream back in to an image but I couldn't find a function for it. Can someone point me in the right direction ?
  10. Hi guys, I'm currently building a helpdesk system with tickets and stuff. I want to add attachments to tickets. These attachments are stored in a web inaccessible folder called "attachments". In this folder, there is a folder for each ticket which holds the attachments. The folder is protected by a .htaccess file. I want to include an image from this folder in the webpage so that user can view the attachments. I don't want users to browse the images directly.... Now, when someone browses to the attachment, a "Forbidden" error is returned. I would like to keep this... How can I do this ?
  11. And you need to have the php CLI installed... If you have Debian, just do: #sudo apt-get install php5-cli Then in your cron, call the file like: php /var/phpfile.php
  12. mrMarcus has a point, but by doing it that way is not really considered a best practice... What you want is an extra table eg. album_tracks You then create a field eg. album_id which belongs to a table where you store the albums... That way you can insert as many tracks as you want without having to create an array to insert or exploding the array to retrieve...
  13. I think this line is wrong: $new_name = $path, $_POST['files']; because later on you do: if (file_exists($path . $new_name)){ wouldn't that be: if (file_exists("uploads/uploads/file")){
  14. A couple of things: When opening a new topic, you should choose a title that describes your problem...That way, users can quickly determine if they are able to help you... Second, please tell us what your problem is and any error messages you get...
  15. If you only want to rename a file, why not use php's rename function ? http://nl2.php.net/manual/en/function.rename.php
  16. Please post the error message...
  17. That's also known as DHCP Maybe someting like: <?php $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); echo $hostname; ?> This works great when the webserver is in the same network as the clients... If the webserver is not in the same network (seperated by router) you would lock out the router thus locking out the entire network behind that router...(NAT, http://en.wikipedia.org/wiki/Network_address_translation)
  18. Why would you need to do an if and elseif statement ? Seems to me that if news_content2 != "" it is automagically "" So this should be enough: <?php if ($news_content2 != "") { echo "<ul class=\"news_item\"> <li><h2>$news_title2</h2></li> <li><span class='news_date'>$news_date2</span></li> <li>$news_content2...</li> <li><a href=\"$news_article_url\" title='$news_title2' class='readmore' target='_blank'>Read More</a></li> </ul>"; } else { echo "<p class='error'>Sorry, News For This Artist is Currently Unavailable.</p> <img src='images/error.gif' alt='Error' title='Error' class='center' /> <p class='error'>Please try again Later</p>";} ?>
  19. Where does $news_content2 come from ? Please post that code...
  20. I never use list, but I think that's the problem... http://nl3.php.net/list And this $query = "SELECT offensive_level FROM weapons WHERE id = '$weaponid'"; $result = mysql_query($result); Is NOT fine! Which query is mysql_query supposed to run ? Exactly, none because $result is not set to a query... $query = "SELECT offensive_level FROM weapons WHERE id = '$weaponid'"; $result = mysql_query($query); Would make a whole lot more sense....
  21. http://en.wikipedia.org/wiki/KISS_principle Keep It Simple, Stupid. What's wrong with the query you ask? Do you have access to your server? Because if that query is not giving you any errors, your level of error reporting is wrong... $query = "SELECT defensive_level FROM weapons WHERE id = '$weaponid'"; $result = mysql_query($result); You don't see anything wrong with that ?
  22. you really write your code like that ? or did you just leave out stuff ? <?php if ($news_content2 != "") { echo "<ul class=\"news_item\"> <li><h2>$news_title2</h2></li> <li><span class='news_date'>$news_date2</span></li> <li>$news_content2...</li> <li><a href=\"$news_article_url\" title='$news_title2' class='readmore' target='_blank'>Read More</a></li> </ul>"; } elseif ($news_content2 == "") { echo "<p class='error'>Sorry, News For This Artist is Currently Unavailable.</p> <img src='images/error.gif' alt='Error' title='Error' class='center' /> <p class='error'>Please try again Later</p>"; } ?> Seems like a whole lot cleaner doesn't it ?
  23. First off, your code is totally crap... Where is the KISS principle ? Begin by taking out the db connection as I told you before... Next, your queries are wrong.... $query = "SELECT offensive_level FROM weapons WHERE id = '$weaponid'"; $result = mysql_query($result); list($offlvlweap) = mysql_fetch_row($result); $query = "SELECT defensive_level FROM weapons WHERE id = '$weaponid'"; $result = mysql_query($result); Third, try to use unique var names so that you can echo their contents for debugging If you would rewrite the snipped above: $getOfLevel = mysql_query ("SELECT offensive_level FROM weapons WHERE id = '$weaponid'") or die(mysql_error()); $offlvlweap = mysql_fetch_array($getOfLevel); $getDefLevel = mysql_query ("SELECT defensive_level FROM weapons WHERE id = '$weaponid'") or die(mysql_error());
×
×
  • 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.