Jump to content

swissbeets

Members
  • Posts

    57
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    gingerbreadmayn

Profile Information

  • Gender
    Male

swissbeets's Achievements

Member

Member (2/5)

0

Reputation

  1. im sure this is an easy question i just havent done it before, i need to list my pictures in a table that will continuously show them but only show about 4 per line. right now i have something like this <table border="1"> while($row = mysql_fetch_array($photos)) { ?> <tr> <td><?php $picture = "images/" . $row['image_source']; mysql_prep($picture); ?><img src="<?php print $picture;?> "width="120" height="120"> </td> <?php }?> </tr>
  2. nvm i was uploading a file too large
  3. I am using the uploader.php that is in a tutorial to upload pictures to my site. but when i upload them everything is working fine except that the pictures are not being saved in my images folder(everything being, the name is saving in the database and being called correctly) maybe another set of eyes could help me spot the problem, here is my code <?php require_once("includes/session.php"); ?> <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php confirm_logged_in(); //echo "<pre>"; //print_r($_FILES); //echo "</pre>"; $target_path = "images/".$_FILES['uploadedfile']['name']; move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path); $image_source = mysql_prep($_FILES['uploadedfile']['name']); $id = $_GET['page']; $query = "UPDATE pages SET image_source = '$image_source' WHERE id = $id"; $result = mysql_query($query); if (mysql_affected_rows() == 1) { redirect_to("edit_page.php"); } else { // Failed $message = "The product update failed."; $message .= "<br />". mysql_error(); echo $message; }?> here is where the actualy information is coming from <form enctype="multipart/form-data" action="uploader.php?page=<?php echo $sel_page['id']; ?>" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" value= "<?php print $sel_page['image_source']; ?>"/> <input type="submit" value="Upload File" /> </form>
  4. check the persons level initially then, store it in a session, then when you want to check or redirect, just check the session and do so depending on what is stored here is a simple one for my logged in or not session_start(); function logged_in() { return isset($_SESSION['user_id']); } function confirm_logged_in() { if (!logged_in()) { redirect_to("login.php"); } } then i check if they are logged in by confirm_logged_in() but you could make a function that will always get the level by something like $level= ($_SESSION['level']); then use $level to redirect or whatnot is fife a nickname?
  5. dumb mistake, the "images/" was wrong i knew it was something small again eventhough it had been working before thanks for your help
  6. i kind of assumed that "$target_path = "images/ ".$_FILES['uploadedfile']['name']; move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path); $image_source = mysql_prep($_FILES['uploadedfile']['name']); " was moving a file, is it not? my code (i thought) was saving the file in my images folder and then saving the name in my database is that not what this is doing with the uploader? if not what is it doing?
  7. i have a back end part to my site so someone can easily update the products. i want it to be able to save pictures from my desktop in my website images folder ithought it worked but it definitely doesnt i am pretty sure its because the images arent saving right here is my code i took it from a tutorial and based it to needs <?php require_once("includes/session.php"); ?> <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php confirm_logged_in(); //echo "<pre>"; //print_r($_FILES); //echo "</pre>"; $target_path = "images\ ".$_FILES['uploadedfile']['name']; move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path); $image_source = mysql_prep($_FILES['uploadedfile']['name']); $id = $_GET['prod']; $query = "UPDATE products SET image_source = '$image_source' WHERE product_id = $id"; //print $query; $result = mysql_query($query); if (mysql_affected_rows() == 1) { redirect_to("edit_product.php"); } else { // Failed $message = "The product update failed."; $message .= "<br />". mysql_error(); }?> does anyone see anything i am doing wrong?
  8. for some reason when i click on a picture under products it will display in firefox but nothing will come up in IE i have no idea why since all of the other pictures work have a look if someone could www.bigpeckersstuff.com
  9. yea i didnt want to take the responsiblty of actually taking the money and the guy wanted me to have all of the credit card info emailed to him, needless to say i had to talk him out of that and after a day or two i got the google checkout to work. i am trying to center the whole page right now, but have have no idea what the first step would be any suggestions?
  10. i am reading a book on CSS right now so dont know that much just yet but how hard will it be to take out the tables and use CSS? also i basically did the lynda.com tutorial and changed it to fit my needs, i have never used php before nor have i really made a live site before. I basically just wanted to learn how to do this and figured the best way would be just dive in. the yellow is bright but i wanted it to match the big peckers logo. but i will keep that in mind yea, i heard it would be much easier to do the rollovers in css but i didnt wana fix something that was already working thank you very much for your input
  11. i know how to display it and everything except have it pop up in a new window does anyone have an example of this code?
  12. this is the first site ive done and i know there is still alot of things that need done but let me know if you see anything that wont take me a week to learn to first, or anything someone knows how to explain www.bigpeckersstuff.com (i am getting a picture to put on the homepage right now it should be up soon) thanks
  13. site looks great in firefox i bet your client is pleased
  14. i got it it was the image path thank you very much sorry i didnt catch that before even posting
×
×
  • 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.