Re: Re: [PHP] exec() Error

2008-06-26 Thread Jason Murray
Alice,

If you are already set 755 on the CGI, it looks like it might be a webserver
configuration issue.

If you are using Apache (I'm assuming you are) you might want to take a look
at

http://httpd.apache.org/docs/2.0/howto/cgi.html#configuringapachetopermitcgi

for some hints on how to make sure that the server configuration is proper
for using CGI scripts.

Regards

Jason

On Thu, Jun 26, 2008 at 8:50 AM, Wei, Alice J. [EMAIL PROTECTED] wrote:

 Hi, Todd:

   It looks like I have some other errors in my Perl code, and I got it
 fixed, switched the permission to 755, and made attempts to call it using
 cURL through my working PHP script.

   Here is the code:

 // create a new cURL resource
 $ch = curl_init();

 // set URL and other appropriate options
 curl_setopt($ch, CURLOPT_URL, http://192.168.10.63/total.cgi;);
 curl_setopt($ch, CURLOPT_HEADER, false);

 // grab URL and pass it to the browser
 curl_exec($ch);

 // close cURL resource, and free up system resources
 curl_close($ch);

 This time, I do not get the script output from the script in total.cgi,
 but I got

 Forbidden
 You don't have permission to access /total.cgi on this server.

 I have switched the permission to both scripts at both servers. Is there
 something wrong I have done here?

 Thanks again for your help.

 Alice
 ==
 Alice Wei
 MIS 2009
 School of Library and Information Science
 Indiana University Bloomington
 [EMAIL PROTECTED]
 
 From: Boyd, Todd M. [EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 5:07 PM
 To: Wei, Alice J.; php-general@lists.php.net
 Subject: RE: Re: [PHP] exec() Error

  -Original Message-
  From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, June 25, 2008 3:31 PM
  To: Boyd, Todd M.; Per Jessen; php-general@lists.php.net
  Subject: RE: Re: [PHP] exec() Error

 ---8--- snip

   Well, http://www.mysite.com/calculate.php; is not an executable.
  Try
   this instead:
  
   exec(php path/calculate.php);
 
  I still don't think this is how exec() should be used when executing
  remote PHP scripts via HTTP, since the web server is not going to give
  you the underlying code simply because you're calling the URL from PHP
  and not your web browser. User-Agent tags do not a secure connection
  make.
 
  Perhaps doing a wget and directing it to /dev/null (if you're on *nix)
  would be appropriate to invoke a remote script and pass it parameters.
  Hell, even wget to standard output if you want, and use that as your
  result code. It's basically doing what cURL does, but outside of the
  PHP script itself.
 
  Anyway, I digress. My point is that exec(php
  http://mysite.com/script.php;) will fail, since it will be reading the
  remote script's OUTPUT, and not the remote script's SOURCE CODE.
 
 I dont' know how come his code works either. I figured that exec()
  is not going to get me anywhere when I have it stored remotely.
 I am now using cURL instead of using exec(), since it is doing a
 lot
  closer to what I initiated. I am not sure if I should have a new
 thread
  for this, but I found that things start to get a little weird when I
  tried to do cURL with Perl files inside. The PHP only brings me back
  Perl code and not the processed content. Is this something I should
 not
  be doing with cURL? It seems to do quite a bit of powerful processing
  when I wrote everything in PHP and have it stored remotely.

 Alice,

 If it's returning the code instead of the processed content, then it
 means that the webserver which houses the Perl script is not
 executing/parsing it. You should check with the administrator of the
 remote webserver to see if they have a Perl module installed, and if it
 is configured properly for your web app.

 HTH,


 Todd Boyd
 Web Programmer




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Inspiration for a Tombstone.

2008-06-26 Thread Jason Murray
I'm thinking:

?php
header(HTTP/1.1 410 Gone);
die();
?

Regards,

Jason

On Thu, Jun 26, 2008 at 1:54 PM, David Giragosian [EMAIL PROTECTED] wrote:

  My favorite vi command:

 e! Damn it. e!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Inspiration for a Tombstone.

2008-06-26 Thread Jason Murray
Body not found? Who do you think I am?  Jesus?

On Thu, Jun 26, 2008 at 3:01 PM, Robert Cummings [EMAIL PROTECTED] wrote:
 On Thu, 2008-06-26 at 14:54 -0400, Jason Murray wrote:
 I'm thinking:

 ?php
 header(HTTP/1.1 410 Gone);
 die();
 ?

 What about a 404? :)

 ?php

header( 'HTTP/1.1 404 Body Not Found' );

 ?

 Cheers,
 Rob.
 --
 http://www.interjinn.com
 Application and Templating Framework for PHP



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] changing order of items

2008-05-15 Thread Jason Murray
On Thu, May 15, 2008 at 2:09 PM, afan pasalic [EMAIL PROTECTED] wrote:

 this one bugs me for a while. how to change order.

 I have a list of tasks. by status, task could be 1 (todo) or 0 (done) -
 status value stored in mysql. I can list tasks per status or all.
 order number is stored in mysql too.
 the easiest way to change order is to have form for each task where you
 will enter manually number and then submit (one submit button for whole
 form). but, if you change order number for any task you have to change
 then all order numbers below the task manually

 solution with arrows (or up/down buttons) where you click on arrow and
 the task switch the place with its neighbor is easy and fancy. Though,
 I get in trouble if, e.g. tasks 10, 11, 12, and 13 change status from 1
 to 0 and I have to move task 14 to place 6. I have to click first 4
 times (to switch places with tasks 13, 12, 11, and 10) - but nothing is
 actually happening on screen (of course) before start switching places
 with 9, 8, 7, and 6.

 how do you avoid this gap?
 what solution do you use at all?

 thanks for any help.

 -afan
  http://www.php.net/unsub.php


I am assuming that each time you click the up or down arrow you are
re-loading the page (via a GET request).  A simple solution to this, would
be to adjust the URLs assigned to the up and down arrows to carry an extra
variable, the item either directly above or directly below the one selected,
and instead of doing whole-sale renumbering, create a swap function.  That
just swaps the position of the two items.

example:

?php
$rows = get_items_in_list();
for ($i = 0 ; $i  count($rows); $i ++) {
  echo $rows[$i]['taskname'].nbsp;;
  // create move up link
  if ($i  0) {
echo 'a
href=page.php?this='.rows[$i]['position'].'other='.$rows[($i-1)]['position'].'move
up/anbsp;';
  }
  //create mode down link
  if ($i  (count($rows) -1)) {
echo 'a
href=page.php?this='.rows[$i]['position'].'other='.$rows[($i+1)]['position'].'move
up/abr/';
  }
}
?

Then your page would just have to watch for those two variables being set at
load and select the appropriate items in the database based on the order and
swap their two positions, this will allow you to handle gaps in the
positioning scheme, for example when you are only listing the status 1 items
and not all the items.

*note* The code above is completely off-the-cuff and not tested, don't blame
me if there are any bugs in it ;)

Regards,

Jason


Re: [PHP] Two word array Value

2008-05-14 Thread Jason Murray
Try:

  echo tdinput name=.urlencode($key). type=checkbox
value=.urlencode($value)./tdtd. $value./td;


On Wed, May 14, 2008 at 4:02 PM, Mark Bomgardner [EMAIL PROTECTED]
wrote:

 I am trying to use array's to populate a group of check boxes for a form.
  I
 am getting the checkboxes to print OK, but when the form is posted I am
 only
 getting part of the array.



 Form Page:



 $vars = array(Main Classroom = Main Classroom, Break Out Classroom
 =
 Break Out Classroom, Gym = Gym,

 Firearms Range = Firearms Range, EVOC Track = EVOC Track);





 $cols = 4;

 echo form method=post action=twocoltests.phptabletrtd
 colspan=.$cols. align=centerEquipment Needed/tdtr;

foreach($vars as $key = $value){

  if (($cols % 4) == 0 ){ echo /trtr; }



  echo tdinput name=.$key. type=checkbox
 value=.$value./tdtd.$value./td;

  $cols++;

}



 echo /tr/table;

 echo br /;



 When I submit the form I am only getting the following having checked the
 boxes for Mail Classroom and Break Out Classroom.  If I eliminate the
 spaces
 between the words, I get everything, but when I put the spaces between the
 words in the array, it cuts off the second word.  Not sure what is
 happening?



 Array ( [Main] = Main [Break] = Break [Submit] = Submit )




[PHP] RegEx for a URL?

2003-03-06 Thread Jason Murray
Hi folks,

I'm looking for a regular expression which matches a URL. I've found
several already by looking around various sites, but they don't seem
to accomplish what I'm looking for.

I'm developing a PHP-driven message board / forum system. As a part
of this, of course, I have to give users the ability to put links
in their messages without allowing them to post HTML, so I've settled
on the markup [link=URL]text[/link] (odd how much that looks like
an A tag, I know). There is also an [image=URL] tag which gets 
changed into an IMG tag. Additionally, for user-friendliness, I'd 
like to catch any URLs that are in the body of the text themselves - 
these will be preceded by a newline, a space or will be at the very 
start of the message, so the same RegEx should suffice.

The RegEx's I've tried so far:

1. (From the online PHP manual's user-contributed notes):
   [[:alpha:]]+://[^[:space:]]+[[:alnum:]/]

Works ok for picking out URLs from plain text, but doesn't work with
[link=URL]text[link] ... it seems to eat the closing ] of the [link]
markup and it's all bad from there on out. Works fine though if I 
change the markup rule to [link=URLspace]text[/link], but that's
nonstandard and not very intuitive.

2. (From regexlib.com, long line sorry)
 
(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a
-zA-Z0-9\-\._\?\,\'/\\\+amp;%\$#\=~])*[^\.\,\)\(\s]

Works fine for [link=URL]text[link] and picking URL itself out of 
plain text, as long as URL isn't too complicated. It's happy with
a URL like http://www.shadow.net.au but when that URL has a path
after it, like http://www.game-spin.com/forums/gfx/stars/star1.gif
then it gets real useless, real fast.

If anyone's interested, the board system itself is up and running
on my dev/test server at http://boards.shadow.net.au - you can see
a live version at http://www.auswrestling.com/forum/ and also at
http://www.game-spin.com/forums/. I'll be releasing it soon, and
if someone can give me a working URL RegEx I'd be happy to give
them some credits in the documentation ;)

Thanks in advance...

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] random -n lines array problem

2003-03-06 Thread Jason Murray
 You need to explode() $line.

Won't that still cause problems for him, since explode() will
ignore concurrent separators ()?

Jason

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] random -n lines array problem

