Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. 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.
  2. Not really. You need to google some sql learning and see how to do a join between two tables. (Part of the 'learning' process).
  3. 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
  4. That's because you don't know anything about writing php code. Sorry - can't help you if you can't follow my lead
  5. 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.
  6. In the very beginning of your code you are wiping out $message. Fix that.
  7. 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
  8. 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.
  9. 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>
  10. if ($row['copyright'] <> null) echo "Copyright Imagem: " . $row['copyright'] . "</p>"; If that helps.
  11. ok - need more input, but first you need more coding. 1 - please use the tags here to encase your code so it is more readable. 2 - you need to close your form 3 - you do realize that your inputs using 'beton[]' as the name attribute are returning an array in the $_POST array? Meaning you already have an array, so I don't know what you mean by "turn it into [an] array". 4 - your foreach to grab the contents of the beton[] array, could be entirely replaced with: $ints = $_POST['beton'] to create an array of all the checkboxes named beton. Same with your 'amount[]' array from $_POST. 5 - Do you need to validate the inputs from beton and amount to ensure that they are one-to-one, meaning you have a bet AND amount for each choice(?) ? You have a pseudo query in here - perhaps if you flesh it out we can see what your data looks like. What you have given us is very hard to figure out. And your html form shows stuff that you have not declared for us to see, so hard to make sense of it. Maybe laying out in English what you are doing will help us to see what you see.
  12. THIS is a much more informative post than your first. Do you see how much differently you present yourself this time? Your first post (2nd on this site?) showed you in a much more "needy" light. You presented (as I said) two lines of code and some html and asked for help in writing a query that you apparently had not even attempted. Typical newbie post asking forum members to write the code that the poster is too lazy to even attempt. So - do you have something to show now that you have been provided some input from others?
  13. So - you've written all of two lines of PHP code and now you want us to write the rest? Perhaps you should begin by learning how to write php. Go thru a tutorial or two online and learn instead of starting off by asking others to do your work. Everybody - EVERYBODY - is a complete "noob" at one time. The way to lose that nametag is by learning and it involves some - gasp! - work.
  14. Because when I see the call to a query function I expect it to be executed every time thru which is definitely not something I would want to do each time thru a loop.
  15. That seems to be a very contrary syntax. The first time into the foreach the query is executed, and the following times it is not? Not very intuitive....
  16. Besides the other comments, your first 'query' is confusing. You have a query call inside a foreach - not sure that is a valid thing to do. Normally one calls the query and gets a result var and THEN uses the looping to process the records in the result var.
  17. oops - just noticed a typo. The keyword in my code should be 'VALUES' not 'VALUE'
  18. First you need to sanitized/validate your input before attempting to place it in your db. To extract the array values from your POST array: $values = ''; foreach($_POST['firstname'] as $nm) { if ($values == '') $values .= "VALUE ('$nm')"; else $values .= ",('$nm')"; } Then modify your query statement to use $values in place of your existing values, etc.
  19. is your command (open) formatted correctly - per the manual? Seems odd to be getting an ip addr in the message.
  20. You don't reference a valid table name in your query as far as your code shows. You don't check to ensure the query statement actually ran. Is your username possibly a multi-word value? You don't include it in quotes in your test, which btw is meaningless since your query could only possibly obtain a match already. You turned on error checking but you don't display them. Are you checking your error log to see if there is a message there? Since this is in test still and not open to the public yet, try turning on 'display_errors' so you can see them as you test.
  21. Not sure what the post from Jayson... was about. As for the error message - show us line 94 so that we may point you in the right direction.
  22. In your desperation (funny how people get desperate when trying something new), did you read thru all the posts in the PHP manual describing many potential problems?
  23. Then let's see the code. Properly tagged of course.
  24. You'll get better response if you provide the code. I, for one, don't click on people's links to (supposed) code stored elsewhere, let alone a zip file. May I first suggest turning on php's error checking to see if an error is causing your script to abort?
×
×
  • 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.