Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. I see you made a post on an old topic similar to this. Not much code in that post and certainly absolutely NONE here. How about showing us a whole-hearted attempt at solving your self-made problem and then we can perhaps guide you?
  2. You're asking for help in a php forum so I assume that you want this to be in the PHP language. Have to make sure since you: 1 - posted some real goofy data 2 - didn't post any code to show us what YOU can do 3 - and didn't really explain yourself very well. Why don't you show us your ATTEMPT and THEN ask for help completing it?
  3. I would set up the allowed names in an array and then just simply use the in_array function.
  4. Are you having problems with the "contact form" or with phpmailer? They are two very distinct questions. Pick one.
  5. Something is odd in your example. Your first output shows an element as "string(2)" but the value is simply a pair of quotes. Why do we not see a 2 char string of some kind? Then in your second output we see an element defined as "string(6)" but the value is '</' which is a 2 char string. Why? Where is the 6 char string?
  6. Can't find a session var? 1 - you have to start the session at the top of every php script. 2 - Are you doing anything "special" with your sessions such as re-establishing the session id to avoid hackers and such? I doubt that at your level you would be doing it, but I have to ask. 3 - Are you doing any "unset" function on your session vars? Or on $_SESSION itself? PS - you do use uppercase for the name '$_SESSON' all the time, yes?
  7. Rush as in how you rushed to make your last response? If you want to be a programmer you really need to slow down and think both before and while you type. Otherwise you will spend waaay too much time debugging silly errors that can and should be avoided. (And yes - I meant to mis-spell the word 'way')
  8. You didn't read my first post.
  9. Instead of wading thru your improperly posted code I'll just offer this up: number_format()
  10. What IS ALL THIS CODE? Do you really expect us to read thru pages of code to answer your question? How about showing us the pertinent code? From you description it would seem to be a simple query but looking at this mess of a post I have to wonder how you are trying to do it.
  11. A simple echo as in echo "This is an error ".mysqli_error(); And the grammer 'part has been deleted FROM the database'. Do you actually say "deleted to"?
  12. No intent to offend, simply a retort to your bringing up something about your script that had not been mentioned before and had nothing to do with the current discussion.
  13. Glad you finally got it done. Although - your use of printf for an error message is a bit of overkill. And your 'success' message is a bit off in the grammar department.
  14. If this code actually runs then I've learned something about MySQL. Your first query selects no fields and contains an incomplete where clause. Besides the fact that it is a query that you make no use of even if it works. Good luck.
  15. Here is a section of your code. With my comments. Notice that I used the proper code tags { // YOU SHOULD CREATE THE QUERY IN A VAR THEN EXECUTE THE QUERY USING IT // ALSO - THIS QUERY SURELY PRODUCES AN ERROR - YOUR WHERE CLAUSE IS MALFORMED, NO? // WHY ARE YOU DOING A QUERY TO GET THE ENTIRE TABLE HERE? IF IT EVEN RUNS. SELECT WHAT? $result = mysqli_query($con, "SELECT FROM amp20 WHERE amp20ptid"); // escape variables for security $amp20ptid = mysqli_real_escape_string($con, $_POST['amp20ptid']); //delete Entry from db // NOT SURE BUT THOSE PARENS ARE MEANINGLESS HERE AND MAY PRODUCE AN ERROR $sql = ("DELETE FROM amp20 WHERE amp20ptid = '$amp20ptid'"); // YOUR IF STATEMENT HAS NO CONTENTS. LOSE THE SEMI if (!mysqli_query($con, $sql)); echo "Part has been deleted to the database!!!\n"; mysqli_close($con); } So - you have a chunk of code that does 3 queries to delete one record. It also produces a false result.
  16. Can you not follow instructions? You were told to use the proper tags for your posting.
  17. I have no idea what you posted back to my list of things you are doing. Why don't you show us you 'new and improved' code and tell us what is not working with it?
  18. whatever
  19. I suggest that the code you are looking at is not the code that is being run at that time. Try altering the message and running it again.
  20. You're saying that your argument in the query is the value 1? Meaning you are trying to delete the record where amp20ptid equals 1? And that the record is deleted despite the query error? I think that the record never existed since I'm pretty sure that the query isn't running. Regardless of the above, your script is rather convoluted. 1 - you make a connection which we will assume works 2 - you then do a query to select your entire table 3 - you then grab an incoming value from the post array 4 - using that input you do a delete of the matching record (which php/mysql indicates has an error in it) 5 - then you are supposed to do the query again - which if the first one ran should basically do nothing Is that what you are intending? echo out your query statement before you run it just to ensure it looks like what you intend.
  21. When you ask for help here it is a good idea to not post blind code that has no context and for which you have not provided any English translation of its context. What are we supposed to do - guess what you are trying to do as well as solve your problem? Why not start again and tell us what you have posted and what it is supposed to be? Then give us a synopsis of what you are expecting that code to do.
  22. Good.
  23. I have no idea what your post is. That first piece of code - what is it? If it is supposed to represent an array, it's a syntax I am not familiar with. If it's not, then what is it? And what is your question exactly? Output a message like what?
  24. What is the exact problem? For one thing you are not passing the 'code' parm in your uri
×
×
  • 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.