2003-03-06 Thread Jason Murray
 Where do you get that from?

Probably from not trying it before I open my mouth. I must 
have dreamed it somewhere, sorry :)

J

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] MYSQL :(

2003-03-06 Thread Jason Murray
 How can I get this to use the next auto_increment of 
 id (Next Autoindex = 52)?

What if you just remove id from your field list?

insert into ccl.ccl_maintest (id,RNum,YR,AU,ST
  ^^^
  Here :)

(Just an idea...)

J

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] phpmysqladmin ? still viable?

2002-05-15 Thread Jason Murray

Go to www.google.com - enter phpMyAdmin - hit I'm Feeling Lucky

:)

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: Erik Gilchrist [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 16, 2002 10:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] phpmysqladmin ? still viable?
 
 
 First off, I am a total newbie to php and DB stuff.  Pardon 
 the intrusion on 
 your busy schedules.  Really.
 
 My host is having a hard time finding phpmysqladmin and he 
 touted this as a 
 solution to my wanting to get into the DB arena as well as 
 php.  Does anyone 
 know where to get it?   All of my evening has now been wasted 
 googling 
 looking for it and perhaps there is a better solution.
 
 And no, I really am out of my game here, but I figured it was 
 a good place 
 to ask.  The only caveat the host said was that it MUST be PHP4.x 
 compatible.
 
 I sincerely apologize for the intrusion if it's not on topic 
 enough.  I know 
 I need to go further in my exploration that the net has via 
 tutorials and 
 PHP manual, but if anyone has time I would sincerely 
 appreciate it.  I have 
 been lurking for a week or two.  Good stuff to be found here.  Indeed.
 
 I could have all the assumptions above all wrong and some bad 
 data/opinions...  sorry.  please explain.  If I am in the 
 wrong place to 
 ask, please tell me where the best place to look/ask is.  I 
 don't want to 
 waste anybodys time.  I surely would not want mine wasted.
 
 BTW-- I am on DIGEST, so a CC: would be appreciated dearly.
 
 TIA.
 Erik
 
 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.com
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] header problems

2002-05-12 Thread Jason Murray

 Can anyone tell me if there is any reason why this would not 
 be working?
 
 mysql_connect($DBhost,$DBuser,$DBpass) or die(header(Location:
 error.php));

Why bother calling die() at all there?

?
   if ($mysql != mysql_connect($DBhost,$DBuser,$DBpass))
   {
 Header(Location: error.php);
 Exit();
   }
?

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: function over loading?

2002-05-12 Thread Jason Murray

  Can you practice function over-loading in php?
 
 No you cannot overload in PHP.

You can achieve the same effect (having the same function do
something else in a different circumstance) by making
parameters optional:

?
   Function functionName($param1, $param2 = )
   {
 ...
   }
?

$param1 is required, $param2 is optional - if its not
supplied when the function is called, it will be .

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Home Finance System / Bill Splitter

2002-04-24 Thread Jason Murray

  I was about to set up a spreadsheet again - but since I've started 
  getting into learning PHP - and have recently set up our home linux 
  server - thought that it would be a lot more exciting / functional 
  to have a system running on the server that would allow each person 
  to log in, track the current bill status, pay a bill, enter new 
  bills, etc.
 
 It seems strange to me why anyone would want to do such a thing.

Actually I did something similar last week for my household (3 people), 
so that we know who paid what bill and thus how much each of us owes
each other in the balance. It was a complicated spreadsheet, and this
way it allows me to set up rules so that person X is excluded from
the calculations for a certain transaction.

Kinda cool, in a geeky way.

Why do it? Because I can. ;)

 And it's even stranger that someone *has* come up with such a thing :)
 I think I saw it on freshmeat.net. 

Oh, damn. :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] is their a way to run a command as root ???

2002-04-24 Thread Jason Murray

 Is their a way to run a command as root..or another user..
 
 I know their are a log of security issues with allowing this.. I will
 tighten down security after I get it to work.

Get your sysadmin to set up sudo so that the user running your
web server (usually nobody, httpd or www) can execute that
one single command, then use PHP's Execute() function.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] SQL Warning

2002-04-23 Thread Jason Murray

 Would you please direct your attention to this URL
 
 http://testphp.netfirms.com/code1.html
 
 Look at the bottom where the big orange commented syntax is 
 and explain what is going on there?

{$config[prefix]}

I think this should be

${config[prefix]}

... also, it's handy to actually echo or print the SQL you're
executing, as you will be able to see if the SQL is correct
or not. 

The error on line 14 occurs because you're trying to execute 
mysql_fetch_array on a mysql result set that doesn't exist. 

The most likely reason it doesn't exist is because the SQL is 
wrong. Echo the SQL and you'll find out whats happening.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP

2002-04-18 Thread Jason Murray

 Mine produced the same error message as yours, Jason, but the memory 
 and CPU usage continued until I hit the 'stop' button on the browser. 
 It seemed to have overridden both time and memory limits, as it had 
 racked up 320 megs of my RAM by the time I stopped it.

