Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. So - now you can teach me something. How do you get a comment out of an image file?
  2. A comment tag in the file? The image file?
  3. 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?
  4. 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.
  5. What do you think? I though my post was pretty direct, as in: " That includes even a single space character or blank line.".
  6. 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.
  7. Yes - what is the error message?
  8. Wrap each image and text in a div tag. <div> <center> <img><br> This is my caption </div>
  9. Let's try this again. Please show us lines 1-20 and point out the line that is giving you the error.
  10. 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.
  11. Nice explanation, but you still aren't showing the code.....
  12. 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.
  13. 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.
  14. 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.
  15. Not really. You need to google some sql learning and see how to do a join between two tables. (Part of the 'learning' process).
  16. 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
  17. That's because you don't know anything about writing php code. Sorry - can't help you if you can't follow my lead
  18. 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.
  19. In the very beginning of your code you are wiping out $message. Fix that.
  20. 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
  21. 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.
  22. 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>
  23. if ($row['copyright'] <> null) echo "Copyright Imagem: " . $row['copyright'] . "</p>"; If that helps.
×
×
  • 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.