|
Battle Bott posted:Which is exactly what I'm doing. I don't want to serve files, I want to *execute* them, and if they don't execute, I want to pass them on.
|
# ¿ Jun 16, 2009 01:17 |
|
|
# ¿ May 16, 2024 21:01 |
|
drcru posted:I'm storing a list of integers in a comma separated textfield on MySQL and then explodin them into an array. I then check through a list of 25 integers and see if they are on the original list. Is there a better way to do this?
|
# ¿ Jun 18, 2009 05:08 |
|
drcru posted:How come it won't let me overload this function with time()? I seem to be able to do it with array()...
|
# ¿ Jun 23, 2009 08:56 |
|
You could do something like this instead, though:php:<?php public function get_foo_bar($cutoff = false) { if ($cutoff === false) { $cutoff = time(); } } ?>
|
# ¿ Jun 23, 2009 14:35 |
|
Doesn't mysqli force you to bind variables?
|
# ¿ Jul 1, 2009 06:11 |
|
Golbez posted:just to realize that bind_param probably doesn't work that way; for it to work, I'll have to load all of those getDatas into individual variables, then bind THOSE. Yet I still want to have a secure input; back to mres() for me, I guess. Oh, and a new one: Apparently mysqli_bind_param doesn't support NULLs! Well that's just loving great. So now I have to dynamically edit the query as well?
|
# ¿ Jul 1, 2009 07:19 |
|
SpoonsForThought posted:I'm new to php so I'll answer these the best I can. (and of course, don't leave that script there, remove it when you're done)
|
# ¿ Jul 9, 2009 00:50 |
|
Begby posted:What do you mean by faster? Like take less processor time? Or do you mean that with ++$i you will see $i incremented within the statement, while $i++ sees the value incremented afterward? If you mean the latter that is by design and how it works in all languages that support the ++ operator. (pre-increment doesn't copy a value where post-increment does) gibbed fucked around with this message at 03:55 on Jul 13, 2009 |
# ¿ Jul 13, 2009 03:33 |
|
I wouldn't spit out raw binary to a browser for it to resubmit, you should probably encode it somehow (base64, for example).
|
# ¿ Jul 13, 2009 07:11 |
|
Grawl posted:
Grawl posted:
Grawl posted:
|
# ¿ Jul 17, 2009 19:53 |
|
duz posted:Good news! There's a secure image upload script written by R1CH in the first post!
|
# ¿ Jul 17, 2009 20:10 |
|
supster posted:
readfile Edit: ignore this stupid advice gibbed fucked around with this message at 00:38 on Jul 21, 2009 |
# ¿ Jul 20, 2009 23:54 |
|
supster posted:readfile is avoided for the same reason
|
# ¿ Jul 21, 2009 00:38 |
|
Just read the code. Internally readfile() opens a handle to the file then uses passthru on the handle. The passthru code attempts to mmap the file and writes it out in that case, otherwise it reads the file in 8192 byte chunks and writes them out. So, I'm assuming the problem here is buffering rather than readfile itself, because readfile itself is fine.
|
# ¿ Jul 21, 2009 00:46 |
|
It's ideal to not use up more resources than you have to, even if the amount of resources are insignificant.
|
# ¿ Jul 21, 2009 01:36 |
|
haywire posted:Dear PHP devs, what in the logic is removing the <?= shortcut along with the the <? shorttag? The <?= will not be confused with <?xml, and it is very useful for using php to template.
|
# ¿ Aug 20, 2009 01:45 |
|
It's the equivilent of:php:<? if ($field === TRUE) { $field = $this->any_field; } ?>
|
# ¿ Aug 25, 2009 14:22 |
|
argz posted:what? gibbed fucked around with this message at 04:07 on Aug 29, 2009 |
# ¿ Aug 29, 2009 04:03 |
|
http://www.php.net/manual/en/book.ssh2.php
|
# ¿ Sep 10, 2009 07:04 |
|
haywire posted:Is there any way to make php's shell_exec thing pretend to be a tty? Git is irritating as gently caress to work with from php. Does passthru do this?
|
# ¿ Sep 12, 2009 18:27 |
|
preg_replace("/\r?\n|\r/", "\n", ...)?
|
# ¿ Apr 23, 2010 21:36 |
|
As long as you're sanitizing the input file name it should be okay, although I would add a base path to the $filename and also check if the file exists too.
|
# ¿ Apr 26, 2010 15:35 |
|
eHacked posted:Hate to ask this, it's probably stupidly easy. php:<? // $content is the XML content, obviously $root = new SimpleXMLElement($content); $names = $root->xpath('/previewroot/content/names/name[@name="jpg"]'); var_dump((int)$names[0]['num']); ?>
|
# ¿ Jul 10, 2010 06:49 |
|
I've always figured it's imageSX and imageSY (as in, image size x, image size y).
|
# ¿ Aug 8, 2010 23:26 |
|
DholmbladRU posted:I am attempting to create an update profile page on thie website, however I am having some trouble keeping multiple forms on the same page from affecting each other. (I'm assuming this is an actual mistake made in your original code)
|
# ¿ Aug 11, 2010 03:29 |
|
|
# ¿ May 16, 2024 21:01 |
|
PHP can open any size file the file system can handle, loading the file data into memory is what you're concerned about, and depends on the memory limit settings in php.ini.
|
# ¿ Dec 10, 2010 10:39 |