It certainly didn't do that here, but it could be a difference between
RAM, PHP and Apache versions (simple paranoia ;)) that causes it. 

PHP clearly sent the error *to my browser* and the browser stopped loading
immediately (thus, the fatal error was indeed fatal, and PHP terminated
at that time).

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP | Windows only?

2002-04-18 Thread Jason Murray

 I'd be interested in knowing your versions and the versions 
 of the first guy that posted about this. Maybe he has the same 
 setup as me, or close enough, but both of us are different 
 from you. 

Actually, I just thought about it - maybe you guys are both running
it on Windows (shame on you ;)).

I *have* actually seen PHP bring down IIS with a setcookie command.
Since a setcookie issues headers, I thought fine, screw you, I'll
set the headers myself, and it STILL brought IIS down. And indeed,
the load *did* skyrocket and require a reboot of the server.

I asked around here at the time if anyone had experienced this (look
through the mailing list archive to find it) and at the time got
more of a congratulatory salute from the list members than any real
responses :)

Maybe this is more of a PHP-on-IIS issue than an actual security
issue in PHP.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP | Windows only?

2002-04-18 Thread Jason Murray

 I know what you are saying. I've taken down apache on win32 
 with setcookie
[snip]
 I'm pretty sure they ran PHP on apache, not IIS. Maybe this 
 problem is only with the win32 version of the PHP module.

Yep, apparently I can't read. Apache, IIS, same header() probs.

 Nonetheless, a bug is still a bug. It would be nice if it 
 wasn't there=)

Agreed! :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP

2002-04-17 Thread Jason Murray

 I have found something interesting that can kill the server. 
 I'm not sure if this is because of Apache or PHP. If you use 
 PHP to send a header() inside of a while loop, the httpd 
 process will begin to use massive CPU and Memory until it is 
 killed, or the server is killed. Here is what I used:
 
 ?
   while(01) {
 header(A);
   }
 ?

Umm, but, this is an infinite loop. It won't stop executing.

Actually, it *should* stop executing once PHP hits its maximum
execution time limit (usually 30 seconds).

If you code something like this into pages, you've got bigger
problems than a DoS attack.

It's also not strictly a DoS since you'd be doing it to yourself
if you ran this code. Of course, if you're silly enough to let
visitors to your website upload and execute arbitrary code then
there are, again, bigger problems (such as possibly comprimising
root access, fetching /etc/passwd and guessing passwords, or 
getting access to other sensitive information on your file 
system).

Unless there's something specifically bad about the Header()
command (you didn't make it clear if this is what you were
talking about), inifinite loops are, in general, bad.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP

2002-04-17 Thread Jason Murray

 It does not stop after its execution time.

Is your PHP actually configured to stop running after 30 seconds, 
though? Its the default, but you may have overridden it.

 We have let this run for 10+ minutes to see if it would crash the 
 server, and it did. 

Is it possible you're called set_time_limit() to increase the
script's timeout and thus allow it to run?

 It does not affect the person that loads the code in the browser, 
 just affects the server running the code.

Well ... yeah. This is not surprising :p :)

Either way, the fact still remains it's an infinite loop and you
just shouldn't write it. :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP

2002-04-17 Thread Jason Murray

 It's a default PHP installation. We aren't calling set_time_limit(). 
 I know its an infinite loop, the point is that if a user wanted to 
 attack a server (happens every day) they would be able to use this 
 method to take the server down.

But, if the user has enough access to the server to place files on it,
then they can do much, much worse stuff than running an infinite loop 
in PHP. Like I said, if it gets to that point you have bigger problems.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP

2002-04-17 Thread Jason Murray

 If the user has enough access to the server to place files on it ?
 
 There are hosting places that have PHP and you can just upload the PHP
 script through FTP and access it in your browser.

... in which case all you'll accomplish is taking out your own server,
which is not a DoS attack. :)

(This is also why its very hard to find free servers with PHP on them)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP

2002-04-17 Thread Jason Murray

 A big if, since the OP has not yet verified that the time limit and 
 memory limit are in effect at the outset of the loop as supposed.  
 Someone else want to test for this scenario?  Someone, that is, who 
 can deliberately bring down their server without getting kicked 
 off permanently?

Done. Result:

Fatal error: Maximum execution time of 30 seconds exceeded in
/usr/local/apache/virtual/misc/random.phpdev.mit/htdocs/index.php on line 3

Server: Apache/1.3.12 (Unix) PHP/4.0.6

I think that kind of closes this case...

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Nasty DoS in PHP

2002-04-17 Thread Jason Murray

 So that was both as an Apache mod and a CGI binary?  Sounds like it's 
 reproducible. 

Running as an Apache module here, it terminated as expected at 30 seconds.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Banning javascript?

2002-04-08 Thread Jason Murray

Use strip_tags and only allow basic HTML (basic HTML can be anything
but I'd make it BIUDIVSPANSTYLETABLETRTD) through.

This will strip all SCRIPT tags.

J

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 09, 2002 1:36 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Banning javascript?
 
 
 I want to ban javascript from my site (users can edit some 
 things).  I know
 how to ban it in script tags, but does anyone have a 
 function that bans
 javascript in ALL of the ways of puting it on?  It would take 
 me a while to
 figure them all out. 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Returned e-mail (PHP mail function)

2002-04-04 Thread Jason Murray

You can specify a From: field in the extra headers area of 
the mail() function. Additionally, you can specify the address 
you want bounces sent to by the same method (I think it's 
bounces-to or something like that).

J

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: Martin Towell [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 05, 2002 3:24 PM
 To: 'Anthony Rodriguez'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Returned e-mail (PHP mail function)
 
 
 I believe the default from address is the user of the process 
 that sends the
 email, in this case, the web server.
 
 (your isp's sys admins are going to be happy with you if 
 you have too many
 bounced emails.)
 
 -Original Message-
 From: Anthony Rodriguez [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 05, 2002 2:04 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Returned e-mail (PHP mail function)
 
 
 I just send my ISP the following question:
 
 One of my PHP scripts automatically sends a Thank You 
 e-mail to users who 
 just registered. I use PHP's mail function.
 
 If, during registration, the user enters the wrong e-mail address the 
 e-mail would, of course, be returned.
 
 Who is the e-mail returned to? PHP's mail function, as far as I know, 
 doesn't have a From field.
 
 Any comments?
 
 Thanks!
 
 Anthony F. Rodriguez
 ([EMAIL PROTECTED])
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Returned e-mail (PHP mail function)

2002-04-04 Thread Jason Murray

Actually, having just checked through a message from Yahoo 
Groups' list server, I think you'll find it's Return-Path.

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: Jason Murray [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 05, 2002 3:27 PM
 To: 'Martin Towell'; 'Anthony Rodriguez'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Returned e-mail (PHP mail function)
 
 
 You can specify a From: field in the extra headers area of 
 the mail() function. Additionally, you can specify the address 
 you want bounces sent to by the same method (I think it's 
 bounces-to or something like that).
 
 J
 
 -- 
 Jason Murray
 [EMAIL PROTECTED]
 Web Developer, Melbourne IT
 Work now, freak later!
 
  -Original Message-
  From: Martin Towell [mailto:[EMAIL PROTECTED]]
  Sent: Friday, April 05, 2002 3:24 PM
  To: 'Anthony Rodriguez'; [EMAIL PROTECTED]
  Subject: RE: [PHP] Returned e-mail (PHP mail function)
  
  
  I believe the default from address is the user of the process 
  that sends the
  email, in this case, the web server.
  
  (your isp's sys admins are going to be happy with you if 
  you have too many
  bounced emails.)
  
  -Original Message-
  From: Anthony Rodriguez [mailto:[EMAIL PROTECTED]]
  Sent: Friday, April 05, 2002 2:04 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Returned e-mail (PHP mail function)
  
  
  I just send my ISP the following question:
  
  One of my PHP scripts automatically sends a Thank You 
  e-mail to users who 
  just registered. I use PHP's mail function.
  
  If, during registration, the user enters the wrong e-mail 
 address the 
  e-mail would, of course, be returned.
  
  Who is the e-mail returned to? PHP's mail function, as far 
 as I know, 
  doesn't have a From field.
  
  Any comments?
  
  Thanks!
  
  Anthony F. Rodriguez
  ([EMAIL PROTECTED])
  
  
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Strange entries in logfiles?

2002-04-03 Thread Jason Murray

Hi folks,

I've noticed strange entries like this in Apache's general
error log. Is anyone able to shed any light on what's
going on...?

/export/petert/src/php-4.0.6/ext/standard/php_smart_str.h(69) :  Freeing 
0x0046A0C0 (164 bytes), script=/path/to/script/that/was/run.php
Last leak repeated 5 times

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] reading excel file

2002-04-02 Thread Jason Murray

 Has anyone ever converted an excel file over to a MySQL database 
 via PHP? I'm currently doing it with perl, and this isn't a very 
 good option for me. The client needs to login to a server via ssh 
 every time they want to put data from their excel file to mysql. 
 I'd like to find some way to do it through a web browser.

If you can get them to save the Excel file as tab-delimited, you
could just read it, explode on \t and assemble your SQL insert
statements.

Failing that, you could continue to use the Perl script but accept
the Excel file as a HTTP upload, and have PHP run the Perl script.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] reading excel file

2002-04-02 Thread Jason Murray

 Thanks Jason, that is a pretty good idea.  Any idea how well 
 PHP handles large ammounts of data like that?  There'll be about 
 25,000 lines in every excel file, and they come in groups of 5 or 6.

I've rigged up an import script for similar functions before, it
seems to run ok... it really depends on the specs of the server
you're running it on. If you notice slowness, consider raising
the timeout by X seconds per Y lines, then you can judge the
size of the incoming file and change how long PHP gets to run.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] reading excel file

2002-04-02 Thread Jason Murray

 If it's possible, it probably better to deal with each line 
 by itself, rather than try to load to whole file into memory.

Good point. Shared server admins probably hate me. ;)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP that will help me color code, code; like C++ on a HTML page?

