-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
There's probably a " somewhere in the markup. That'll get mixed in with the HTML and break stuff. General rule of thumb: htmlentities stuff if there's a risk of it conflicting with your HTML. value="" But why do you need it in the HTML? You're pulling it from the database anyways. Just put the ID number in the form, pass that to the next script, and have it look up the expression itself. Also means people won't be able to modify the form and insert arbitrary content.
-
Figuring out session variables? Having a problem
requinix replied to scm22ri's topic in PHP Coding Help
Both. What you put in the session is some information about the user: 1. In contact2 you session_start() then see that there isn't anything in there indicating the user is logged in, then you redirect 2. to update, which session_starts() too and logs them in, then back to 3. contact2 where you session_start() (it's the same one as before) and see that this time there is something in the session. -
The first argument to strtotime() is what you want to do to the time given as the second argument (which defaults to right now if you don't give one). So strtotime("-3 days") to give you three days ago. But since $item_reg is a DATETIME string you have to turn the Unix timestamp that strtotime() returned into a string. That's where date() comes in. date("Y-m-d H:i:s", strtotime("-3 days"))
-
LOL U NED TO REINSTAL WINDOWS HAHA SUX 2 B U Tried rebooting yet? Checked if there are any problems with the adapter (like with Device Manager, its configuration dialog, or maybe even ipconfig)? If you leave the IPv6 item checked can you get to its properties?
-
What does the actual HTML source of the page look like?
-
Weird emsgs at start of web developer errcodes in Mozilla/Firefox
requinix replied to yshua's topic in Miscellaneous
Looks Googleable. Although I'd just keep the UUID and leave out the full path name. Google Oh hey: Could not read chrome manifest file... Could not read chrome manifest file Firefox Extension Error (chrome.manifest) And the bug report: Bug 586610 - Could not read extensions chrome manifest file (972ce4c6-7e08-4474-a285-3208198ce6fd = default theme) So what version of Firefox do you have? Tried updating or reinstalling? -
After finding a browscap.ini and trying it on a machine myself, I found that get_browser() would return "win32" and "win64" bools.
-
It only works with actual Exception objects (and objects descended from Exception). PHP errors and warnings are just that: errors and warnings.
-
Use something else.
-
I don't see anything in there with a class of "cal". If you meant an ID of "cal" then you need to use $("#cal")
-
A POSTed form has semantics that a regular link does not. Regardless of the underlying action, anything GETed (including links) represents a read-only request while anything POSTed (forms with method=post) can represent something with a lasting effect. Think about a web spider: it will crawl links while it will not submit forms. So technically #1: you really should be using a form for a "delete"-type action. If you want the button to look like a link, that's a different problem. As for why it doesn't work, there's something somewhere that indicates the form submission is a DELETE. I'm thinking two possibilities: 1. A hidden form field. This is one way MVC.NET does it. 2. The framework accepts a POST action in place of a DELETE, but not a GET.
-
PUT and DELETE are only useful for REST requests - they don't really work with normal HTML-based traffic.
-
Your function returns a boolean, not an integer. var_dump(checkEmail($email1));
-
Can you elaborate on that very scary statement?
-
That's not something that can be solved. Looks like search functionality - is the input coming from the user? Best be very careful about what you allow or else I'll enter the quick brown fox jumps over the lazy dog That's 362,880 combinations, and at 45B per string that's 16MB for an absolute minimum amount of memory (which you'll be nowhere near). And I'm not even trying. And that's not even considering the database portion.
-
cant generate 404 headers on pages other than the requested page
requinix replied to yamikowebs's topic in PHP Coding Help
If you're not getting a 404 then presumably the framework sent something back. What did it send? -
Qualify the * with the table name, like `tbl_auction_lot`.*. But you should try to include only the fields you actually need.
-
Making a Windows / Mac / iPhone app quick (2d game)
requinix replied to tibberous's topic in Miscellaneous
You mean Objective-C? Quite different, they are. -
Do you have the universe repository enabled? That's where it lives. You can also install a "normal" MTA like Postfix or exim: IIRC they'll provide you a sendmail application too.
-
Regular expressions can't do this in any remotely reasonable way. Choose a different hammer.
-
You're creating text nodes. Text nodes cannot contain HTML - that's basically their entire point. Add the first text node, add a new node, then add the other text node.
-
Sending cURL POST data as "Content-Type: application/json"
requinix replied to MySQL_Narb's topic in PHP Coding Help
Right. You're supposed to use json_encode() instead of http_build_query(). -
getting strings to run when pulled from the database
requinix replied to pioneerx01's topic in PHP Coding Help
But it's defined outside the function. Unlike many languages, in PHP variables defined outside functions are not available inside functions. I'm not sure if I like suggesting this, but function fromdatabase ($variable, array $vars) { $replace = array(); foreach ($vars as $var) { $replace['$' . $var] = (isset($GLOBALS[$var]) ? $GLOBALS[$var] : ""); } return strtr($variable, $replace); } $string = fromdatabase($string, array("secret_code")); I'm steering clear of anything that automatically pulls in variables: that kind of automated e***uation can backfire just like how register_globals can. This way you're importing variables from the global scope (eww) but only the ones you specifically allow in code.