Search found 136 matches

by aliasxneo
Wed Aug 27, 2008 10:20 pm
Forum: PHP - Code
Topic: Get file size on remote file
Replies: 2
Views: 298

Re: Get file size on remote file

Thanks but I found a better method:

Code: Select all

$headers = get_headers($url, 1);
$length = $headers['Content-Length'];
For anyone else interested.
by aliasxneo
Wed Aug 27, 2008 12:30 am
Forum: PHP - Code
Topic: Get file size on remote file
Replies: 2
Views: 298

Get file size on remote file

Is it possible to get the size of a remote file? E.g:

Code: Select all

<?php
 
$file = "http://www.mysite.com/file.zip";
 
$size = getRemoteSize($file); // How to get the size?
 
?>
Anyone know how?

Regards,
Josh
by aliasxneo
Thu Aug 21, 2008 10:37 pm
Forum: PHP - Code
Topic: Drupal Or Joomla
Replies: 1
Views: 176

Drupal Or Joomla

Hey, I wanted to gather some information on Drupal and Joomla so I decided to ask a few questions around a few dev forums. Please only answer these questions if you have at one time used Drupal or Joomla (this includes customizing and making additions). 1) Which did/do you use? 2) Why did/do you use...
by aliasxneo
Mon Jul 21, 2008 5:34 pm
Forum: PHP - Code
Topic: PHP/MySQL Date Question
Replies: 4
Views: 189

PHP/MySQL Date Question

Not sure which forum this belongs in since the issue relates both to PHP and MySQL. I have a table in MySQL which uses the MySQL 'datetime' to hold dates. What I need to do is basically compare those dates to a Unix timestamp and determine if they are after the Unix timestamp I'm comparing too. The ...
by aliasxneo
Tue Jun 17, 2008 12:51 pm
Forum: PHP - Code
Topic: Setting up a Cron
Replies: 5
Views: 397

Re: Setting up a Cron

I'm assuming your php script fails only when invoked via the web server. If true, it's paramount to determine which user owns the process that is invoking your php script. If your server uses mod_php, it will be the user that also runs the web server. If php is invoked via cgi, it will most likely ...
by aliasxneo
Tue Jun 17, 2008 12:16 pm
Forum: PHP - Code
Topic: Setting up a Cron
Replies: 5
Views: 397

Re: Setting up a Cron

This may not be a PHP code problem but a user permissions one. If your script is being invoked via mod_php, it's being run with the same user name as the web server. Therefore, the crontab command would be executed for that user. I can run crontab -l though. I figured if I could run that I have per...
by aliasxneo
Mon Jun 16, 2008 8:56 pm
Forum: PHP - Code
Topic: Setting up a Cron
Replies: 5
Views: 397

Setting up a Cron

I'm a little familiar with Cron and setting it up on PHP but for some unknown reason I simply cannot get the job to run. Here is my PHP code: $command = "* * * * * /usr/local/bin/php /home/joshg/public_html/test.php"; $cron_file = "/home/joshg/public_html/cron/cronexec";   if (fi...
by aliasxneo
Fri May 30, 2008 12:02 am
Forum: PHP - Code
Topic: Iterating arrays and DOM
Replies: 4
Views: 348

Re: Iterating arrays and DOM

So can anyone help me with this? Still have the same problem.
by aliasxneo
Wed May 28, 2008 6:26 pm
Forum: PHP - Code
Topic: Iterating arrays and DOM
Replies: 4
Views: 348

Iterating arrays and DOM

Just to clear this up I had an old topic that was asking how to write XML but now that I have a written class and am having problems traversing an array I've decided to make a new topic. Anyways, essentially I'm trying to iterate through an array of array's (I'm assuming there can be an infinite num...
by aliasxneo
Tue May 27, 2008 11:01 pm
Forum: PHP - Code
Topic: Best method for writing XML
Replies: 4
Views: 276

Re: Best method for writing XML

Okay so I'm trying to loop through an array structure (associative arrays) trying to create the XML equivalent. Here's my attempt: <?php   class XMLGen {     private $data;         private $xml;     private $lastEle;         function __construct($data)     {         $this->data = $data;     }       ...
by aliasxneo
Tue May 27, 2008 5:00 pm
Forum: PHP - Code
Topic: Best method for writing XML
Replies: 4
Views: 276

Re: Best method for writing XML

Your post is exceptionally vague so I'll give you the answer to the question you asked. It will most likely not be the answer you want. If it's not then take in to consideration how you ask your questions as it will determine what (if any) input you recieve back from others. <?php // include what y...
by aliasxneo
Mon May 26, 2008 11:06 pm
Forum: PHP - Code
Topic: Best method for writing XML
Replies: 4
Views: 276

Best method for writing XML

I need the best method in PHP for creating XML. Essentially I need to turn a result from MySQL into XML. I'm really not sure the best way to go about doing this though. While DOM looks pleasing, it seems like there's a much simpler way to just go from a nice MySQL result to XML.

Any pointers? Thanks.
by aliasxneo
Mon May 26, 2008 6:49 pm
Forum: Regex
Topic: RegEx Match Help
Replies: 3
Views: 848

Re: RegEx Match Help

I think if you switch the order and add a [L], that should do it. Otherwise, I can help you with a new reg-ex.   RewriteEngine on RewriteRule ^([A-Za-z].*)/\?(.*) index.php?query=$1&get=$2 [nc, L] RewriteRule ^([A-Za-z].*)$/ index.php?query=$1 [nc]   What's the L do? I switched the order and no...
by aliasxneo
Mon May 26, 2008 5:40 pm
Forum: Regex
Topic: RegEx Match Help
Replies: 3
Views: 848

RegEx Match Help

I'm using some rewrite rules that look like this: RewriteEngine on RewriteRule ^([A-Za-z].*)/ index.php?query=$1 [nc] RewriteRule ^([A-Za-z].*)/\?(.*) index.php?query=$1&get=$2 [nc] Here's what should happen: http://www.mysite.com/test/test1/  produces: http://www.mysite.com/index.php?query=test...
by aliasxneo
Mon May 19, 2008 9:54 pm
Forum: Regex
Topic: Mod Rewrite/RegEx
Replies: 1
Views: 786

Mod Rewrite/RegEx

So I have some rewriting in my .htaccess but I wish to make an exception. First of all, how do I make an exception? What I mean is let's say if the url is pointing to an EXE file than I want it to process like normal and ignore all rewriting rules below it. Here's what I currently have: RewriteEngin...