2002-04-02 Thread Jason Murray

I think this might be what you're looking for:

http://www.php.net/manual/en/function.highlight-string.php

J

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: Michael Zornek [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 3:17 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP that will help me color code, code; like C++ on a
 HTML page?
 
 
 As you may see from the footer I run a dev site. I'm 
 interested in finding
 some PHP that will help me show color syntax-ed code in html.
 
 like you could imagine a tutorial about Obj-C .. and code 
 snippets. I'd like
 to have those snippets color coded for Obj-C syntax.
 
 anyone know if this is possible? or more so, already written?
 
 ~ Mike
 -- 
 Mike Zornek | Project Leader
 Apple Student Developers
 The Insanely Great Site with the Insanely Long URL
 http://www.applestudentdevelopers.org
 
 Personal Site: 
 http://www.mikezornek.com
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] New php functions?

2002-04-01 Thread Jason Murray

 It begs the question, why don't you just download the manual? 
 It's available in a myriad of different formats, one of which 
 must suit you. It may not be bang up-to-date and it may not have 
 the (sometimes) useful user comments but it sure saves you a lot 
 of time and bandwidth.

Heheh ... well, for one, it's not my bandwidth :) And the time it
takes to open a new browser and type www.php.net/date and download
the page is a lot faster than the amount of time it'd take to find
out where the heck I put the downloaded document, then find the
right page / entry / etc... :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] New php functions?

2002-04-01 Thread Jason Murray

 I've got the PHP manual as a series of hyper-linked HTML 
 pages.  Searchig is is very fast.  And, I don't need to wait 
 for download of single page.

Each to their own, each to their own ... :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Variable Appended To The End of a URL Is Not Working in SQL Query

2002-04-01 Thread Jason Murray

I'd say $id is blank, not being passed in, or is equal to a 
nonexistant IDArt.

Maybe you should echo out your SQL and run it manually to see
what's going on.

J

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: Dr. Shim [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 02, 2002 2:41 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Variable Appended To The End of a URL Is Not Working in
 SQL Query
 
 
 I have a variable which is appeneded to the end of a URL, like
 
 http://www.your_web_site.com/your_page/?your_variable=your_value
 
 This would return your_value;
 
 echo $your_variable;
 
 But this wouldn't work, and returns an error
 
 $sql = SELECT * FROM fldField WHERE IDField =  . $id;
 
 
 What could possibly be wrong? If you need more info, then 
 tell me. Here's my
 code:
 
 ?php
  $db = @odbc_connect('ReviewDatabase', 'root', '') or exit)(Error
 occured:br$php_errormsg);
  $sql = SELECT * FROM tblArt WHERE IDArt = $id;
  $cursor = @odbc_exec($db, $sql) or exit (Error
 occrued:br$php_errormsg);
  odbc_close($db);
 ?
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] New php functions?

2002-03-27 Thread Jason Murray

 I went to php.net wnating info on the date() function.  To my 
 surprise the word date was already in the search for field.  

It was probably the last thing you looked for there. I know I
constantly go back to look up Date() placeholders. :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Help! Recent PHP security patch = high server load?

2002-03-27 Thread Jason Murray

Hi folks,

Just curious to know if anyone has experienced a high server
load since installing the recent security patch to PHP 4.0.6?

Our Production team is reporting that the web servers running
www.melbourneit.com.au are currently running at a load average
of 30+, and this has been the case since the security patch 
was installed.

These servers are Sun 420's running Solaris SunOS 7, 1 Gig 
RAM, Apache 1.3.19, Apache JServ 1.1.2, PHP 4.0.6 + patch so 
you can imagine how we're surprised at the high load on them...

Has anyone else experienced this or similar? 

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Any PHP equivalent of Macromedia ColdFusion's location tag?

2002-03-26 Thread Jason Murray

 Is there any PHP function that works like ColdFusion's location tag?
 After a certain execution, I wish to leave the current PHP 
 page entirely and go to another page.  Is this possible?

That's a HTTP Header, so you want to use the ... Header() command.

A Location header is what does the redirection.

