-
Posts
15,266 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
You do understand that for every worker you try to read a new line from the file? It's not that you're reading a file and then checking it for all the workers?
-
There's one thing you have to keep in mind with SimpleXML: everything is an object. If you need a string then you should (and sometimes must) cast to a string, like (string)$xml->pix[0]->pic
-
If you want to use jQuery then yes, you need to include the script from somewhere.
-
You don't need that third column. You already know what its values are so there's no point in storing it. It would just mean more data you have to insert and update. SELECT column1, column2, column2 - column1 AS column3, ... Or just do the math in your code. $column3 = $row["column2"] - $row["column1"];
-
highlight_string and non-English characters
requinix replied to The Little Guy's topic in PHP Coding Help
highlight_string() uses the same tokenizing stuff that PHP uses for code. What was the snippet with those comments? -
$(Ajax Help).load(this_topic); // http://www.phpfreaks.com/forums/index.php?topic=360742.0
-
AJAX. Using jQuery you could $("section#content article").load("includes/article1_n2.php"); which would work because apparently your entire article is in just that one .php file.
-
How to order MySQL data from multiple queries?
requinix replied to HDFilmMaker2112's topic in PHP Coding Help
Use one query, not two. With a JOIN. SELECT f.friend_id, su.status_message, su.time_posted, or whatever you want FROM status updates table AS su JOIN friends table AS f ON su.user_id = f.friend_id WHERE f.user_id = current user ORDER BY su.time_posted DESC -
Beginner problem: Trying to file_get_contents of file that force-downloads
requinix replied to yortzec's topic in Regex Help
file_get_contents() is enough. Apparently the sync.in server is refusing your connection to download the file. Or maybe your PHP configuration disallows downloading files but I think you'd get a different error message for that. I just tried echo file_get_contents("http://sync.in/ep/pad/export/c9ppXi1bp7/latest?format=txt"); and it worked for me. -
You can't tell us where the problem is or what function is causing it, and you haven't given us what we need to reproduce the problem on our ends. It should not be surprising that we can't tell you what the solution is.
-
jQuery's click() adds event handlers. Every time you call that you add a new event handler. When onclick happens every one of those will be executed.
-
So this isn't resolved then? What version of PHP are you using? Oh, and find out where the problem is exactly.
-
The problem is you keep adding onclick handlers. Yes, adding. You aren't replacing the one set previously. Add the handler only once and do so outside of whose_turn(). Don't have to do anything else with it.
-
Right. I just focused on the user input side of things. Still have to escape it for the query, still have to escape it during output - same as always.
-
preg_replace() isn't doing it. Have you checked what $template is before this tag replacing runs? What are the various $keys and $values?
-
A partial upload. There's an error code for that.
-
Which function is causing the problem? getimagesize()? Historically it's had a couple problems dealing with very tiny files.
-
No security reason. Valid reasons could include length (don't want 1000-character-long tooltips) and cleanliness (HTML tags wouldn't look pretty).
-
parse_url followed by parse_str. No regex needed.
-
iteration algorithm : string representation
requinix replied to amalafrida's topic in PHP Coding Help
Are you basically just counting characters? We need to know more. -
Apache not starting in XAMPP even after port change
requinix replied to melting_dog's topic in Apache HTTP Server
Anything in Apache's error logs? -
I'm saying that the minimizing will break code like function update(v) { document.getElementById('id').value = v document.getElementById('other').value = v } as well as styles like body p { text-decoration: blink; } style="border: 2px solid blue"
-
Your $sql assumes that there should be quotes around $isin (the general case). Remove those. $isin may need quotes around its value (the specific case). Add them if it should have them. As in $isin = "'" . $user_isin . "'"; But $user_isin is a string, right? Not a number? If it is a number then it shouldn't have quotes at all.
-
Switch Windows to Linux, Cannot Modify Header Information Errors
requinix replied to browneandrae's topic in PHP Coding Help
Two different errors. 1. What's at the very beginning of the themes/news/functions.php file? There's something that PHP is outputting - perhaps a UTF-8 bom, or perhaps whitespace before the <?php tag. 2. Does that tmp folder exist on the new machine? If not then create it and set 0777 permissions on it. -
Use DOM to rewrite the HTML. It's not just textareas you have to treat specially: there's scripts, styles, and PREs for starters. And inline CSS is worth mentioning. Oh, and you're removing \s\s+? So if I type two spaces and/or newlines somewhere they're both lost?