-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Pwntastic: The above is THE Answer you've been looking for. Jacques1 has spoken .
-
according to some here doing a prepare and then parameterized values is the best. You don't have to actually do the bind. The manual shows that you can do this: $q = "select fld1,fld2 from table where key=:keyval and blah=:blah and blah2 = :blah2"; $qst = $pdo->prepare($q); $qst->execute(array('keyval'=>'mykey','blah'=>'blahval1', 'blah2'=> 'blahval2')); if (!$qst) (handle error) while ($row=$qst->fetch()) echo $row['fld1']." ".$row['fld2']."<br>";
-
Then that would entail an ajax call to a php script, wouldn't it?
-
When your js gets to 0 then let js trigger the action. It could be a submit of a form, or it could be an ajax call.
-
Can you offer any clue as to what line(s) are causing this error?
-
You tried searching on line for a few mins? Sometimes it takes longer than that. Did you search the php manual? Use the php time functions. Microtime for instance.
-
You can't call PHP from there. You're at the client - php is on the server. Besides no matter what you put into the span tag how does it get triggered? You use a timer (setinterval) but all that does is do a countdown as you want - it doesn't trigger anything.
-
I disagree Mr. Grant. The ENTIRE purpose of preparing queries is to enforce all matters of security in that query. Regardless of what type of var it is. Too many times people can forget to do what is supposed to be done - hence a prepared query. Whether it is a local var or a post or get or request var it should NOT be in the query text itself. It should always be provided via a substitute parm, ie ? or :parm.
-
How do the js functions get called?
-
WebSocket - status 0, can't establish a connection
ginerjm replied to AddanD's topic in PHP Coding Help
Ah HaH! You 'just uploaded the files' and you expected them to run on the host-provided cpanel screen? I hate to tell you how far off base you are. Actually - you probably just misspoke and don't know the difference much like people refer to phpadmin as their database. -
I got tired of trying to read your last post - too hard to follow your writing(?) style(?). If you write php the way you write English it's going to be a long painful process for you to do this correctly. You're right - don't spend the time needed to do something the right way. Keep on doing your sloppy way and good luck. I'll be signing off this topic now.
-
WebSocket - status 0, can't establish a connection
ginerjm replied to AddanD's topic in PHP Coding Help
You are allowed to install scripts on the cpanel that GoDada provides you? Really? My host doesn't offer that feature - I'm surprised that GD does. Or did you describe what you are doing incorrectly? -
Your data is a bunch of gibberish. You are getting good advice on developing a proper RDBMS but you are refusing to see that. Until you put your data in a proper structure you are going to have difficulty doing anything with this. In your first reply you made mention of that you could reduce your # of tables from 3 to 2 perhaps. In fact you should probably be increasing the # of tables in order to make it proper. Every event entrant should be place into a table with his name and personal info (contact, age, sex, etc. and player_id) You can do this with just one occurrence of a player's name regardless of how many tourneys he/she enters. Every event should go into a 2nd table with all the info about that tourney - name, dates, location, etc. and an event_id. Every entry from a participant should go into a third table with a record for that player having his player_id and event_id and the division he is entering (dbls, sgls, over 40, under 15 etc). Depending on how many different divs there are this can be expanded to have a division table with a div_id to link back to this entry record. Now you write a query to get things by selecting data from the appropriate table using an event id or a player id or a division id and join them in your query and order them as you wish. By separating your data into distinct tables/purposes you can then write a query that grabs what you need easily, depending upon your sql knowledge. Doing it the way you are is disaster around the bend.
-
While it doesn't make sense to me yet (your table structure) I'm guessing that you have two rows of data there and you have absolutely no rhyme or reason for how you want them arranged. That means you will have to hard code them the way you want them. Unless you can show us some more data that one can use to organize these items.
-
How to check for a variable with a certain value?
ginerjm replied to ageattack's topic in PHP Coding Help
Can you show us this code? Not catching your statement "have a loop that creates variables". -
The input comes from an email and looking at the raw source I got before I added the strip tags I saw an email address enclosed in < and >. There was no other function applied to this - I simply thought that I could remove the < and > with this function. Apparently I can't
-
Assuming that you are browsing a file/page/script with a ".PHP" extension, you could try turning on php error reporting (which you have partially commented out in your example: error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); Add that after your php tag.
-
So I am doing a script to read some emails coming into an address that I have piped to it. Done this before and had success. Problem now is strip_tags. Trying to remove some spurious html codes in the email the easy way or so I thought. What's happening is this A line that contains an email address such as this: From: <user@domain.com> is being stripped out to this: From: <user@domain.com> I thought that strip_tags would just strip out the < and > chars but it is not. Any ideas?
-
On a more serious note: No - it doesn't.
-
Since one doesn't 'do' a join in PHP, perhaps you should ask in an SQL forum instead of a PHP one?
-
Read your code very carefully and you will see the problem is two double quotes in succession.
-
Lard - a very nice response from you. Obviously a well-rounded and well-educated individual. Loved your post. Jacques1 - you could learn a lot from Lard in how to be nice to people. Sure you are a first class nerd and can converse well in PHP and lots of other highly technical fields, but you sorely lack common decency. Even your retorts lack respect. So what if you are correct? You have given me my share of abuse and toyed with me for hours. I take it because you eventually will provide some real help. Too bad we have to put up with your nonsense to get it. And now I suggest a moderator close this topic. We are definitely off course here, but I felt a need to let our newbie OP know that he is not alone here after facing the wrath of jacques1
-
[PHP, HTML, Apache (XAMP)] Inline PHP Tags Do Not Get Processed
ginerjm replied to glassfish's topic in PHP Coding Help
Since your script didn't work for you I'm guessing it was not truly a PHP file. Sounds to me like you haven't solved the problem but are moving on. Good luck on your journey. -
A session usually ends when the browser closes. Maintaining a db connection is a similar thing, although it usually goes away at the end of a script when you send something to the user to see. Consequently, you should develop a good few lines of code to make your db connection and then include that module in each of your scripts that require db access. Something like this: function MakeDBConnection($dbname) { ( your php code to connect and select the database name) return $db_handle; } Be sure to use mysqlI or PDO and not the soon-to-gone MySQL_* functions. And if using pdo use it properly. There's probably a good sticky post here that gives you some correct info on using pdo, highly recommended.