?php Header(Location: http://url.of.site/path/to/file.html;); ?

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Any PHP equivalent of Macromedia ColdFusion's location tag?

2002-03-26 Thread Jason Murray

Or, alter your page's structure so that it writes its output into a 
buffer, and echo/print it at the end of the page. That way you can
do the redirect at any point it's needed within the page logic.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: webapprentice [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 27, 2002 4:25 PM
 To: Rasmus Lerdorf
 Cc: James; Jason Murray; [EMAIL PROTECTED]
 Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's
 location tag?
 
 
 Hi Mr. Lerdorf,
 I look forward to you upcoming O'Reilly PHP book. =)
 
 Yes, a META tag refresh or Javascript control seems to be the 
 only way left.
 Strange that URL redirection is so unusual to implement in 
 PHP compared to
 ASP or Coldfusion (unless they do something klunky under the hood).
 
 Anyway, I also noticed that when the manual says you cannot 
 output ANYTHING,
 I found out that if I close out all my spaces in the PHP page 
 by tightening
 the php container tags, I will not output anything first.  I 
 forgot that
 even whitespace would be considered a web page and would generate http
 headers (since the PHP processor probably translates whitespace as
 echo/print statements).
 
 Thanks.
 
 --Stephen
 
 - Original Message -
 From: Rasmus Lerdorf [EMAIL PROTECTED]
 To: webapprentice [EMAIL PROTECTED]
 Cc: James [EMAIL PROTECTED]; Jason Murray
 [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Wednesday, March 27, 2002 12:01 AM
 Subject: Re: [PHP] Any PHP equivalent of Macromedia 
 ColdFusion's location
 tag?
 
 
  So use a Javascript meta-refresh
 
  On Wed, 27 Mar 2002, webapprentice wrote:
 
   Hi,
   Thanks for the reply.  I saw this as well in the mailing 
 list archives,
 but
   everyone is saying you cannot output ANYTHING before 
 calling header.
  
   Unfortunately, I'm calling this at the end of a process, 
 so it won't
 work.
   It tells me I've already sent out header information.
  
   I've basically created a single PHP page with a form.  
 When the form is
   submitted, it submits to itself.  It checks if the form 
 is submitted,
 and
   then goes to mail the contents to someone.  After 
 mailing, I want to go
 to a
   Thank You page.  I want to get away from this PHP page, 
 because I don't
 want
   a person refreshing the page and causing the PHP page to 
 submit again.
  
   Thus, is there something else I can do?  Or am I just not 
 seeing this?
  
   Thanks,
   Stephen
  
  
  
  
   - Original Message -
   From: James [EMAIL PROTECTED]
   To: webapprentice [EMAIL PROTECTED]
   Sent: Tuesday, March 26, 2002 10:20 PM
   Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's
 location
   tag?
  
  
header(Location: http://www.google.com;);
replace that url with the page you want it to go to
   
   
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] $PHP_SELF in include files

2002-03-12 Thread Jason Murray

 ?php
 function questions()
 {
[snip]
 a href=?php echo $PHP_SELF??page=questionsfont
[snip]
 }
 ?

$PHP_SELF is unknown to the function questions().

You'll need to add global $PHP_SELF at the top of the function.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] \n Seems not to work fine

2002-03-12 Thread Jason Murray

 I cannot get a breakline or line appart with \n with printf or print,
 I've to use always BR.
 \n shows only a space.

HTML does not break lines on newlines in the source code. That's
why BR is there. 

If you look at the source code, you'll see there is a newline in 
the source. Remember that HTML source code tells the browser how
to render the page.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Userfriendly

2002-03-07 Thread Jason Murray

 Does anybody know of a php script that will email the daily 
 userfriendly.org comic?

Why not write one yourself? Most of the file names can be guessed,
today is http://www.userfriendly.org/cartoons/archives/02mar/uf004027.gif
for example.

By the way...

 Josiah Wallingford
 Email = [EMAIL PROTECTED]
 Mailing lists:
 PHP General - [EMAIL PROTECTED]
 BBEdit Talk  - [EMAIL PROTECTED]
 BBEdit Web Authoring - [EMAIL PROTECTED]
 ICRadius - [EMAIL PROTECTED]
 Linux Newbie - [EMAIL PROTECTED]
 MySql - [EMAIL PROTECTED]
 Messenger Services:
 (MSN Instant Messenger = josiahlizzard)
 (ICQ # 150522268)
 (Yahoo Instant Messenger = josiahwallingford)
 (AIM American Online Instant Messenger = JosiahWalling)
 Web Pages:
 www.josiahw.com
 www.pooponwindows.com
 www.mymysql.com
 www.bigbirdlinux.com
 www.sofast.net
 www.darwinduck.com

... could you please use a *slightly* less obnixously long
signature when you post to the list? Signatures aren't
supposed to be over 4 lines (and if we want to know your
AIM/ICQ/MSN/Y! ID's, we'll ask you).

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] php, text file, and mysql

2002-03-07 Thread Jason Murray

 But for storing images and PDFs or other binary data, there's 
 no other way.

Actually, after having some problems with BLOB columns when 
mysqldump'ing and moving the data into a new database, I did
find another way. I borrowed a trick from MIME mail handling,
and base64_encod'ed, then chunk_split'ed the data. This makes
it very text-field friendly.

 Note that many MySQL wizards will recommend that instead of 
 storing binary data in a database, use a filesystem to store 
 the data and then use the database to create a sort of 
 directory for quickly locating those files in the filesystem, 

There's a problem with this, it assumes that you only use one
filesystem for your site. In the case of Melbourne IT / INWW,
we have 5 or 6 web servers that load balance. If a user uploads 
data and we copy it to the filesystem, then it's only available
on 1 web server. This is why we put it in the database. :)

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] A silly question. :P

2002-03-07 Thread Jason Murray

 I would like to know why you put this character (!) in front of this:

An ! means that the following statement should be false. So:

if (!isset($variable))

means If $variable is not set

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Calling a Variable in a weird Way

2002-03-06 Thread Jason Murray

 for ($i=1; $i  12; $i++) {
   echo state_$i;  // This would print out either Yes No or Maybe.
 }

What you actually want is:

for ($i=1; $i  12; $i++)   
{
  $mystate = state_.$i;
  echo $$mystate;  // This would print out either Yes No or Maybe.
}

$$X tells PPH to use the value contained in the variable named $X.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] OOP .. I just don't get it.

2002-03-05 Thread Jason Murray

 As you said:
 
  OOP had answer to all of this. Modules that can't be touched, 
  which exist by themselves. You could really get a module from 
  somebody else and put it right into your program. 

general bitch mode
The problem I have with this is that when I do this, the class
just plain doesn't work (shoddy coding). For example, let's look
at MIME-encoding attachments to emails. I downloaded about 3 or 4 
classes and tried to get them to work (using their own example
code). Bzzt. Nothing, nada, syntax errors and logic errors 
everywhere.

In the end I went back to the book which recommended the classes,
and wrote functions to accept an array of filenames to attach to
the email body using the logic in the book.
/general bitch mode

Apparently everyone I've sent my function to finds it a lot
easier to integrate and use :)

Maybe the quality of existing freely-available PHP OOP-based 
code just ain't there.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] case insenstive

2002-03-04 Thread Jason Murray

 I need to make this case insensitive. This seems like over kill?
 
 if((substr($author, 0, 1) == a) or (substr($author, 0, 1) == a))
 {
 }

if((strtolower(substr($author, 0, 1)) == a)
{
}

:)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] convert to lowercase

2002-03-03 Thread Jason Murray

 What is the code to make a string into lower case?

Could you please check the manual before you ask like this?

It's strToLower().

http://www.php.net/strtolower

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Hyperlinks vs Buttons

2002-02-20 Thread Jason Murray

 Is there a way to regular hyperlinked text to submit a form?
 
 For example, rather than having a button that says [Login], I 
 just want underlined text: Login

You can use JavaScript on that link. An onClick event 
which triggers document.formname.submit() would work,
but then you lose backward compatibility (and thus
accessibility) with non-JavaScript browsers.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] using sendtohost on a secure site

2002-02-20 Thread Jason Murray

 The function sendtohost:
[snip]
 Is great for posting results to a regular http site.  But 
 what I need to do is post to a secure site (https).  

At that point, you'll want to look into using CURL extensions
to PHP.

http://www.php.net/manual/en/ref.curl.php

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Formatting problem

2002-02-19 Thread Jason Murray

Your problem is a simple HTML formatting problem - your FORM
submit button is inside your TABLE but outside a TD (it's
after the final /TR), thus Netscape puts it above the table
entirely.

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 19, 2002 10:23 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Formatting problem
 
 
 I feel kinda dumb for posting this but here it is... I am 
 trying to query a
 table then format the results so it looks like the rest of 
 the site and the
 darn delete button to remove db entries keeps showing up at 
 the top.  Here
 is the code... Thanks in advance.
 Jas
 ?php
 require '../scripts/db.php';
 $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
 execute query, please try again later);
 echo table border=\0\ class=\table-body\ width=\100%\form
 name=\rem_inv\ method=\post\ action=\done2.php3\
 trtd align=\center\ colspan=\2\font size=\4\BCurrent
 Inventory/B/fonthr color=\33\/td/tr;
 $count = -1;
 while ($myrow = mysql_fetch_row($result)) {
 $count ++;
 echo trtd width=\30%\BType Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_type));
 echo /tdtdinput type=\checkbox\ name=\car_type\
 value=\checkbox\remove/td
 /tr\n;
 echo trtd width=\30%\BModel Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_model));
 echo /td/tr\n;
 echo trtd width=\30%\BYear Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_year));
 echo /td/tr\n;
 echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
 printf(mysql_result($result,$count,car_price));
 echo /td/tr\n;
 echo trtd width=\30%\BVIN Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_vin));
 echo /td/trtrtd colspan=\3\hr 
 color=\33\/td/tr\n;
 }
 echo input type=\submit\ name=\delete\
 value=\delete\/form/table;
 ?
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] A function that turns special charcters into html codes?

