Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. I was being facetious since I don't think you can. (But I could be wrong.) If I were doing it I would capture the comment from the file upload page and then store the image in my images folder and at the same time save the comment in a table under the image's saved name, obviously checking the table before both actions to ensure that I don't have a dupe image name. I would also store some other pertinent data in the table too, such as date added, contributor(?) name or id, dimensions (w/h), and maybe a keyword or two to provide some rudimentary search capabilities. Then my display page (that we just worked on) would use a query instead of a glob to get the image names (and comments) and then build the page.
  2. So - now you can teach me something. How do you get a comment out of an image file?
  3. A comment tag in the file? The image file?
  4. Normally I don't provide such help to someone who doesn't apparently have a clue, but here goes: <?php echo "<html><body>"; echo "<center><h1>Family Photos</h1></center>"; $dirname = "img/"; $images = glob($dirname."*.png"); foreach($images as $img) { $img_cap = "???"; echo "<div><img src='$img'><br>$img_cap</div>"; } ?> Where are you going to get the captions for each image as you cycle thru them?
  5. That echo will only occur if there is an error which should interrupt your script. I would add an exit() line to that connect file since I wouldn't want to continue with my script if my connection was not available.
  6. What do you think? I though my post was pretty direct, as in: " That includes even a single space character or blank line.".
  7. You must ensure that you are not outputting anything prior to your header call. That includes even a single space character or blank line. That is what the messages are telling you.
  8. Yes - what is the error message?
  9. Sounds like you have solved your problem. Bye
  10. Wrap each image and text in a div tag. <div> <center> <img><br> This is my caption </div>
  11. Let's try this again. Please show us lines 1-20 and point out the line that is giving you the error.
  12. You only have one query running here and you are NOT checking the result of it. // figure out the total pages in the database $result = mysql_query("SELECT * FROM albums ORDER BY album_id"); //***** CHECK QUERY RESULTS !!!!!!! $total_results = mysql_num_rows($result); $total_pages = ceil($total_results / $per_page); You are also doing two things wrong with your data retrieval 1 - you are not retrieving a row 2 - you are using a horribly wasteful function to get the columns. Look up MySQL_fetch_assoc in the manual and stop getting your data field by field. MySQL_result is perfect if you are only seeking one piece of data, but if you want the entire row (as you do here), you should get the whole row at one time.
  13. Nice explanation, but you still aren't showing the code.....
  14. I see nothing in this code snippet that would cause a second transmission of your mail message. I do however see at least one php syntax error which if you turned on error checking would be revealed to you. ini_set('display_errors', '1'); ini_set('log_errors','1'); // turn this off once done with development.
  15. Show us the code from lines 1 - 20
  16. Your problem is that you didn't check for an error in your query. ALWAYS ALWAYS ALWAYS check the result of a function call before assuming that you have something to continue on with.
  17. I am positive that you did NOT "build a php website" as you said. "Building" implies that you wrote it. Judging by the last post you made showing your coding of my proposed solution tells me you don't have a clue.
  18. Not really. You need to google some sql learning and see how to do a join between two tables. (Part of the 'learning' process).
  19. Do a join using states and a sub-query getting say, the count of contacts by state and output the state, name, and count. Then loop thru the results and only output those that have a zero count
  20. That's because you don't know anything about writing php code. Sorry - can't help you if you can't follow my lead
  21. No. Did you write this code? Your problem is here: $headers .= "From: ".$email. "\r\n"; $message = "<strong>Email = </strong>".$email."<br>"; $message .= "<strong>Name = </strong>".$name."<br>"; $message .= "<strong>Phone = </strong>".$phone."<br>"; $message .= "<strong>Message = </strong>".$message."<br>"; @mail($send_email_to, $subject, $message,$headers); You begin by putting $mail into $message and continue putting other values in the same var (not a problem) but then you end by trying to put $message into $message, thinking that there is an actual message being stored.
  22. In the very beginning of your code you are wiping out $message. Fix that.
  23. It will help you make a cleaner line of code that may solve your error message and your desire to print/not print the copyright data
  24. Not at all. Something was wrong with my previous post - the corrected code didn't make it to the post New code should be: <p id="data">$news_date, $hour GMT<br/>$copyright</p> where the php vars are assigned earlier in the code. Also - this line needs to be echo'ed or included as part of a heredocs block.
  25. FWIW, can I tell you that in my scripts I have only ONE SINGLE php start tag? No matter how large the script, that is all there ever is. What that means is I don't switch in and out of php mode to do simple little things like display a variable in the html. First I separate the majority of my html from my php logic. Second I only mingle them when I'm building things like tables or dropdowns. This allows me to avoid <? ?> and to make eminently more readable code. That said, this line needs to change for your benefit: <p id="data"><?php echo $row["news_date"]; ?>, <?php echo$row["hour"] ;?> GMT<br/>Copyright Imagem: <?php if ($row['copyright'] <> Desconhecido) echo "Copyright Imagem: " . $row['copyright'] .; ?></p>
×
×
  • 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.