
mkoga
Members-
Posts
51 -
Joined
-
Last visited
Never
Everything posted by mkoga
-
no just echo $query.
-
try echoing out the value of $query to get a better idea of the problem.
-
try $query = sprintf("SELECT * FROM table_name WHERE id='%s'", $name);
-
One way would be to use a php file to read the images and serve them to the web page. html file: <img src="image.php?file=filename.jpg" /> image.php: if ($validUser) { // display image to browser header('ContentType: image/jpg'); echo file_get_contents($_GET['file']); }
-
You should check out creating a socket server. http://us2.php.net/sockets
-
There is also a PHP extension to handle this. http://us3.php.net/manual/en/ref.svn.php
-
thanks, i knew about that one. the trick would be to return any key you wanted by index.
-
yeah that would work. i was wondering if anyone had a trick to do it inline. i should probably explain what i'm doing. consider: $fileinfo = $this->input->files('file'); $fileinfo would then contain the info for an uploaded file named 'file'. however, it'd be nice if it were possible to do something like this: $filename = $this->input->files('file')['name']; i suppose i could convert $GLOBAL to an object, but that's just more work. if it's not possible, that's cool, just thought i'd ask.
-
Does anyone know of a way to use a returned array inline? For example: //$this->getList() returns an array $item1 = $this->getList()[0]; Don't know if this or something like it is possible, but it'd be pretty cool.
-
sorting table data with JavaScript when data is stored in MySQL DB
mkoga replied to webguync's topic in PHP Coding Help
not sure if it's just the posting, but line 37 should be: foreach ($row as $heading => $column) { -
what's the url of the page with the timer on it?
-
that depends on what you're doing. i prefer javascript because you don't need a plugin to run it and it has smaller file sizes.
-
sorting table data with JavaScript when data is stored in MySQL DB
mkoga replied to webguync's topic in PHP Coding Help
are you trying to do the sorting client side or with php? -
sure, but the cron would just in turn execute a php script. so i'm thinking have a cron run once a day to execute this little email queue. the email queue would then iterate through each email that needs to be sent, sleep(10) then goes on to the next email. when the queue is complete, the script ends.
-
same basic idea as i had mentioned. here's one way to generate a short unique url. $unique_url = dechex(microtime() * time()); i'm sure theres room for collisions, but it's a start.
-
wouldn't that defeat the purpose of a cron job?
-
Seems pretty easy to create. You just have to generate a unique url for a user submitted url. When this unique url is hit on your site, search the db for the mapped user submitted url and use header() to redirect to it. You should probably do a 301 redirect.
-
Make sure that all your images, css, and javascript files are being loading in with a https as well. If not, you will get a message saying that your page is not totally secured.
-
Try changing the paths to css files and images to absolute paths.
-
I think I understand what you're going for here. If you want to just encrypt the link, you just need to find a two-way encryption algorithm. I've used mcrypt in the past, it works just fine. So for instance http://www.example.com/images/encryptedlink, just decrypt "encryptedlink" and use that to determine what image to serve and check to see if the request is coming from your domain.
-
not the prettiest, but: $file = dirname(dirname(dirname(__FILE__))) . "myfile.php";
-
You're definitely open to do what you want, but here's a suggestion. Server logs are generally stored in a text file in real time. I've used this script here: http://www.hotscripts.com/Detailed/53017.html to parse through the logs and extract only the data I want. This can be done once a day or as often as you want. This is better than saving to a text file every time someone views a webpage. Also this is essentially what the web server is doing every request anyway.
-
It might be simpler to query for your members, then run another query for their items.
-
It seems like you're trying to re-create the server logs. You should check those out to see if it has everything you need.