2002-02-19 Thread Jason Murray

 I'm looking for a function that turns special charcters into 
 html charcter codes ( into quot;).  Is there one?

Please try the manual before you ask here.

If you'd looked, you'd have found the function:
 
  html_special_chars()

... which you'll note is named extremely closely to the 
wording you used in your question, and thus would have
been very easy to find.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: problem with mail()/html/outlook

2002-02-19 Thread Jason Murray

 This had worked without problems..

It sounds like the text encoding could be wrong. Using
some encoding types, =charchar means something else.

Maybe the charset you're using needs to be looked at?

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP Developers in Melbourne, Australia

2002-02-19 Thread Jason Murray

Hi everyone,

If you're located in Melbourne, Australia and are available for contract
or temporary work for 3 to 6 months starting early March, I'd like to 
hear from you. 

Pre-requisites:
 - Working knowledge of a unix / linux environment
 - Firm grasp of PHP concepts and programming (OO unneccessary)
 - Firm grasp of SQL and MySQL use
 - Reasonable grasp of HTTP and networks

Please email me directly - [EMAIL PROTECTED]

Thanks

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] nullifying php and html tags?

2002-02-18 Thread Jason Murray

 Hello. I just finished creating a simple input form in
 which the contents of a textarea get written to a file
 which in turn gets read by a particular page. 

This is a Really Bad Idea(tm).

 it seems pretty dangerous to allow a user to enter any 
 amount of php programming at their will.

... and that's why.

 something as simple as a function that strips all 's
 and 's would work just as well i would imagine.

You could just read the file from another script with 
file() and output it rather than include()'ing it. That 
way the code is never executed.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] nullifying php and html tags?

2002-02-18 Thread Jason Murray

 Would strip_tags() do?

Easily gotten-around then by not closing your PHP ? ? tags.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Looking for optimal coding

2002-02-14 Thread Jason Murray

 Any expert programmers out there with the way to chop this 
 even further?

I would suspect that chopping this further would make it
even harder to understand/maintain in the future...

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP Work in New York

2002-02-12 Thread Jason Murray

Jason L wrote: 
 Of course, I am lucky enough to be working in a place which uses 
 PHP/MySQL for practically everything, and Perl in a few others.  
 And say ASP, and you are liable to get your head shot off.

Same here, everything web-related anyway ... but the head-shot-off
attitude is in place :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re-Importing .CSV file into Database

2002-02-12 Thread Jason Murray

 The error message might be useful, but in any case I think 
 you need to enclose the source filename in quotes; also (you 
 better check the docs here) if I remember correctly you need 
 to give the full path to the source file unless it is in the 
 mysql data directory.

That's right, it needs to be quoted AND have the full path
(and be readable to the MySQL server daemon process thingy)

Jason
(feeling very technical today)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Mailing text from a text file.

2002-02-12 Thread Jason Murray

 I have the need to be able to mail out a text file.  whats 
 the best way that I could do this?

Simple answer: mail(). If you're not sure, www.php.net/mail.

More complicated answer:

Are you talking about using a text file as a template for
the email, using a user-uploaded text file as the *contents* 
of the email, or attaching a text file (possibly user-uploaded)
to an email?

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP Work in New York

2002-02-12 Thread Jason Murray

 I figure if I'm forced to go M$ I'd much rather use C# that 
 VBScript...

C# actually seems to be getting quite a lot of positive mentions
in the *nix world at the moment.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP Work in New York

2002-02-12 Thread Jason Murray

 Well, the projects that are underway to create a open source 
 implementation of the .NET platform as evidence that at least 
 some people in the *nix world have been quite taken with it...

That, and the number of positive mentions its getting on SlashDot
in the last week or so.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] File upload

2002-02-06 Thread Jason Murray

Hi Balaji,

   I am trying to upload a file from remote machine.
   Could you please help out me.

Two things:

 upload.html
 -
 form action='upload.php' method='post' enctype='multipart/form-data'

This also needs to have a maximum file size specified:

  INPUT TYPE=HIDDEN NAME='MAX_FILE_SIZE' VALUE='20'

 upload.php
 

In this script, you'll want to copy $file to /path/to/copy/to/filename.
This doesn't seem to be what you're doing in the script you sent us,
you overwrote $file with a new variable, $path - thus, losing the name
of the temp file PHP copied the uploaded data into.

Take care that you use the appropriate security measures to protect
yourself against exploits here.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] this list has been mutated to a lamers paradise

2002-01-31 Thread Jason Murray

 just wanted to point this out.

And these kinds of emails make it *so* much better, of course.

If the topic doesn't interest you, don't read it. (I don't 
read 90% of the emails I get on the list, I just dump them
into a folder because I don't know anything about the topic,
don't care, or I might be busy at the time). If you think
you've graduated from the Newbie class, pat yourself on the 
back, move on, and quietly unsubscribe yourself.

Don't make fun of the newbies who come here for advice.
They don't know any better, and we were all new to PHP at
one point.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mysql

2002-01-30 Thread Jason Murray

 I keep getting an error message of :Warning: Supplied 
 argument is not a valid MySQL result resource in 
 /var/www/html/RageProject/StripPlayList.php on line 100
[snip]
 Can someone explain why.. I've been trying to work it out for 2 long.

If there's no result set, it's because the query you executed
did not return any rows.

This could be because:
 - the SQL was incorrect / malformed
 - the query wasn't executed by the server
 - the connection to the server failed

You should use mysql_error() to find out what's going on,
it returns the last error reported by the MySQL server.

I suspect your connection isn't working, as I've never
seen 127.0.0.1 used - normally I just use localhost
or .

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Fwd: PhpSmsSend remote execute commands bug

2002-01-29 Thread Jason Murray

 I'm think I'm going to start forwarding all the bugtraq 
 alerts for PHP scripts to this list. Any objections?

Yes, if the author of the script isn't on the list it's useless
unless someone wants to patch their script themselves. And if
they're the kind of person who's inclined to do that, they'd
most likely already be watching BugTraq.

There's such a large possibility of crappily-written code out
there, I don't know if its worth the traffic on this list
given that it's usually newbies.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Swapping BR for \n... ?

2002-01-29 Thread Jason Murray

 I'm processing a form but all the functions I've found on the 
 web only seem to add the BR after the \n. I need to remove the 
 \n altogether - anyone know how I can kill the \n and put a BR 
 in it's place?

Sounds like you want a simple ereg_replace(\n, BR, $sourcestring);

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Swapping BR for \n... ?

2002-01-29 Thread Jason Murray

 Isn't there a function br2nl() and it's relative nl2br() ?? 

There's nl2br, but I don't believe there's one that goes the other way.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] seems easy...

2002-01-23 Thread Jason Murray

 1  $limit = 5000;
 2  if(strlen($text)  $limit)
 3{
 4cut $text down to $limit length
 5$text .= ...sorry, text was too long;
 6}

4$text = substr($text, 0, $limit);
5$text .=  ... (More);

:)

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Unable to Jump Row ?!?

2002-01-17 Thread Jason Murray

 Here is the error...
 
 Warning: Unable to jump to row 1 on MySQL result index 2 in
 /blahblahblah/patient/display_search_results.php on line 39

This means that the query you executed didn't return enough
rows to count up to ... 1.

 Here is the code on line 39
 
 $d = mysql_result($result, $c, id);
 
 the field id is an auto_increment column.
 $c is an exsisting row in the query, $result.

 Any help? 

Yes, it looks like $result doesn't contain anything, so maybe
your SQL is messed up. When you execute queries, you should
do:

  if ($result = mysql_query($sql, $mysql_connection))
  {
// It worked, proceed
  }
  else
  {
// It didn't work, die.
echo MySQL failed: .mysql_error();
  }

... that will tell you what went wrong.

 Is there a way to tell MySQL to shut the hell up on certain
 pages?

Yes, if you put a @ in front of any function call it will 
supress error messages. However, it's a better idea to fix
the cause of the error messages :)

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Unable to Jump Row ?!?

2002-01-17 Thread Jason Murray

  Here is the code on line 39
  
  $d = mysql_result($result, $c, id);
  
  the field id is an auto_increment column.
  $c is an exsisting row in the query, $result.
 
  Any help? 
 
 Yes, it looks like $result doesn't contain anything, so maybe
 your SQL is messed up. 

Oh yes, additionally (this is more for others who may have the
same question, since you seem to have solved yours) the variable
$c may not contain the value you're expecting it to contain.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Computer Science and PHP

2002-01-17 Thread Jason Murray

 Why PHP is so not popular in the computer science teaching area?

Well, here at RMIT in Melbourne Australia they're teaching all
the first year students PHP...

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() and URL's

2002-01-17 Thread Jason Murray

 The file is running on an NT box and can be accessed fine 
 through IIS. It is only when using the include() statement to 
 this file that problems occur. If I do a local path map to it, 
 it will include fine but when using an URL it gives that error.

Can you retrieve the file from that URL from the command line
on that machine? (try 'wget' or 'curl', or even just 'lynx')

It's possible that while you can see it from your workstation,
the server PHP is installed on cannot.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Generating a new line in a text file

2002-01-17 Thread Jason Murray

 It should be fairly simple, but it's got me and everyone else 
 I've asked utterly stumped, all I need to do is place the data 
 from a form on a newline in a text file, I can get the data into 
 the text file, but I can't seem to get it on a new line.

Don't know why it's got everyone else stumped.

\n is the new line character. Make sure you use it in  and
not in ''.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Generating a new line in a text file

2002-01-17 Thread Jason Murray

 : Don't know why it's got everyone else stumped.
 :
 : \n is the new line character. Make sure you use it in  and
 : not in ''.
 :
 : Jason
 
 Unfortunately, that doesn't work either, it changes the \n that 
 appeared at the end of the new line to a single black block. It 
 does not put the next quote onto a new line. 

Ah, so you're opening the file in something that doesn't understand
newlines and prefers line feeds, then.

In that case you'll want to use \r instead of \n.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Getting the last record in a mysql table

2002-01-17 Thread Jason Murray

 I thought this would be easy but it ain't.  What I want is 
 the id number of the last record in a table. 

If you use mysql_num_rows() and decrement it by one, you'll 
have the ID of the row you can use with mysql_result.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Webmail with Attach

2002-01-08 Thread Jason Murray

 I need that that my webmail can send mail with many attach.
 How can I do it?

You could either ask the user how many attachments they want,
and present that number of INPUT TYPE=FILE fields, or you
can grab the file attachment from the user, store it in a 
uniquely-named temporary directory, get another, and another, 
and store them all in the temp directory until the user says
right, that's it at which point you read all the files in
your directory and send them as attachments. 

You've got the code right for sending one attachment, sending
mutliples is just another loop in the email assembly code.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] IP address from which country

2002-01-08 Thread Jason Murray

 Thank you Andrew,but in China mainland ,I saw many websites can even tells
 the province information which the user come from and I think in USA the
 State information can also be gotten from the visitor's ip address.BTW,in
 PHP what we can get is just the ip address of the user how can we get the
 host name ?Anything missed here?

A database may exist for IPs in China (I don't know), but outside of China 
it's impossible to tell with much accuracy which country an IP is in. You
could look at Digital Envoy, which was an attempt a couple of years ago
to 'map the internet' and obtain exactly the data you're referring to. The
problem is that as soon as that data is published it's out of date due to
routing changes and network configuration changes.

You can do a reverse lookup on the IP address to get the hostname, but you
can rely on that even less - for example, a hostname ending in aol.com could

be in the USA, Europe, Asia, or Australia these days.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] IP address from which country

2002-01-08 Thread Jason Murray

 Thank you Jason ,I will check the Digital Envoy to get more 
 information, have you got the website address of it?

www.google.com ... digital envoy ... I'm feeling lucky :)

... or just www.digitalenvoy.net.

Search engines are fun :)

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] apostrophe's in PHP MySQL

2002-01-08 Thread Jason Murray

 Is there a way around this?  Or is this a limitation of my 
 older versions of PHP and MySQL?

You need to apply addSlashes() to the text fields before entering
them into the database.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Apostrophes and text fileds forms

2002-01-08 Thread Jason Murray

 What is an addSlash ? 
 How can I appy addSlashes ? Can anyone give me an example ? 

Try the manual ... http://www.php.net/addslashes

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] phpinfo() question

2002-01-06 Thread Jason Murray

 When you run phpinfo(), the first line of detail has the OS 
 version.  What variable produces this?

Thats the output from uname -a on the command line... at least,
under *nix it is...

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Scripting events with php

2002-01-06 Thread Jason Murray

 My problem is that I want to use events in my forms but I do not know how
to
 use php as a script for an event.  Say I wanted to do something as simple
as
 (within a form): input type=button value=Test onclick= ?php print
 'testing, testin 123';?
 
 Essentially, when a click this button in a form it prints out testing.

PHP is a server-side script language. It does not get sent to the browser,
and browsers don't understand how to execute PHP code (for that precise
reason).

You want to do this with JavaScript, not PHP.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] An idea for a PHP tool

2002-01-03 Thread Jason Murray

 Like google has it's toolbar, why not have a PHP Manual toolbar? That 
 would be *great*. Just type in the function name and hit go and the 
 manual comes up.

You could probably work a bit of javascript magic in a bookmark to
do the same thing.

I've seen bookmarks that pop up a javascript input window and then
use the input in the resulting URL. So, take the manual query via
javascript input and then append it to the www.php.net url.

At least, I *think* I have :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] User-friendly URI's

2002-01-03 Thread Jason Murray

 news would actually be a PHP script, of course. I know how 
 to handle /2002/01/02/keyword as parameters, my question is on 
 making news be interpreted through PHP.

Off the top of my head...

You could either use a .htaccess to force Apache to recognise
news as a PHP script, or you could use a Custom 404 page to
figure out what the heck the original URL was trying to get at
and silently substitute in the resulting page.

A Custom 404 might be easier, but would have a bit more supporting
infrastructure at the code end for a big site.

Apologies if this is incorrect, I just may not be thinking
too clearly today :)

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: how can I add a variable to this sample

2002-01-03 Thread Jason Murray

 So far nothing seems to work which leads me to believe 
 there's something else wrong.
 
 Here's what I've tried
 
 $service_type_insert = $x['926service_type']; //works fine 
 when I hard code
 a value in and returns proper value
 
 $service_type_insert = $x[$$keyservice_type]; //returns empty 
 even though I know a value is there

Work from this one and try:

$keytoinsert = $$keyservice_type;
$service_type_insert = $x[$keytoinsert];

... I don't think you can reference variables as $$something
inside [] braces.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] User-friendly URI's

2002-01-03 Thread Jason Murray

 A 404 ErrorDoc would still reply with a 404 code, which could mess up 
 some search engines.

Not true, try this: www.inww.com/ifdbnifoudbvfd

This is actually produced by ErrorDocument 404 /404.php3 in our Apache
configuration, and 404.php3 is a PHP script that sends the neccessary stuff
to be seen as a 404 to a web browser (thats basically a TITLE tag of 404 
Not Found).

You could just as easily subvert 404.php3 to do redirects or include
other stuff to produce the neccessary pages without sending the 404 bits
(and we do, we recently moved all our PDF files into a database and use
404.php3 to silently redirect to the database-drawn version of the file).

 I was thinking of the .htaccess solution, but I'm not sure if that's 
 possible to force only certain files or perhaps all files in just a 
 certain directory to all be application/x-httpd-php?

I believe you can force a single file. I haven't done it, I'm sure
someone else around here can. :)

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: User-friendly URI's

2002-01-03 Thread Jason Murray

 True, but if I remember right, the hit will end up in your 
 error_log not in your access_log.

Ah. Bugger.

But since this would require messing with your Apache config
you could adjust that anyway surely?

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] printf()?

2001-12-16 Thread Jason Murray

HTML doesn't pay attention to line breaks, thats why you're 
needing a BR...

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: Ray Gaylog [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 17, 2001 3:49 PM
 To: PHP_Mailing_List
 Subject: [PHP] printf()?
 
 
 Hi..
 
 I've been using PHP for just a little while, however I have 
 noticed somthing.
 
 In the doc's I've noticed you can do this: 
 printf(line1 \n line2 \n);
 
 Now..this should (like C) print two seperate lines..however 
 It doesn't. To print this on seperate lines I must put a BR 
 in there.
 
 Any ideas?
 
 I'm using PHP 4.06
 
 Ray Gaylog
 [EMAIL PROTECTED]
 
 
 
 
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] E-mail Uploaded File

2001-12-11 Thread Jason Murray

 Is there a short easy mail script that can take an uploaded 
 file from a form and have it e-mailed to me?

http://planetkiller.shadow.net.au/mime-php.txt

This will show you how to send an attachment in an email
without messing around with classes (which I could never
get to work, hence I rolled my own solution).

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Store locator / postcode proximity

2001-12-09 Thread Jason Murray

Hi folks,

I've seen messages on here in the past about Store Locator tools,
where someone enters a postcode and the nearest store to that postcode
is found.

I'm wondering if anyone has any information about how to get the 
proximity data for postcodes in Australia? Or is it safe to assume
that if a postcode is, say, 3107, that 3120 or 3110 (for example) 
are nearby as well as 3108 (so, perhaps, 10 above and 10 below could
be safely assumed to be nearby?)

I saw some mention of this a few months ago here from some of the
other Aussies on the list, but I've long since lost the archived
messages.

Could someone please help me a little with this? :)

Thanks

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] content disposition and internet exploder

2001-12-02 Thread Jason Murray

 I am attempting to allow users to download csv files that are created
 dynamically from a database.  In order to do so  I use:
 
 header( Content-Disposition: attachment, filename=query.csv);
[snip]
 Has anyone had success in getting IE to use the correct filename when
 downloading dynamically generated files?

I just use:

 Header(Content-disposition: filename=.$filename);

... ie, no attachment.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] MySQL to Excel with mutiple sheets

2001-11-28 Thread Jason Murray

 Can't be done easily with PHP right now...  To get that type of
 functionality, you'd need to write it in Perl using the
 SpreadSheet::WriteExcel module.
 
 http://homepage.tinet.ie/~jmcnamara/perl/WriteExcel.html

In that case, someone could probably work out how to do it based
on the source of that module... :)

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] MySQL to Excel with mutiple sheets

2001-11-28 Thread Jason Murray

 Actually, I looked into the possibility of doing that, but it turns out
 the Excel 5.0+ file format is -very- complicated... Not just a standard
 binary file...
 
 Check it out:
 http://www.wotsit.org/search.asp?page=49s=ALLFILES
 
 Way beyond my capabilities and patience.  :)

Eugh

Hrm, well ... it can be done at least. We just need someone to require 
it be done :)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] MySQL to Excel with mutiple sheets

2001-11-28 Thread Jason Murray

   Actually, I looked into the possibility of doing that, but it turns
   out the Excel 5.0+ file format is -very- complicated... Not just a
   standard binary file...
  
   Check it out:
   http://www.wotsit.org/search.asp?page=49s=ALLFILES
  
   Way beyond my capabilities and patience.  :)
 
  Eugh
 
  Hrm, well ... it can be done at least. We just need someone 
  to require it be done :)
 
 s/require it be done/want to do it

I stand by my original statement. After someone requires PHP to 
output a multi-sheet Excel file, the code to do it will then
be out there. :)

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] exporting

2001-11-19 Thread Jason Murray

 I need something that will do a direct transfer to word or 
 excel or the others.. not something via a cvs method..

Excel loads comma separated (CSV - CVS is something else entirely)
files happily.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] using mail

2001-11-12 Thread Jason Murray

Then why didn't you notice that in the additional headers
you can specify the from header?

mail([EMAIL PROTECTED], Whee, Whee! Mail Body,
 From: Jason Murray [EMAIL PROTECTED]\n);

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

 -Original Message-
 From: Brandon Orther [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 13, 2001 9:52 AM
 To: PHP User Group
 Subject: RE: [PHP] using mail
 
 
 YES I DID READ THE F...in MANUAL
 
 -Original Message-
 From: Kurt Lieber [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, November 12, 2001 2:56 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] using mail
 
 Did you RTFM?
 
 http://www.php.net/manual/en/function.mail.php
 
 Just create a variable and input it as an extra header.
 
 $from = from: [EMAIL PROTECTED]\r\n ;
 
 mail($to,$subject,$message,$from);
 
 On Monday 12 November 2001 02:41 pm, you wrote:
  Hello,
 
  I am using the mail() function right now to send e-mails.  
 Is there a
  way I can dynamically change where it says the e-mail is from?
 
  Thanks
  Brandon
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] date conversion and calculation problem...

2001-11-12 Thread Jason Murray

 I have 2 date string like this
 
 $t1 = 2001-11-12 17:30:10;
 $t2 = 2001-11-12 17:15:32;
 
 I need to substracts the number of seconds from $t2 from $t1

First, convert them to unix time format:

?
   Function dateTextToUnix($string)
   {
 $year  = substr($string, 0, 4);
 $month = substr($string, 5, 2);
 $day   = substr($string, 8, 2);
 $hours = substr($string, 12, 2);
 $mins  = substr($string, 14, 2);
 $secs  = substr($string, 16, 2);
   
 return mktime($hours, $mins, $secs, $month, $day, $year);
   }
?

So:

?
   $t1 = 2001-11-12 17:30:10;
   $t2 = 2001-11-12 17:15:32;

   $t1unix = dateTextToUnix($t1);
   $t2unix = dateTextToUnix($t2);

   $secondsdifference = $t2unix - $t1unix;
?

(apologies for stuff that doesn't work, I've coded this in
the email and not tested it :))

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Download script - sometime works sometime not

2001-11-08 Thread Jason Murray

 Its works for file .html or.zip or .tar or .tar.gz
 But it is not for text file..
 Could you recommend how I download text file ?
 What do I have to do in my scripts...?
 
 I read the manual about HTTP functionsand search through 
 mailing list
 about header functions
 but still no clue..
 Thank you...

If you send a text file, MSIE will probably view it anyway. Netscape
will behave.

Alternative? Send a completely madeup mime type, forcing MSIE to
go into download mode.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] sending email to php script

2001-10-31 Thread Jason Murray

  You'll also need to compile php as a standalone, and put as 
  the first line of your php script
  
  #!/path/to/php -q
 
 What if we need both version??

There's nothing stopping you running both.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   3   4   >