Re: [PHP] File upload - ascii format

2001-02-06 Thread David Robley

On Wed,  7 Feb 2001 13:42, Shane McBride wrote:

  How can I ensure that a file is transferred in ascii mode using the
 following: form enctype="multipart/form-data" method="post"
 action="do_upload.php"

 pstrongFile to Upload:/strongbr
 input type="file" name="img1" size="30"/p
 emplresults.txtinput type="radio" name="file_type"
 value="emplresults"nbsp; applresults.txtinput type="radio"
 name="file_type" value="applresults" Pinput type="submit"
 name="submit" value="Upload File"/p

 /form

 I think it may be how you specify the enctype?

 - Shane

A quick search turned up this URL:

http://www.w3.org/TR/REC-html40/interact/forms.html

which seems like a good start point - I'm going to peruse it myself and see 
what I come up with

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] File upload - ascii format

2001-02-06 Thread David Robley

On Wed,  7 Feb 2001 13:58, David Robley wrote:
 On Wed,  7 Feb 2001 13:42, Shane McBride wrote:
   How can I ensure that a file is transferred in ascii mode using the
 
  following: form enctype="multipart/form-data" method="post"
  action="do_upload.php"
 
  pstrongFile to Upload:/strongbr
  input type="file" name="img1" size="30"/p
  emplresults.txtinput type="radio" name="file_type"
  value="emplresults"nbsp; applresults.txtinput type="radio"
  name="file_type" value="applresults" Pinput type="submit"
  name="submit" value="Upload File"/p
 
  /form
 
  I think it may be how you specify the enctype?
 
  - Shane

 A quick search turned up this URL:

 http://www.w3.org/TR/REC-html40/interact/forms.html

 which seems like a good start point - I'm going to peruse it myself and
 see what I come up with

Following up to myself, it seems that the defined standard for line 
separators is CR/LF - from the document at the above URL: 

"As with all MIME transmissions, "CR LF" (i.e., `%0D%0A') is used to 
separate lines of data."

So if your problem is related to the end of line characters, you might want 
to run something on the server that does an EOL conversion as part of the 
upload process.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] [newbie] minor trouble with while, list and explode from a text-file

2001-02-06 Thread David Robley

On Wed,  7 Feb 2001 14:14, SED wrote:
 Hi, I'm trying to figure out how to do this right:

 I have this text file:

   date 1 | head 1 | text 1
   date 2 | head 2 | text 2
   date 3 | head 3 | text 3

 And I want to display in a HTML-page like this:

   date 1
   head 1
   text 1
   date 2
   head 2
   text 2
   date 3
   head 3
   text 3

 And I'm trying to do it with follwing code:

 //sniped
 39   while (list ($line_num, $line) = each ($contentlines))
 40   {
 41   $message = explode ("|", $line);
 42
 43   while (list ($date, $head, $text) = each($message))
 44   {
 45   echo "$date, $head, $textbr";
 46   };
 47   };
 //sniped

 But I get this result:

   Warning: Undefined offset: 2 in c:\inetpub\wwwroot\read_txt_0007.php on
 line 43


 Can anyone point me to a solution for this?

 Regards,
 Sumarlidi Einar Dadason

List returns a key and value for each element in the array on which it 
operates. The array that you get from
 
$message = explode ("|", $line)

will be something like
KEYVALUE
0  date1
1  head1
2  text1

with spaces around the text (which you may want to chop()) so you need 
something like
41 $message = explode ("|", $line);
42
43 while (list (, $value) = each($message))
44 {
45 echo "chop($value)br";
46 };
The comma in Line 43 is important!

Alternatively, you could use str_replace to change the ' | ' (that's space 
pipe space) to BR

Cheers
-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Header Location Question

2001-02-06 Thread David Robley

On Wed,  7 Feb 2001 13:27, Jeff Oien wrote:
 I have the code below within a larger web page which is
 like a portal. When I submit the form, I get this message:

 
 Warning: Cannot add header information - headers already sent by (output
 started at c:\apache\htdocs\index1.php3:9)
 

 Can I get it to take me to the BigCharts site and leave the
 page I'm on? Thanks.
 Jeff Oien

 
 ?php

 print "form method=\"post\" action=\"$PHP_SELF\"";
 print "Symbolbr";
 print "input type=\"Text\" size=\"5\" name=\"symbol\"br";
 print "INPUT type=\"hidden\" name=\"op\" value=\"ds\"";
 print "input type=\"Submit\" value=\"Chart\"";

   if ($op == "ds") {
   $url = 'http://www.bigcharts.com/quickchart/quickchart.asp?symb= .
 $symbol'; header ("Location: $url");
   }
 ?

If you are going to use header, you _must_ make sure that nothing is output 
to the server, not even white space or blank lines, before the header 
function is called.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] image* functions won't work.

2001-02-06 Thread David Robley

On Wed,  7 Feb 2001 17:52, Lauri Jakku wrote:
 Hi,
   i've installed latest apache and php.. and find out that the
   image* functions dosen't work ..

 apache_1.3.17
 freetype-2.0.1
 gd-1.8.4
 jpeg-6b
 php-4.0.4pl1

 are compiled  installed without any whine ..

What do you mean 'don't work'? Are there error messages? Create a 
document with just

?php phpinfo() ?

in it and see if in fact GD support etc are enabled in PHP

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] UN-Escaping text from a form submit?

2001-02-07 Thread David Robley

On Thu,  8 Feb 2001 14:17, John Vanderbeck wrote:
 Hello again,

 I have a form that is used to submit data to my script.  If the user
 enters something like:

 The title of this book doesn't really matter to "me"!

 When I get that back, and read it from the file, it always ends up
 like:

 The title of this book doesn\'t really matter to \"me\"!

 Note the addition of the escape sequences.  How can I stop this? Is
 there some function in PHP? Or am I goign to have to write a character
 routine to strip out escape sequences? shudder

 - John Vanderbeck
 - Admin, GameDesign

addslashes and stripslashes are the functions you need.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Compiling php??

2001-02-07 Thread David Robley

On Thu,  8 Feb 2001 14:18, GAYTAN BAHAMONDEZ DANIEL EDUARDO wrote:
 Hi there,
   Is there a way to compile php files so that no one can read them
 but php will undestand them?? something like .exe in win

   Thanks in advance

http://www.zend.com/zend/products.php#encoder has some information.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] indexing text

2001-02-08 Thread David Robley

On Fri,  9 Feb 2001 13:45, Steve Werby wrote:
 "Robert Mena" [EMAIL PROTECTED] wrote:
  Besides htdig is there any other solution (perhaps
  written in php) to index a content of a TEXT field in
  order to have an "altavista-like" search engine for my
  use ?

 mnoGoSearch (formerly udmsearch) will do the trick.  It's written in
 C++, it's very powerful, highly configurable and has optional PHP or
 Perl front-ends.  I use it to index and search internal and external
 sites, but you can use it to index a database directly.  Search google
 for the URL.


It's http://search.mnogo.ru/

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Web Based Project Management Tools

2001-02-08 Thread David Robley

On Fri,  9 Feb 2001 11:46, Nathan Cook wrote:
 Do any of you know of a comprehensive web-based project management tool
 written in php?

 Thank You!
 .:: Nathan Cook [ [EMAIL PROTECTED] ] ::.
 Systems  Network Administrator :: Programmer
 [ phone - 208.343.3110 ][ pager - 208.387.9983 ]

Keystone? http://www.stonekeep.com/keystone.php3

It and some others are listed on the projects page of your favourite PHP 
mirror.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Search replace text

2001-02-11 Thread David Robley

On Mon, 12 Feb 2001 06:41, CDitty wrote:
 Hello all.  I am trying to search through a text file on my server to
 replace the user email.  I can open the file and read it, but cannot
 get it to "find" the actual string and replace it.  Can someone look
 over my code and see what the problem is?  I am afraid that ereg is not
 my strongest point.

 Also, at what point should I start writing the file out?  Wouldn't
 there be a permissions error if I was reading and writing at the same
 time?

 Thanks
 CDitty


 $oldemail = "[EMAIL PROTECTED]";
 $newemail = "[EMAIL PROTECTED]";
 $user = "cditty";
 $file = fopen("/path/to/the/user/file/$user.dat", "r");
 if(!$file){
  echo "pUnable to open remote file.\n";
  exit;
 }else{
  echo "Successbr";
 }
 while (!feof($file)) {
  $line = fgets($file, 255);
  if(eregi($oldemail, $line, $out)) {
  str_replace($oldemail, $newemail, $line);

You need to assign the output of this function to a string:
   $new_line = str_replace($oldemail, $newemail, $line);

  }

 echo $line . "BR";

and then

echo $new_line . 'BR;

 }
 fclose($file)

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Newbie: Images refs not loading (Broken Icons) How to?

2001-02-12 Thread David Robley

On Tue, 13 Feb 2001 13:55, Malouin Design Graphique wrote:
 Hi,

 Is there anything wrong with this code below?
 Any help or fix to this code would be very much appreciated.



 The file to get the data out (gif file):
 
 ?php

 /* data_out.php3 */

 $db = mysql_connect("www.server.com", "root", "password");
 mysql_select_db("db_name", $db);
 $sql = "select * from table_name order by 'date'";
 $sql = "select * from table_name";
 $result = mysql_query($sql);
 while ($row = mysql_fetch_array($result)) {
 print("trtd bgcolor=\"#003399\"");
 printf("img src=\"$indice_url\"%s/td/tr\n",
 $row["indice_url"]);
 }
 ?

Assuming that indice_url is a URL to an image file on the filesystem, 
that looks like it should work (although I don't understand printf g; 
can't see why that couldn't be just echo). So what shows up in your 
source?




 Here's the "tiny" table that feeds it:
 
 CREATE TABLE indice (
 id int(11) DEFAULT '0' NOT NULL auto_increment,
 date text,
 indice text,
 indice_url varchar(255),
 PRIMARY KEY (id)
 );
 ----

Date as a _text_ field? You'll never have a Year 20 bug 
problem :-0

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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 php as a shell scripting language

2001-02-12 Thread David Robley

On Tue, 13 Feb 2001 13:48, Tony Bibbs wrote:
 I have a need to use php similar to how I would bash when creating
 shell scripts.  I have two RH6.2 machines that have the same version of
 php (slightly different compile-options).  One machine in particular
 lacks the php binary in /usr/local/bin and that's what I need to use
 php in a shell script.

 I did ./configure --help to see if there was an option that I was
 missing and nothing jumped out at me as being the obvious fix.  How do
 I compile PHP to get this binary?

Leave out the Apache options, anything related to modules, etc. Here's 
what I use to build it as a CGI to run with a non-Apache server (I think 
this might be PHP3 but you'll get the idea)

./configure --with-gd=/usr/local --with-mysql=/usr/local/mysql 
--with-dbase=yes --enable-sysvshm=yes --enable-sysvsem=yes 
--with-config-file-path --enable-debug=no --enable-track-vars=yes 
--enable-bcmath=yes --bindir=/web/webdocs/cgi-bin

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Build HREF list from database???

2001-02-12 Thread David Robley

On Tue, 13 Feb 2001 15:24, andrew wrote:
 Hi - I want to print a list of numbers linked to URLs I create on the
 fly - something like this:

 table:
 ---
 pathpid
 -|-

 foo.jpg 1
 bar.jpg 1

 ?php

 include("db_connection_params.inc");  //all relevant database variables
 $sql="select path from table where pid =1";  //obvious
 $link_id = mysql_connect($host, $usr, $pass); //get connection handle

 $result = mysql_db_query($database, $sql, $link_id);
 $count = mysql_num_rows($result) or die ("no rows returned from $sql");

 $i = 0; //initialze counter

 for (0  $i  $count; $currrent_row = mysql_fetch_row($result); ++$i;)

I think you want something more like
for($i = 0; $i  $count; $i++)
{
$current_row = mysql_fetch_row($result);

 {

   $path=$current_row[2]"; //database field position matched index
 number print "a href = $path$count/abr"; //
Instead of this, you could do
extract($current_row);
echo "a href = $path$count/abr";
 }

 ?

 so I want this to print:
 1  (linked to foo.jpg)
 2  (linked to bar.jpg)

 The problem is I'm getting a parse error on the "for" line.

 Any ideas?

 TIA,
 andrew

Or a slightly more elegant solution:
 include("db_connection_params.inc");  //all relevant database variables
 $sql="select path from table where pid =1";  //obvious
 $link_id = mysql_connect($host, $usr, $pass); //get connection handle
 $result = mysql_db_query($database, $sql, $link_id); 
/* put a die on the above or better use mysql_error */
 $i = 1; //initialise counter
 while($row=mysql_fetch_array($result)){
   extract($row);
   echo "a href=\"$path\"$i/abr";
   $i++;
  }

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] SELECT statement

2001-02-12 Thread David Robley

On Tue, 13 Feb 2001 16:00, Peter Houchin wrote:

  Hi,

 Can you have a SELECT statement (using mysql) that goes something like

 $sql="SELECT id  email FROM table WHERE user='$user' and
 pass='$pass'";

 and if you can't is there a away around this?

 Thanks

 Peter

In SQL queries, you normally separate the required fields with a comma, so

$sql="SELECT id, email FROM table WHERE user='$user' and pass='$pass'";

would work, assuming id and email are fields in the table 'table'.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] GD library

2001-02-13 Thread David Robley

On Wed, 14 Feb 2001 00:23, Rahul Hari Bhide wrote:
 Hi ,
 I am configuring php with the  --with-gd option .
 My libgd.a is sitting in /usr/local/lib and other header files in
 /usr/local/include .

 ./configure --with-gd=/usr/local/lib gives me the following error :

 checking whether to include GD support... configure: error: Unable to
 find libgd.(a|so) anywhere under /usr/local/lib

 though the file is very much existant.

 Any ideas what is wrong???

 ~Rahul

Try ./configure --with-gd=/usr/local

Then configure will look in lib under that path for the libraries and 
include for the include files.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Newbie -- tutorial exercises reveal too much -- pdf download not saveable

2001-02-13 Thread David Robley

On Wed, 14 Feb 2001 07:20, Info wrote:
 Hi,

 I don't have adequate space to have PHP and MySQL on my local machine. 
 Yes, need a new and better box.  So, used my net site for some
 exercises.  That is not satisfactory because I must reveal password and
 such in plain text to execute a php/mysql script.

 Maybe only a resource poor newbie could have this problem -- means I
 need to have some hurry up instruction on getting those secret words
 hidden -- or I should not continue with exercises and tutor.  There is
 nothing on my site or in my database that is sensitive in any way --
 but don't want to find it all gone or altered.

 Also, I can download some manuals, but I cannot save the .pdf variety
 or find the temp file to save it. Any suggestion? I'm on WIN95 with a
 Toshiba Laptop and do have the adobe acrobat reader and MS Office.

 Is there a tutorial on this "include" subject that I can find and use?
 I'm on digest mode so please CC or direct to me.


There's not much to it - the docs are failry explanatory. Just remeber 
that when you include or require a file, the contents of that file are 
'placed' in the current file at the location of the function call. If 
there is PHP syntax in the included file, it must have PHP start/finish 
tags (?php ?) around it for the PHP to be run.

You can include a file from pretty much anywhere, including especially 
outsite your webserver document root. So for some security, put your 
passwords etc outside the web root. Also, see the php.ini file if you 
have access to it for how to define a search path for include files.

As for downloading the manuals, try right clicking and choosing the 'Save 
Link as' function - or however it's called under Exploder.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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_error() not really helping

2001-02-13 Thread David Robley

On Wed, 14 Feb 2001 13:01, Christian Dechery wrote:
 I'm having a little trouble here developing and running queries.

 I spent some time developing in ASP, and whenever there was something
 wrong with a query, the script halted, and the error message - from
 ODBC, tye sql syntax error - was printed along with the line of code.

 In PHP that's not how it goes, it doesn't tell me when theres an error
 with a mysql_query unless I place a call to mysql_error() after each
 executed query right?

 That's exactly what I'm doing, but again, it doesn't do all I want, cuz
 it doesn't tell me the line of code, and I don't know where is the
 error, unless I start printing everything on error handling.

There is a PHP constant __LINE__ which you may find useful.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Line Break

2001-02-13 Thread David Robley

On Wed, 14 Feb 2001 14:04, Deependra B. Tandukar wrote:
 Greetings!

 I know "\n" gives the new line and "\t" gives the tab. Is there any
 other code for them because this is not working in the web server where
 I host my web pages?

 Looking froward to hearing from you.

 Regards,
 DT

When you say 'not working' , do you mean that you don't see a line break 
in your browser where the \n has been inserted?

This is correct behaviour - \n, \t and multiple space characters are all 
treated as white space by browsers and rendered as a single space. If you 
want to insert a line break you need to use BR, and you can use a 
series of nbsp; to mimic a tab. There are better ways of handling this 
using CSS.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Paging results

2001-02-14 Thread David Robley

On Thu, 15 Feb 2001 07:12, Randy Johnson wrote:
 Can somebody give me a url of an example  or an example of how to page
 results so they can be view by clicking page 1  page 2   or back and
 next?

 results obtained from mysql database.

 Thanks

 Randy

http://px.sklar.com/code.html?code_id=77

and leave out the require at the beginning. You'll need to hack it around 
a bit (lot?) to suit your circumstances, but the code to keep track of 
where you are is in there.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] error handling

2001-02-14 Thread David Robley

On Thu, 15 Feb 2001 11:42, Patrick Brown wrote:
 How can I disable the display of error to the browser window from
 within the script? I want to do a redirect based on the error and
 cannot because header info has already been sent.

 Thanks,
 Pat

Try an @ prepended to the function that triggers the error, then test for 
the error. @ should prevent the display of the error message.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Can I launch an external program from a php script?

2001-02-14 Thread David Robley

On Thu, 15 Feb 2001 12:40, Wyatt Earp wrote:
 Hello,

 I have a situation where I need to verify the PGP signature of a
 message that is stored within a variable in a PHP script. Is it
 possible to launch external programs from within PHP? I can't find
 anything about it in the manual. If not, has anyone ported PGP over to
 PHP?? (That's a lot of Ps!)

 Thanks for your help!

 Wyatt

Program execution functions - exec or system might be what you need.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Editor with line counter for WIN95

2001-02-15 Thread David Robley

On Fri, 16 Feb 2001 06:15, Info wrote:
 Notepad, Wordpad and MS Word are my available choices.

 Word interpret my PHP so how to inhibit that?

 so I can get a line count and get closer to my many newbie errors
 ..OR..
 I need a recommendation of an inexpensive editor.

 I am reading digest so please CC or direct mailto:[EMAIL PROTECTED]

 Thanks,

 Lonnie

This comes up so often it ought to be a FAQ - if you look on the links 
page of your favourite mirror or www.php.net/links.php you'll find a link 
called Editor List to a page with info about lots of editors for all 
sorts of OSes.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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 COUNT Won't Work

2001-02-18 Thread David Robley

On Sat, 17 Feb 2001 04:27, Jeff Oien wrote:
 Yes! That was it. Thank you very much.
 Jeff Oien

  Are you using 3.23.33?  If so try removing the space between the
  COUNT and the open paren.  It looks like there may be a bug in the
  latest release (seeing this problem on the mysql list for MAX,
  probably exists for COUNT as well).
 
  -jm

For future reference, you can use mysql_error() after your call to the 
database to return the text of the error message from the previous mysql 
operation. In conjuction with mysql_errno(), you could build a little 
error reporting routine...

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] search engine

2001-02-18 Thread David Robley

On Sun, 18 Feb 2001 19:04, Brandon Feldhahn wrote:
 Can some one tell me how i would make a search engine, like what talbes
 and how many fields and what the form should look like

No need to reinvent the wheel - this uses MySQL and has a PHP front end - 
I believe that future versions of PHP will have more support for this app.

http://www.mnogosearch.ru/

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] check all values in HTTP_GET_VARS

2001-02-18 Thread David Robley

On Mon, 19 Feb 2001 11:54, Matthew Delmarter wrote:
 I want to check to see if all vars in HTTP_GET_VARS array are empty.
 How can I do this?

 The code would work like this:

 if(all HTTP_GET_VARS empty):
   do this;
 else:
   echo this;
 endif;




 Regards,

 Matthew Delmarter

Seeing it is an array, you could use sizeof to determine the number of 
elements and go from there.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Exec issue

2001-02-18 Thread David Robley

On Sat, 17 Feb 2001 04:26, [EMAIL PROTECTED] wrote:
 I have been having some problems getting exec to run a 'find
 /var/spool/mail/ -mindepth 3 -type d' command. She just wont execute it
 and give me a result, however she will run 'ls'

What result do you get running that command from the shell?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Sum function

2001-02-18 Thread David Robley

On Mon, 19 Feb 2001 06:57, Claudia wrote:
 I am looking for code that explains how to sum a value in a database
 based on a current field retrieved from the database.

 Example:

 query = "select course_name, course_build, milestone, testcase,
 time_tested, issue_status, comment,
bug_number, tested_by, date_tested from testissues where
 test_issue_id = $viewid";
 $result = mysql_query( $query );

 1 - retrieve needed fields from database based on the id the user links
 from ($viewid)
 2 - assign the course_name value from the query statement to a variable
 to be used on html page

 Assign: $course_name = mysql_result( $result, 0, "course_name" );

 Use variable:print " tdfont color =
 #00b$course_name/b/font/td\n";


 Now I would like to sum ALL the time_tested values in my database WHERE
 the course_name =
 $course_name (the variable retrieved for the record)

 query = "select sum(time_tested) where course_name = $course_name";
 $result = mysql_query( $query );
 $total_time = mysql_result( $result, 0, "sum(time_tested)");

 First issue -- php does not seem to recognize the value of $course_name

Do you mean here:
query = "select sum(time_tested) where course_name = $course_name";

because in that query $course_name should be enclosed in single quotes if 
it is a char type field.

 Second issue -- will the $total_time value be calculated correctly
 based on the above syntax?

What type of field is time_tested?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Pop-up warning dialog box

2001-02-18 Thread David Robley

On Mon, 19 Feb 2001 15:25, Edith Lai wrote:
 If i want to validate a form and check for empty input which then will
 produce a pop up warning dialog box, what should i do?

 thanks

If you want to do that client side, you'll need to write a little 
javascript routine which checks the input and does the dialog box bit.

But don't forget a) user may have js turned off and b) don't rely only on 
client side validation - recheck the data server side prior to processing 
it.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Trying to do a CVS import

2001-02-18 Thread David Robley

On Mon, 19 Feb 2001 15:34, Chris wrote:

  Hi all,

 I'm sludging away at writing PHP scripts that use CVS. It's been
 pretty slow going, mostly because it seems to be taking me a while to
 learn to think like CVS.

 One thing has me stumped. How the heck do I create a new project using
 import? Unless I'm totally offbase, I have to be 'in' the directory I
 want to import. Since I can't do anything like a cd from PHP, what do
 I do?

 Thanks,
 Chris

Does chdir() not work for you?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Multiple Selection.

2001-02-18 Thread David Robley

On Mon, 19 Feb 2001 15:43, toto wrote:
 the solution is javascript-based rather than php-based.

 Just put this codeand when you submit, the value you'll process
 stored in variable hidden_list_selected. each value selected are
 separated by comma delimiter.

 html
   head
   script language="javascript"
   function insert(thisObject){
   thisForm = eval("document.frmInput");
   thisForm.hidden_list_selected.value = "";

   // flag to put comma as separate variable for each 
selected
 category flag_first = true;

   
for(counter=0;counterthisObject.options.length;counter++){
   if(thisObject.options[counter].selected){
   if(flag_first)
   flag_first = false;
   else
   
thisForm.hidden_list_selected.value+= ",";
   
thisForm.hidden_list_selected.value+=thisObject[counter].value;
   }
   }
   }
   /script
   /head
   body

   form name="frmInput" method="post" action="testAction.php"
   select name="sel_category" multiple size="4"
 onChange="javascript:insert(this);"
   option value="Fruit"Fruit/option
   option value="vegetables"Vegetables/option
   option value="fish"Fish/option
   /select
   input type="text" name="hidden_list_selected" value=""
   input type="submit"
   /form
   /body
 /html


 -Original Message-
 From: BeeBoo [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, February 17, 2001 11:42 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Multiple Selection.


 If i'm going to let users select multiple choices from a list in a
 form, let say the part in the form is like this:

 select name="category" multiple size="4"
 option value="Praise"Fruit/option
 option value="Worship"Vegetables/option
 option value="Fellowship"Fish/option
 /select

 what code should i put in the submit part of the php to collect the
 multiple inputs? I tried array, but it seems not working. Please help.

 Thanks.


I think you need to name the list as an array thus:
select name="category[]" multiple size="4"

Then your receiving script can parse category as an array of the chosen 
elements.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] File Locking in PHP.

2001-02-19 Thread David Robley

On Tue, 20 Feb 2001 08:50, Matthew Toledo wrote:
 Hello, I am just starting to use PHP.  I have been using PERL for quite
 some time.  I was wondering if there is any specific FILE LOCKING I
 need to implement to keep more than one person from altering a text
 file at the same time.

 For instance, in PERL, you use the flock command to set up an advisory
 file lock.  Lets say that if I have a web page with a text based
 database, and more than one person wants to write to the file at the
 same time.  In perl, if you use flock(FILE, 2).  This causes person A
 to wait while person B writes to the file.  flock(FILE, 8) unlocks the
 file.  Then person A is allowed to write to the file.

 Does the perl equivalent of flock happen automatically in PHP?

 If not, how do you lock a file?

 Is it an advisory lock, or will it cause an error if two people try to
 access the same file at the same time for the same purpose (writing).

 Thanks,

The flock() function in PHP seems to do pretty much what you are looking 
for - it allows setting a shared or exclusive lock and you can control 
blocking while locking (at least according to the manual!)

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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 values for posted form in HASH array rather than just variables.

2001-02-19 Thread David Robley

On Tue, 20 Feb 2001 08:56, Matthew Toledo wrote:
 SUBJECT: Getting values for posted form in HASH array rather than just
 variables.

 I've been using perl for a while and am just starting with PHP.  I like
 it.

 Is there an array that holds all the information that was submitted via
 a FORM post or get.

 I know that PHP automatically creates variables that are named after
 the name of the INPUT tag on the HTML form.  But what if I don't know
 what the names of the input tags are?

 Are they stored in a HASH array as well?

 What is the name of the array?

 I.E. in perl, if you use cgi-lib.pl, all the form elements are stored
 in a HASH array called %in.  You don't need to know the names of the
 input tags to get the data from them.

 HTML HAS...
 input name="joe" type="text
 input name="alice type="text

 PERL Example.
 # library for handling CGI in
 require 'cgi-lib.pl';

 # get all the info from the form,
 # put it in HASH array called %in
 ReadParse();

 foreach $key (sort keys %in) {
 print $in{$key};
 }

 PHP EXAMPLE...
 # is there a hash array equivalent of %in like in the perl above?

Check out the section of the manual on PHP Variables (in the Variables 
chapter 7)

HTTP_POST_VARS and HTTP_GET_VARS will be the ones you are looking for - 
oh and possibly HTTP_COOKIE_VARS.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] mail()

2001-02-19 Thread David Robley

On Tue, 20 Feb 2001 08:52, Peter Houchin wrote:

  I have a mail script that works fine except that it does not send to
 the CC in my header options... nor will it send to multiple addresses
 can some one please give me some advice on this... I've looked in the
 php manual as well as other web pages  but neither have an answer for
 me.

 my code is below

 Thanks in advance
 Peter Houchin

SNIP CODE

 $headers .= "cc:[EMAIL PROTECTED],[EMAIL PROTECTED]\n"; //
 CC to

You might try using Cc: name@domain
Note capital C and space after the colon.


 //send the email

 $mailsend = mail("$address", "$subject", "$body.", "$headers
 \nContent-Type: text/plain;

Someone else pointed out the full stop :-)
 charset=iso-8859-1\nContent-Transfer-Encoding: 8bit" ); print
 ("$mailsend");

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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 problem

2001-02-19 Thread David Robley

On Tue, 20 Feb 2001 10:57, Josh G wrote:
 Hi, sorry to post this here, but it's driving me crazy. On my local
 machine, the following works no furys:

 create table category (category_id integer primary key
 auto_increment,name varchar(255) );

 But on the production machine, I get:

 ERROR 1064: parse error near 'auto_increment,name varchar(255) )' at
 line 1

 Any idea why It's driving me nuts..

 Gfunk -  http://www.gfunk007.com/


Is the version of Mysql on the production box an older one? autoincrement 
is comparatively new, I think.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] fread strangeness (was: nested echo and includes, mixed html / PHP)

2001-02-19 Thread David Robley

On Tue, 20 Feb 2001 11:37, Jaxon wrote:
 Same problem, found it's coming from somewhere else :(
 It looks as if fread or fopen is preventing PHP from from parsing ...

 index.php:

 ?
 $file="test.inc";
 $fd = fopen ($file, "r");
 $string = fread ($fd, filesize ($file));
 fclose ($fd);
 echo "$string";
 ?

 test.inc:

 html
 body
 ? echo "this comes from inside of test.inc"; ?
 /body
 /html

 index.html show a blank html page, with the contents of test.inc
 visible via view source...grr.  how can I get it to actually parse the
 PHP?

 help!
 jaxon


eval() is possibly what you need.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Help with prev, next

2001-02-19 Thread David Robley

On Tue, 20 Feb 2001 15:10, Keith Devens wrote:
 Hi, I'm getting some weird behavior from prev() and next(). If anyone
 knows what's going on please let me know. Also, please make sure you
 e-mail me personally in addition to the list.

 Anyway, here's the problem. Check out the following code:

 ?php
 $arr = Array(1, 2, 3, 4);

 echo current($arr) . "br"; #prints out 1
 echo next($arr) . "br"; #prints out 2
 echo next($arr) . "br"; #prints out 3
 echo next($arr) . "br"; #prints out 4
 echo prev($arr) . "br"; #prints out 3
 echo prev($arr) . "br"; #prints out 2
 echo prev($arr) . "br"; #prints out 1
 ?

 It does the expected and prints out 1234321 (without the brs).
 However, if I add one more call to next() in there, it only prints out
 1234. It seems like the call to next that goes past the end of the
 array sort of "breaks" it so you can't go back again. If I do a call to
 end() it prints out 4, so the array still 'works', but I can't get back
 using prev(). Anyone know why? Thanks!

 Keith

Ha - finally a use for all that stuff I learned about pointers in 
Advanced Programming :-) (And it's in the docs if you look)

According to the docs, "If advancing the internal array pointer results 
in going beyond the end of the element list, next() returns false" so 
when you try an print out the result, you get nothing. And once the 
pointer goes beyond the end (or beginning, with prev) its position is 
undefined and you need to use an absolute positioning instruction like 
end or reset to relocate the pointer in a known position.

Analogy - it's a bit like walking up and down stairs - if you are 
currently on a step then 'go up one step' or 'go down one step' makes 
sense; but if you step off the stairs then you could be anywhere in 
relation to the stairs, even out side the building.

Hmm, that's not a real good analogy - someone else?


-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] header

2001-02-19 Thread David Robley

On Tue, 20 Feb 2001 17:19, Fabian Fabela wrote:

  Do I have to have special configuration to use the header function,
 this is because it is not responding.

 I use it like this.

 header('Location: contrato.html');

 Thank you.

 Fabian Fabela
 [EMAIL PROTECTED]
 www.vacagorda.com

You may find you need to use a full URL. For more information on how raw 
http headers work, see

http://www.w3.org/Protocols/rfc2616/rfc2616

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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: FW: [PHP] httpd.conf question...

2001-02-20 Thread David Robley

On Wed, 21 Feb 2001 07:56, Brandon Orther wrote:
 Hello,

 Is there a way to make an .htaccess file to make the server not time
 out when uploading a file?

 Thank you,

http://www.php.net/manual/en/configuration.php


-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Problems with Mail

2001-02-20 Thread David Robley

On Sat, 17 Feb 2001 05:40, Chris Anderson wrote:

  I use the php mail function in this file, but it only sends the first
 line of the text. Any ideas? I attached the file


The mailing list stripped your attachment - perhaps you could paste it 
into your message?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] fopen problem... maybe?

2001-02-20 Thread David Robley

On Wed, 21 Feb 2001 15:23, Ben Weinberger wrote:
 Hi~
 We're working on a page located at
 http://www.manageasy.com/request_offer.php3. The page comes up with a
 bunch of errors, and we don't know why-- the page worked on our old
 server, and we didn't change anything from there... we think it might
 be a permissions issue on the new server.  Does anyone have any ideas
 off hand?

 Thanks,
 -Ben

Somebody else had a similar problem recently and the broad outcome was 
that the script is trying to access parts of a mysql result set that 
doesn't exist. Check the recent archives for more detail.

Cheers
-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Problems with Mail

2001-02-20 Thread David Robley

On Sat, 17 Feb 2001 08:31, Chris Anderson wrote:

Oy - your version of Windows appears to be lagging a few days behind the 
real world :=)

 true, here it is. Have fun...sorry ^_^

 ?php
 include "Nav.inc";
 ?

 img src=images/feedback.jpg

 ?php
 if(isSet($send)  ($send == 1))

Isn't this redundant? Your test is really if send = 1 do something, 
otherwise do something else.

 {

   error_reporting(0);
   $Address = "[EMAIL PROTECTED]";
   $Subject = "Feedback From NullTechnology.com";
   $Message = str_replace("\n","br",$Message);
   $Mail = mail($Address, $Subject, "$Message \n From: $Return");

This is wrong  The additional stuff needs to go in the fourth 
parameter if you want it to show up in the From field,; as you have it, 
it will be tacked on the end of the message body.

$from = "From: $Return";
$Mail = mail($Address, $Subject, $Message, $Return);

I wonder if you need to do some text wrapping? Although Outlook generally 
doesn't seem to care about such things, maybe something in the mail chain 
might.

   if($Mail == 1)

and I think this will always be true once PHP has offloaded the mail to 
the MTA, even if the MTA drops it on the floor.

SNIP more code

Failing that, you might need to look carefully at the actual content of 
the message - not getting any unexpected characters or somesusch???

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] % Help

2001-02-20 Thread David Robley

On Wed, 21 Feb 2001 16:01, Jeff Lacy wrote:
 Hello Everyone,

 Could someone please explain the whole % thing?  I sort of understand
 it, but not quite.  My goal is to have a table, and have every row
 alternate between 4 colors.  I can alternate sort of alternate between
 3, but not quite.  I have tried lots of different combinations, but I
 can't figure it out.  Thank you very much!


 Maybe there should be a better link to it in the manual.  The only one
 I could find was at http://www.php.net/manual/en/ref.math.php, but it
 is far from clear (to me at least).

 Jeff Lacy

 P.S.  Please email me directly, and respond to the list because I am
 not really subscribed to it.  When I look at the newsgroup, it crashes
 Outlook Express, and the list is VERY high volume (for me).  Thanks
 again.

Perhaps you should be looking in Arithmetical Operators 
www.php.net/manual/en/language.operators.php

The modulus operator gives you the value of the remainder after dividing 
a by b, so 4 % 3 will give a result of 1; ie 3 goes into 4 once and 
leaves a remainder of 1

Or 10 % 3 also gives a result of 1; 20 % 6 gives 2 etc.

Now for your particular problem of alternating table colors, you don't 
necessarily need the modulus operator, but using it you could implement 
thus:

$color = array('#ff'=0, 'blue'=1, 'red' =2, 'green' =3);
$row_num = 0;
$how_many_colors = 4;
while {
//Build your row producing logic here
echo "TR BGCOLOR=\"$color[$row_num % $how_many_colors]\"";
// Rest of row info
$row_num++;

}

Mind you, there might be the odd syntax error there; I didn't test this 
at all :-) but hopefully you get the idea. The value of $row_num % 
$how_many_colors will cycle through 0 - 3 and act as the subscript for 
the array of colours. If you want more colours, just increase the number 
of values in the array and adjust $how_many_colors accordingly.


Cheers
-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Why Arrays in Forms? ( Was Accessing variables from a form )

2001-02-21 Thread David Robley

On Thu, 22 Feb 2001 08:24, Brian White wrote:
 That's the point - why do I have to have 'name="myArray[]"'. Why
 do I have to specify the '[]'s at all?

 Brian

 At 13:44 21/02/2001 -0800, jason cox wrote:
 You don't have to specify them as "PHP arrays".  You
 can do something like:
 
 input type=text name="myArray[]"
 input type=text name="myArray[]"
 input type=text name="myArray[]"
 input type=text name="myArray[]"
 
 PHP will create the array for you.
 
 Jason

 -
 Brian White
 Step Two Designs Pty Ltd - SGML, XML  HTML Consultancy
 Phone: +612-93197901
 Web:   http://www.steptwo.com.au/
 Email: [EMAIL PROTECTED]

Because otherwise you have one variable name, and it will contain the 
last value which was assigned to it.

I don't know any languages where you can do:

$value = 'A'
$value = 'B'
$value = 'C'

print $value 

and get a result other than C 


-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] array headaches

2001-02-21 Thread David Robley

On Thu, 22 Feb 2001 02:11, Matt Williams wrote:
 I have done it this way...

   $menu = array();
   $count = $db-num_rows();
   for($i = 0; $db-next_record(); $i++)
   {
   $menu[$i]["name"] = $db-f("name");
   $menu[$i]["url"] = $db-f("topic_id");
   }

 OK, so is there a better way of acheiving the same end result?
 and this is what I've got to print the results

   while ( list($name, $subarray) = each($menu) )


   echo "a
 href=\"".$subarray["url"]."\"".$subarray["name"]."abr\n";

   }

 is there any better way of doing this??

 thanks

 M@

Why do you need to put the values in an array, then read through the 
array to print the values? Why not just print each record as you get it 
from the DB?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Adding new data at beginning.

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 08:34, Jan Grafström wrote:
 Hi!
 I am trying to put in a new data at the beginning of a file.
 I have started like this;

 

 $yourfile = "test.xml";  (abcdef/c this is the file.)
 $fp = fopen ($yourfile, r);
 $message  = array(1 = 'a', 'b', 'c', 'd', 'e', 'f',
 '/c');
 Here I need some code to get the output look like
 this"abnewcdef/c"

 print_r($message);
 fwrite ($fp, $message);
 fclose ($fp);

 I am thankful for any help.

 Regards
 Jan

You need to do something like:
open file for read
while(condition not met)
  read file line by line into array
endwhile
add your element(s) to the array
read the rest of the file into the array
close file
open file for write [which will truncate the file]
write the array to file
close file

You could perhaps enhance this by writing to say a temp file and once you 
are satisfied the write is complete, rename the temp file to the original.

The 'while condition not met' is the test you use to determine when you 
get to the part of the file where you want to add your bits.

Cheers
-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Obtaining a value from dynamic list box

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 05:21, Claudia wrote:
 When selecting a value from a dynamically generated list box, the
 subsequent value passed to the table truncates when
 there is a blank in the string

 Here is the table structures (Mysql database)

 First table has variable course_name (varchar -- length 50)
 This database will be used to generate the dynamic list box for the
 course_name field.
 Second table has variable issue_course_name (varchar -- length50) and
 is the variable that stores the result of the selected
 course name in the dynamic list box.

 Here is the code that is currently truncating all characters after the
 space:

 td height="41" bgcolor="#FF"nbsp;nbsp;';

  $result = mysql_query("select course_name from coursebuild
   where course_status = \"in_test\"
   order by course_name asc");

  echo "select name='issue_course_name' size=1";
  echo "option value='' Select Course \n";

  if ($myrow = mysql_fetch_array($result))
   {
  do
  {
  echo "option
 value=$myrow[course_name]$myrow[course_name]/option\n";
  }
  while ($myrow = mysql_fetch_array($result));
  echo "/select";

 Insert statement

 $query = "insert into testissues ( issue_course_name)
 values ( '$issue_course_name') ";
   $mysql_result = mysql_query($query, $mysql_link);

IIRC the relevant standards require that values in tags be enclosed in 
quotes if they [are likely to] contain spaces. So at minimum your OPTION 
tags should look like:
echo "option
 value=\"$myrow[course_name]\"$myrow[course_name]/option\n";

Having said that, you could handle this better if you have an 
autoincrement field like course_id that uniquely defines each course_name 
record - then you could use the course_id as the VALUE in the option tag; 
you may have to do a lookup at the INSERT stage to get the value of 
course_name.


-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] select name=....

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 14:46, Peter Houchin wrote:

  if i have a form with a select box in it how an i get the values to
 echo a php value ...
 
 ie
 
 SELECT NAME="state" SIZE="1" 
 OPTION VALUE="Canberra"ACT/OPTION 
 OPTION VALUE="Victoria"VIC/OPTION 
 /SELECT 
 
 can i change it to say
 SELECT NAME="state" SIZE="1" 
 OPTION VALUE="? echo $state ?"ACT/OPTION 
 OPTION VALUE="?echo $state ?"VIC/OPTION 
 /SELECT 
 
 so that when the page loads it shows which ever option is in the Data
 base?
 
 Peter Houchin
 Sun Rentals
 [EMAIL PROTECTED]
 

I think you are asking how to show the selected value?

Something like

OPTION VALUE="Canberra"
?php if ($value == 'Canberra') {
  echo ' SELECTED ';
}
ACT/OPTION

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] mail prob

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 16:32, W.D. wrote:
 so there is no way to pull this variable from an email form field?

  From: "W.D." [EMAIL PROTECTED]
 
   I'm using a remote host, and when I call mail() with all the var's

 pulling

   values from form fields, it still shows as nobody in from header.
   Is

 this

  a
 
   server situation? Theyre using php4 support and they claim its that
   I'm
 
  not
 
   using appropriate variables in the function.
 
  You have to set the From header manually:
 
 
  ?php
  $to = "[EMAIL PROTECTED]";
  $from = "[EMAIL PROTECTED]";
  $subject = "Blah";
  $body = "Lorem ipsum dolor sit amet.";
 
  mail($to, $subject, $body, "From: $from");
  ?
 
 
  http://www.php.net/manual/en/function.mail.php
 
 
  Regards
 
  Simon Garner

Well, you can use a variable from _anywhere_ Simon's example uses a 
variable set locally just so you can see exactly what is going on.

But if you had a form element called, say, reply_address in which the 
user types an email address, you could pass that as the fourth argument 
to mail().

Of course, in this case you have no control over the accuracy or validity 
of the address entered. But that's a whole different question - search 
the archives for info on validating email addresses. And somebody has 
published a class somewhere?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Can't connect php to mysql on linux

2001-02-25 Thread David Robley

On Sat, 24 Feb 2001 16:10, George  Alexander wrote:
 Hi,

 I working on Redhat Linux 6.1 and I've installed
 MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is
 working fine. I've even created a database also using MySqlAdmin.
 Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
 Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed
 php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.

 My problem is I can't connect PHP to Mysql Db using the
 mysyql_connect("localhost","root","mypassword") command.

 Please help me asap.
 Regards,
 George

Use mysql_error() after your unsuccessful call to mysql_connect to return 
a mysql error string

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] php.ini

2001-02-25 Thread David Robley

On Sun, 25 Feb 2001 18:21, Brandon Feldhahn wrote:
 what do i put in the "Sendmail_from" section of php.ini?

Did you check the documentation, or the sample ini file? According to the 
docs,

sendmail_from string

Which "From:" mail address should be used in mail sent from PHP under 
Windows.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] switch statement

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 12:33, Peter Houchin wrote:

  Does any one know where there are some tutorials for the switch
 statement?
 
 Peter Houchin
 Sun Rentals
 [EMAIL PROTECTED]

 
Have a quick look at 
http://www.php.net/manual/en/control-structures.switch.php
which has some user notes which are possibly useful over and above the 
actual documentation.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] switch statement

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 13:20, Peter Houchin wrote:
 I'm playing aruond with the switch statement trying to get one to work
 for $submit
 I have 2 forms on the one page (only one displays at a time) 1 is for
 creating a new record in my data base the other is for
 updating/changing values from the first form should there be any. So i
 want it to switch between the 2 cases

OK. Suppose the possible values for $submit are 'insert' and 'update'. [I 
assume those are values _you_ can assign to a submit button]

Then

switch($submit) {

case 'insert':
  // Your insert stuff here
  break; //So it doesn't fall through to the next case

case 'update:
  // Your update stuff here
  break;

case default:
  // The page has somehow been called without a value (or an
  // inappropriate value) for submit
  // Error handling or whatever here

}

Does that make it clearer? or muddier :-)

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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 file

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 13:29, JW wrote:
 I have created a config.php3 to store the connection of the database
 and some constant variable. Then, I created the other file
 functions.php3 and inculde config.php3 into this file for
 function.phps3 should use some variables inside the file config.php3.
 However, I don't know why all the variable cannot display in the
 function.php3.

 would anyone please to tell me what is the reason and how I can solve
 it?

You may need to declare the variables global within the function, or pass 
them as arguments to the function.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] PHP4 directives in httpd.conf not working

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 15:30, Brian White wrote:
 I have php4 running under Apache. Under that apache I have several
 VirtualHosts. I want to set to some of the PHP.INI values under
 one of those hosts. So far I have tried the following values in
 my httpd.conf file:

 1) include_path   "/my/phpinc/path"
 2) php_include_path   "/my/phpinc/path"
 3) php3_include_path  "/my/phpinc/path"
 4) php4_include_path  "/my/phpinc/path"

 None of them have worked - I can't even restart Apache with them in
 place. "/my/phpinc/path" definitely exists.

 What am I doing wrong?

 Regs

 Brian White

PHP4 uses different Apache configuration directives (see 
http://au.php.net:81/manual/en/configuration.php ) I think the one you 
want is probably php_value so

php_value include_path "/my/phpinc/path"

might work.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] archive location

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 05:33, Jerry Lake wrote:
 What is the newsgroup archive location ?
 marc.themaesgroup.something ?

 Jerry Lake- [EMAIL PROTECTED]
 Web Designer
 Europa Communications - http://www.europa.com
 Pacifier Online   - http://www.pacifier.com

nearly - marc.theaimsgroup.com or check /support.php at your local PHP 
mirror for direct links to all the mail list archives.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Walking Through Mail Headers

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 06:28, Jason wrote:
 Hi,

 I need a way to walk through mail headers and search for a specific
 string in the subject. If the message contains the string, it will be
 forwarded to a different account, otherwise it will trigger an
 autoresponse with a certain message to the sender. Does anyone have any
 infomation on doing this, or can point me where to start. I think the
 thing I'm caught up on is how I walk through the mail headers in the
 mail file (We are on FreeBSD). Thanks.

 Jason

Procmail should be able to do this for you?

But how are you actually dealing with the incoming mails? Are they being 
sent to the php script as they arrive from an alias or procmail, or are 
you attempting to parse the contents of the mail spool file for a 
particular user?

If it's the former, all you need to do is parse each line until you find 
the one beginning with Subject and do the necessary.

If the latter, you'll need to check the relevant RFCs to determine how 
messages are separated in the spool, and how the body of the message is 
separated from the headers - I'm fairly sure that's two newlines. RFC1822 
from memory?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] PERL to PHP

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 01:28, Clayton Dukes wrote:

  Hi :-)
 Can someone tell me how to do the equivalant of this Perl script in
 PHP?

 ###
 ### This function prints all lines between the dashes read in a text
 file ###
 ### The file looks like this:

 # -
 # Somedata:   something
 # Someother:  something else
 # --
 #
 # Several paragraphs
 # Several paragraphs
 # Several paragraphs
 # --END--
 #



 #!/usr/bin/perl -w
 @rray = STDIN;


 $inside = 0;
 foreach $line (@rray) {
   if ($line =~ /-/ig) {
 $inside = 1;
   } elsif ($line =~ /-/gi) {
 $inside = 0;
   }

   if ($inside == 1) {
   print $line;
 }
 }


 TIA!

Seems like your solution boils down to this:

Set toggle = 0
open file for read
while not EOF
Read file line by line
  if(line has dashes)
toggle = not(toggle)  // flip the toggle
  endif

  if (toggle)
print line
  endif
endwhile
close file

The code is left as an exercise for the student :-)

Cheers
-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Weird Problem

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 05:53, Steve Segarra wrote:
 Hi everyone,
   First, let me explain I am a very knowledgable php developer.  I'm not
 someone trying to write their first script.  I have been working on a
 very large and complex problem for some time now when it suddenly
 stopped working.  I did not change anything in any configurations or
 edit any code that would have affected how my database functionality
 class would function.  But, all of my connections started to bomb out.

 Follows are the entire contents of a file simp.php (minus the line
 numbers):

 1  ?
 2
 3  $db = mysql_connect("localhost", "web", "pw") || print "error
 connecting   ".mysql_error()." ".mysql_errno();
 4  mysql_select_db("surveys");
 5
 6  $result = mysql_query("select * from attract") || print "error
 querying   ".mysql_error()." ".mysql_errno();
 7
 8  $i = 0;
 9  while ($row = mysql_fetch_array(mysql_query("select * from
 attract"))){ //  ($i++  5)){
 10   echo $row[0]." ".$row[1]."br";
 11 }
 12 ?


 Please note that the user web@localhost identified by pw has
 permissions to select from the table attract.

 Here is what I have identified so far:

 A - If I use $result in mysql_fetch_array() line 9, I get the error:
 Warning: Supplied argument is not a valid MySQL result resource
 in simp.php3 on line 9

 But if I use the statement mysql_query("select * from attract")
 in its
 place, the loop (although infinite) will produce expected results, ie
 print out the first and second columns of the first row of the table
 infinitely.  So basically, I would conclude the life of the variable
 result is terminiating before I can use it.  Why, I don't have a clue.

 B - Being tired of an infinite loop in my investigation, I added line 8
 and I placed the statement  ($i++  5) inside the while loop
 condition.  Now, only the br and spaces from line 10 will print, not
 the actual values of the $row array.  The output is br br br br
 br, with no values from the table attract.

 This is where I stand now, completely flabberghasted and nearly insane.
 Can anyone shed any light on this before I have to commit to bringing
 down the webserver while I reinstall php4.  (oh, btw I am running
 Apache/1.3.14 (Unix) PHP/4.0.4pl1 on Red Hat 6.2 (I hate redhat, but
 the bossman says its better supported than slakware.  bah.))

 Thank you all for your help.
 steve

Is it possible that the || construct doesn't work in the way you are 
using it and thus you aren't seeing mysql_error? The most common examples 
I have seen use the actual string 'or'. Try with a query that you _know_ 
will trip an error.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] redirect pages

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 14:58, Peter Houchin wrote:

  can some one offer a suggestion please ... i have a  
 
 if ($update) {
 $result=foo;
 }
 
 in that if statement i want to redirect them to another page after it
 has processed the result ..
 
 i tried having using
 
 if ($update) {
 $result=foo;
 echo "META HTTP-EQUIV=\"refresh\" CONTENT=\"1;page.php\"";
 }
 
 but to no avail ..
 
 any suggestions ?
 
 Peter Houchin

if ($update) { 
 $result=foo; 
 header("page.php"); 
 } 

and make _absolutely_ sure that your script doesn't even have a white 
space _anywhere_ before issuing the header.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] redirect pages

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 15:15, David Robley wrote:
 On Tue, 27 Feb 2001 14:58, Peter Houchin wrote:
   can some one offer a suggestion please ... i have a
 
  if ($update) {
  $result=foo;
  }
 
  in that if statement i want to redirect them to another page after it
  has processed the result ..
  i tried having using
 
  if ($update) {
  $result=foo;
  echo "META HTTP-EQUIV=\"refresh\" CONTENT=\"1;page.php\"";
  }
 
  but to no avail ..
 
  any suggestions ?
 
  Peter Houchin

 if ($update) {
  $result=foo;
  header("page.php");

I mean, of course
  header("Location: page.php");

Must teach fingers to wait for brain to engage :-)

  }

 and make _absolutely_ sure that your script doesn't even have a white
 space _anywhere_ before issuing the header.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Help Needed Please

2001-04-03 Thread David Robley

On Wed,  4 Apr 2001 09:27, Peter Houchin wrote:
 Hiya i've got a script that basically draws values from a db and will
 display them, as i have multiple records in there and want to display
 them all i'm using a 
 while ( ($myrow = mysql_fetch_array($result) ) )
 statement this is all good as far as it will display them all how ever
 when i go to update the fields i get id=++ instead of the actual id
 value ie 1, 2, 3, etc ..
 
 any suggestions would be apreciated 
 
 Peter Houchin
 [EMAIL PROTECTED]
 
 snip 
 $rs = "UPDATE main SET system='$system',"; 
 $rs .= "part='$part',"; 
 $rs .= "monthly='$monthly',"; 
 $rs .= "WHERE id=$id"; 
 
 
 $result = mysql_query($rs,$db); 
 ? 
 form name="update" method="get" action="../../ben.php" 
 ? 
 $foo = "SELECT * FROM main"; 
 
 $result = mysql_query($foo); 
 while ( ($myrow = mysql_fetch_array($result,$db) ) ) { 
 
 $id = $myrow["id"]; 
 $system = $myrow["system"]; 
 $part = $myrow["part"]; 
 $config = $myrow["monthly"]; 
 
 ? 
 !--form elements with echo on $myrow, and id hidden-- 

This  might be the place to start - what do you get when you view the 
source??

 ? 
 } 
 ? 
 input type="submit" name="submit" value="Submit"
 snip

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Help Needed Please

2001-04-03 Thread David Robley

On Wed,  4 Apr 2001 11:23, Peter Houchin wrote:
  
  snip 
  $rs = "UPDATE main SET system='$system',"; 
  $rs .= "part='$part',"; 
  $rs .= "monthly='$monthly'"; 
  $rs .= "WHERE id='$id'"; 
  
  
  $result = mysql_query($rs,$db); 
  ? 
  form name="update" method="get" action="../../ben.php" 
  ? 
  $foo = "SELECT * FROM main"; 
  
  $result = mysql_query($foo); 
  while ( ($myrow = mysql_fetch_array($result,$db) ) ) { 
  
  $id = $myrow["id"]; 
  $system = $myrow["system"]; 
  $part = $myrow["part"]; 
  $config = $myrow["monthly"]; 
  
  ? 
  !--form elements with echo on $myrow, and id hidden-- 

 
 This  might be the place to start - what do you get when you view
 the 
 source??
 

  ? 
  } 
  ? 
  input type="submit" name="submit" value="submit"
  snip

 
 i get all id numbers for the records in the hidden id fields as well as
 all data that was originally in the db ...
 
 just a thought when i do a print $rs; i get this  
 
 UPDATE main SET system='A33',part='cpu/mem',monthly='6000'WHERE id=''
 
  which is that last record in the db .. so for some reason it's not
 picking up any id numbers :

OK - how are you passing (or trying to pass) the value for id? When I do 
this, I usually show the ID for each record as a link, and pass the ID 
via the link.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] how to return strings from functions?

2001-04-03 Thread David Robley

On Wed,  4 Apr 2001 15:44, Vlad wrote:
 Hi all

 script example:

 function smth(){
  $result = '1234 - the number';
 return $result;
 }
 ...
   $res = smth();
 ...
 After this $res takes value of 1234 not the actual string.
 Is any soolution here?

 Thanks, Vlad

If you do
 function smth(){
 $result = '1234 - the number';
 return $result;
 }
  $res = smth();
echo $res;

The output is

1234 - the number

What else is in your script?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Emails from database...

2001-04-04 Thread David Robley

On Wed,  4 Apr 2001 16:58, Dhaval Desai wrote:
 Hi!


 This is my code for sending email to all the emails in
 my database:

 $connect = mysql_connecT();
 $query = "select email from table";
 $execute = mysql_db_query("database", $query);

 while($r=mysql_fetch_array($execute))
 {
 $email .= $r('email')

 mail("$email", "My Subject", "Line 1\nLine 2\nLine
 3");
 }



 Will this send email to all the emails in the
 database?
 Is there any otehr wya of doing it?


 Thank You

 Dhaval Desai

If you fix your syntax in the line starting $email, and if you comma 
separate the list of email addresses, and put the mail function outside 
the loop, and there aren't too many mails for your MTA, you might have 
some success.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] insert into multiple tables

2001-04-04 Thread David Robley

On Thu,  5 Apr 2001 02:29, Toni Barskile wrote:
 Can someone please help me w/the following code? I'm trying to insert
 data collected on a form into two tables into my database. I 
 know the SQL statements work because I tested them individually, but I
 keep getting the error "Couldn't execute query 2". Does  
 anyone have any suggestions?

 Thanks in Advance


 Toni


 ?php
 $sql = "INSERT INTO users (fname, lname, compid, status, dept, room,
 bldg, phone) VALUES ('$fname', '$lname', '$compid',  
 '$status', '$dept', '$room', '$bldg', '$phone')";
 $sql1 = "INSERT INTO tickets (ticket_num, compid, date_rpt, time_rpt,
 request_type, hardware, model, dci, dci_num, software_type,
 software_pkg, problem, comments, entered_by) VALUES ('$ticket_num',
 '$compid', '$date_rpt', '$time_rpt', '$request_type',
 '$hardware','$model','$dci','$dci_num','$software_type','$software_pkg'
,'$problem','$comments','$entered_by')";

 /*create connection*/
 $connection = mysql_connect("hostname","user","password") or die
 ("Couldn't connect to the server");

 /*select database*/
 $db = mysql_select_db("db_name", $connection) or die ("Couldn't select
 database");

 /*execute query and get result*/
 $sql_result = mysql_query($sql, $connection) or die ("Couldn't execute
 query1");
 $sql_result1 = mysql_query($sql1, $connection) or die ("Couldn't
 execute query2");

  if (!sql_result){
  echo "pCouldn't add record!";
  } else{

  echo "
  p Record Added!/p
  table cellspacing=5 cellpadding=5
 /*More code down here...*/

Try using mysql_error() instead of the 'die' so you get an error message 
back from mysql. My guess is that you are attempting to insert strings 
into integer fileds.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] headers passthru()

2001-04-04 Thread David Robley

On Thu,  5 Apr 2001 13:29, Nikolai Vladychevski wrote:
 Hi,

 i got this problem, when I use an executable to produce the output for
 the html php sends headers screwing it all. For example, my script is
 like this:


 ?
 .
 some stuff in php using database to prepare tempfile
 
 
 passthru("cat $tempfile | /usr/local/bin/somecgi");
 unlink($tempfile);
 exit;
 ?

 in this example PHP does not generate HTML code, but the problem is it
 still sends header "Content-type: text/html". Why? I really dont need
 this , because my "somecgi" script produces its own headers and 
 actualy it is redirecting. So, this "content-type: text/html" that php
 generates is really screwing it all and redirect is failing. How can I
 disable php printing headers at all?

 I am sure no HTML nor headers are printed during php execution before
 "passthru" command. To make sure I placed a call to headers_sent()
 before passthru() and it returned false, after passthru() it returns
 true.

 Any ideas what to do?
 Thanks a lot
 nikolai

php -q should prevent headers being produced. php -h for any other help.
-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Emails from database...

2001-04-05 Thread David Robley

On Thu,  5 Apr 2001 16:27, you wrote:
 Hi!

 Do u mean the code should be like this?


 $connect = mysql_connect();
 $query = "select email from table";
 $execute = mysql_db_query("database", $query);
 while($r=mysql_fetch_array($execute))
 {
 $try = $r('email');

Your syntax is wrong here - see the example in the docs for 
mysql_fetch_array

 $email .= $try . ";";

and multiple addresses are separated by comma

 }

 mail("$email", "My Subject", "Line 1\nLine 2\nLine
 3");


It might be wise to just echo what you are proposing to pass to mail() 
until you get it right.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] YourName.BEST321.com FREE§K¶O°ì¦W !!!!!

2001-04-05 Thread David Robley

On Thu,  5 Apr 2001 23:46, Zeus wrote:
 I somehow got a feeling, someone is purposely, selling the php-general
 list to some spam companies ;P

 - Original Message -
 From: Water [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, April 05, 2001 6:12 PM
 Subject: [PHP] "YourName.BEST321.com" FREE KOW !

Hrm - I got three of these, one via php-general, one via the mirrors list 
and one direct to an address that isn't the one I use for php-general 
(although it might be the mirrors one).

Hate spammers.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] How can I chmod something with php.

2001-04-05 Thread David Robley

On Fri,  6 Apr 2001 05:45, Brandon Orther wrote:
 Hello,

 I have been looking for a chmod command in the ftp functions, and there
 isn't any.  how can I chmod something?

 thanks
 Brandon

I think you need ftp_site()

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] mystery line

2001-04-05 Thread David Robley

On Fri,  6 Apr 2001 13:00, Martin Skjldebrand wrote:
 It's not first of April today is it?

Only where you are :-)


 In:

 ? if ($id != "") {

   print "center";
   print "pTID detail view - Document #b?php echo $id; ?/b/p";


 $sql="select * from tid_tbl where id=" . $id;
 $result1=mysql_query($sql, $mysql_link);
 $row = mysql_fetch_array($result1);
 echo 'table border="1"';
 echo 'trtd BGCOLOR="' . $headerbg . '"Subject/tdtd' .
 $row["subject"] . '/td/tr';
 echo 'trtd BGCOLOR="' . $headerbg . '"
 valign="top"Issue/Info/tdtd' .  ereg_replace (13, "",
 nl2br($row["body"])) .  '/td/tr'; echo 'trtd BGCOLOR="' .
 $headerbg . '"Author/tdtd' . $row["author"] . '/td/tr';
 echo 'trtd BGCOLOR="' . $headerbg . '"' . $contact . '/tdtd' .
 $row["company"] . '/td/tr';
 echo '/table/center';
 }
 ?

 The third line (starting print "p TID detail") is my mystery line.
 If I comment it out ("// print "p TID detail...") the parser chokes
 on on the last line (or I suppose somewhere between).
 While I totally delete it everything is OK. What is the parser seeing
 that I'm not?

 M.


If you change that to:

print "pTID detail view - Document #b$id/b/p";

it should work; It's probably getting confused by the php open/close tags 
in the middle of a set of php tags.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] mystery line

2001-04-05 Thread David Robley

On Fri,  6 Apr 2001 13:50, Martin Skjldebrand wrote:
 Tyler Longren wrote:
  In line 3, you don't need your ? ? tags again.
  This is how you have it:
  print "pTID detail view - Document #b?php echo $id; ?/b/p";
 
  this is how it should be:
  print "pTID detail view - Document #b$id/b/p";

 Ofcourse, I've seen that all the time - and yet ...
 oh well ... a bug in the carbon based part of the system I suppose.

 Thanks,

 Martin S.

That's PWCKI or Problem With Chair to Keyboard Interface :-)

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] This loop is screwed up totally. Why o why o why....

2001-04-08 Thread David Robley

On Mon,  9 Apr 2001 13:56, you wrote:
 Hi I have a feild in a MySql database called features. It is delimited
 by | the line above the \ key.
 Anyway, the feild has things like PS|PW|AC etc in it.
 I have the code below to explode that feild. It all works fine, but
 when it comes to looping the code below it always misses that last
 value. (Example - AC)
 Only in the IF statement - if i echo the variable "$feature" out of the
 IF statment it prints the text fine. But i need it to check for the
 existance of a gif first to display in the window.
 As you will see I have gifs with the names and the variable $feature
 ends with .gif
 It works great, but it misses the last value to the array $feature.
 Any ideas.

 $specs = $myrow[features];

 $features = explode('|',$specs); //What the feild is delimited by
 '|' reset ($features);

   while (list(, $feature) = each ($features)) {

if (file_exists("features/$feature.gif")){
echo "img src=\"features/$feature.gif\"br";
echo "$feature";
}

} //End While


 --
 Regards,


 YoBro

This seems to work OK for me:
?php
$specs = "PS|PW|AC";
$features = explode('|',$specs); //What the feild is delimited by '|' 
reset ($features);

while (list(, $feature) = each ($features)) {

if (!file_exists("features/$feature.gif")){
echo "img src=\"features/$feature.gif\"";
echo "$featurebr\n";
}

 } //End While
?

Is it possible that you don't hve a matching image for the last item?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] This loop is screwed up totally. Why o why o why....

2001-04-08 Thread David Robley

On Mon,  9 Apr 2001 14:27, Yo Bro wrote:
 I do have a matching image, and all cases it does work with different
 records from the database. IE Where there might be an array of 15
 items, but it is always the last one that doesn't show. Even if the
 image is there, because it gets used if i add another value to the
 array. IE
 PS|PW|AC|CD

 In this case all but CD would be displayed.
 Still no luck.

 I noticed your code used if (!file_exists
 Where as I want to check if it does exist. Is your way worth a try?

Had to do that because, of course, I don't have the image files :-) You 
could try it


 "David Robley" [EMAIL PROTECTED] wrote in message
 01040914213301.26561@www">news:01040914213301.26561@www...

 : On Mon,  9 Apr 2001 13:56, you wrote:
 :  Hi I have a feild in a MySql database called features. It is
 :  delimited by | the line above the \ key.
 :  Anyway, the feild has things like PS|PW|AC etc in it.
 :  I have the code below to explode that feild. It all works fine, but
 :  when it comes to looping the code below it always misses that last
 :  value. (Example - AC)
 :  Only in the IF statement - if i echo the variable "$feature" out of
 :  the IF statment it prints the text fine. But i need it to check for
 :  the existance of a gif first to display in the window.
 :  As you will see I have gifs with the names and the variable
 :  $feature ends with .gif
 :  It works great, but it misses the last value to the array $feature.
 :  Any ideas.
 : 
 :  $specs = $myrow[features];
 : 
 :  $features = explode('|',$specs); //What the feild is delimited
 :  by '|' reset ($features);
 : 
 :while (list(, $feature) = each ($features)) {
 : 
 : if (file_exists("features/$feature.gif")){
 : echo "img src=\"features/$feature.gif\"br";
 : echo "$feature";
 : }
 : 
 : } //End While
 : 
 : 
 :  --
 :  Regards,
 : 
 : 
 :  YoBro
 :
 : This seems to work OK for me:
 : ?php
 : $specs = "PS|PW|AC";
 : $features = explode('|',$specs); //What the feild is delimited by '|'
 : reset ($features);
 :
 : while (list(, $feature) = each ($features)) {
 :
 : if (!file_exists("features/$feature.gif")){
 : echo "img src=\"features/$feature.gif\"";
 : echo "$featurebr\n";
 : }
 :
 :  } //End While
 : ?
 :
 : Is it possible that you don't hve a matching image for the last item?

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] This loop is screwed up totally. Why o why o why....

2001-04-09 Thread David Robley

On Mon,  9 Apr 2001 15:12, Yo Bro wrote:
 Still no luck.
 There should be no reason why this doesn't work. I tried it the way you
 tested it, and it doesn't really demonstrate it the same as if using
 the (file_exists command.

 When using looking for the images it appears the if statement is
 interferring with the loop. This is a nightmare. Freddy would love
 this.

 YoBro

Hrm; is it then possible that the problem is not within _this_ loop, but 
perhaps the loop wherein you get the stuff from the DB. Perhaps if you 
could share the [full/more of the] script??


 "David Robley" [EMAIL PROTECTED] wrote in message
 01040914425602.26561@www">news:01040914425602.26561@www...

 : On Mon,  9 Apr 2001 14:27, Yo Bro wrote:
 :  I do have a matching image, and all cases it does work with
 :  different records from the database. IE Where there might be an
 :  array of 15 items, but it is always the last one that doesn't show.
 :  Even if the image is there, because it gets used if i add another
 :  value to the array. IE
 :  PS|PW|AC|CD
 : 
 :  In this case all but CD would be displayed.
 :  Still no luck.
 : 
 :  I noticed your code used if (!file_exists
 :  Where as I want to check if it does exist. Is your way worth a try?
 :
 : Had to do that because, of course, I don't have the image files :-)
 : You could try it....
 :
 :  "David Robley" [EMAIL PROTECTED] wrote in message
 :  01040914213301.26561@www">news:01040914213301.26561@www...
 : 
 :  : On Mon,  9 Apr 2001 13:56, you wrote:
 :  :  Hi I have a feild in a MySql database called features. It is
 :  :  delimited by | the line above the \ key.
 :  :  Anyway, the feild has things like PS|PW|AC etc in it.
 :  :  I have the code below to explode that feild. It all works fine,
 :  :  but when it comes to looping the code below it always misses
 :  :  that last value. (Example - AC)
 :  :  Only in the IF statement - if i echo the variable "$feature"
 :  :  out of the IF statment it prints the text fine. But i need it
 :  :  to check for the existance of a gif first to display in the
 :  :  window. As you will see I have gifs with the names and the
 :  :  variable $feature ends with .gif
 :  :  It works great, but it misses the last value to the array
 :  :  $feature. Any ideas.
 :  : 
 :  :  $specs = $myrow[features];
 :  : 
 :  :  $features = explode('|',$specs); //What the feild is
 :  :  delimited by '|' reset ($features);
 :  : 
 :  :while (list(, $feature) = each ($features)) {
 :  : 
 :  : if (file_exists("features/$feature.gif")){
 :  : echo "img src=\"features/$feature.gif\"br";
 :  : echo "$feature";
 :  : }
 :  : 
 :  : } //End While
 :  : 
 :  : 
 :  :  --
 :  :  Regards,
 :  : 
 :  : 
 :  :  YoBro
 :  :
 :  : This seems to work OK for me:
 :  : ?php
 :  : $specs = "PS|PW|AC";
 :  : $features = explode('|',$specs); //What the feild is delimited by
 :  : '|' reset ($features);
 :  :
 :  : while (list(, $feature) = each ($features)) {
 :  :
 :  : if (!file_exists("features/$feature.gif")){
 :  : echo "img src=\"features/$feature.gif\"";
 :  : echo "$featurebr\n";
 :  : }
 :  :
 :  :  } //End While
 :  : ?
 :  :
 :  : Is it possible that you don't hve a matching image for the last
 :  : item?
 :
 : --
 : David Robley| WEBMASTER  Mail List Admin
 : RESEARCH CENTRE FOR INJURY STUDIES  |
 : http://www.nisu.flinders.edu.au/ AusEinet   
 : | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE,
 : SOUTH AUSTRALIA
 :
 : --
 : 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]

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Array Sort?

2001-04-09 Thread David Robley

On Fri,  6 Apr 2001 18:33, Chris Anderson wrote:
 Currently I am using the sort() command to sort an array. Unfortunately
 it uses the ascii number so all words starting with uppercase are
 before lowercase. Is there a case insensitive alphabetical sort that I
 don't know of? Thanks in advance ^_^

You might have to use usort and build a little case-insensitive sort 
routine yourself. Remember that ASCII A + 32 = ASCII a and so forth.
-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] populating dropdown list problems

2001-04-09 Thread David Robley

On Tue, 10 Apr 2001 04:37, Jason Dulberg wrote:
 I would like to populate a dropdown list from a particular field of a
 bunch of records.
 Here's what I have so far on the modify page but it doesn't list stuff
 from the database, all it prints is the number 1 which isn't in any of
 the records.

 One version of this will be on an add page and another will be on a
 modify page which has the current field selected. For the add script,
 I'd just lose all the selected stuff that's on there now.

 print "select name=\"owner\"";
 $result = mysql_query("SELECT owner,agent FROM homes;");
 while($a_row = mysql_fetch_array($result))
 {
   printf('option name="owner"
 value="'.$a_row[owner].'"'.$a_row[owner].'/option', $a_row[owner],
 ($owner == $a_row[owner]) ? "selected" : "", $a_row[owner]);
 }
 print "/select";

 What am I doing wrong in this code? Even when I take out the selected
 stuff, I still get a value of 1 in the list instead of the actual
 contents of the field.

 Any help is greatly appreciated!
 __
 Jason Dulberg
 Extreme MTB
 http://extreme.nas.net

First guess  - try referencing the field values as $a_row["owner"] to 
avoid possible ambiguity; owner without the quotes could be a constant. 
Also, you can use extract to get the row values and stick them in 
variables named as the field names - makes your code a bit easier to read.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] while loop

2001-04-09 Thread David Robley

On Tue, 10 Apr 2001 22:52, Jacky wrote:
 Hi people
 I am more like ASP programmer and new to PHP, In ASP, when we want to
 take all records in dayabase to display. After we did  do the query, we
 call " Do while not RS.EOF ( mean do while not end of record file) ,
 and display record accroding to the query. Is there anything that do
 teh same in PHP??
 cheers

While - have a look at the example for mysql_fetch_array for the concept. 
If you aren't using mysql, check the functions for the DB you are using 
for specific examples.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] last three characters of a string

2001-04-09 Thread David Robley

On Tue, 10 Apr 2001 12:18, Joseph Bannon wrote:
 I need to examine the last 3 characters of a string. Is there code that
 does that?

 J

You can extract them with substr - there are examples in the docs which 
demonstrate the use of negative start parameters to work backwards from 
the end of a string. You might want to trim the string first if you don't 
want any whitespace of EOL characters.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] what could cause the maximum execution time exceeded?

2001-04-09 Thread David Robley

On Wed, 11 Apr 2001 01:32, Jacky wrote:
 Hi people
 I ran a PHP page and there was an error said below:
 Fatal error  Maximum execution time of 30 seconds exceeded in
 include/getRoomDesc.php4 What could cause this??

The script is running for more than 30 seconds. As to what causes it - 
look in your script. You may have an infinite loop, although if you're 
using Linux they should run in under 5 seconds :-) or you are doing 
something time consuming in the script.

See the configuration section for ways to increase the timeout period if 
all is well in your script and you just need more time. There is also 
set_time_limit function that you can use on a per-script basis.

Check the docs for more info.

-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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: Schedule tasks from server

2008-02-07 Thread David Robley
Pieter du Toit wrote:

 Hi people
 
 Is there a way that i can schedule tasks on my webserver that will
 automatically fire on a certain time and date, without anyone visiting the
 website?
 
 This domain is hosted by a ISP and not by me.
 
 Thanks

If you don't need close granularity in the timing of the jobs, try
www.webcron.org/



Cheers
-- 
David Robley

What if there were no hypothetical situations?
Today is Pungenday, the 38th day of Chaos in the YOLD 3174. 

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



[PHP] Re: Uploading PDF

2008-02-14 Thread David Robley
Pastor Steve wrote:

 Greetings,
 
 I am getting an error when I am trying to upload a PDF file through a
 script.
 
 When I do a print_r($_FILES) I get the following:
 
 Array
 (
 [userfile] = Array
 (
 [name] = document.pdf
 [type] =
 [tmp_name] =
 [error] = 2
 [size] = 0
 )
 
 )
 
 Docs and html will both upload. Anybody have an idea why?
 
 Here is the script that I am using:
 
 ?php
 // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used
 instead
 // of $_FILES.
 
 $uploaddir = '../cms/documents/';
 $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
 
 if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
 $filename = $_FILES['userfile']['name'];
 
 echo bFile is valid, and was successfully uploaded./b\n
 br /Select and copy the link below to reference this file.p /
 prelt;a href=\documents/$filename\gt;$filenamelt;/agt;/prep
 /
 bWARNING:/b This link will not be available anywhere else.
 
 ;
 
 } else {
 echo Possible file upload attack!\n;
 }
 
 echo 'pre';
 
 echo 'Here is some more debugging info:';
 print_r($_FILES);
 
 print /pre;
 
 ?
 
 Thanks,
 

The error number tells you what is happening - check the values at
http://php.net/manual/en/features.file-upload.errors.php

Essentially, the file is bigger than the MAX_FILE_SIZE directive that was
specified in the HTML form



Cheers
-- 
David Robley

Couldn't myself have better it said.
Today is Sweetmorn, the 46th day of Chaos in the YOLD 3174. 

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



[PHP] Re: Pear

2008-03-03 Thread David Robley
[EMAIL PROTECTED] wrote:

 Dear PHP List Experts,
 
 I'm trying to use Pear at my host, Leadhoster.
 
 This line:
 
 require_once('DB.php');
 
 Gets this error:
 
 Warning: main(DB.php): failed to open stream: No such file or directory in
 /home/www/everoriginal.onlinewebshop.net/connect04.php on line 4
 
 Fatal error: main(): Failed opening required 'DB.php'
 (include_path='.:/usr/local/php4/share/pear') in
 /home/www/everoriginal.onlinewebshop.net/connect04.php on line 4
 
 I suspect I need to set up a path to Pear. If so, any help would be
 appreciated.
 
 This program:
 ?php
 phpinfo();
 ?
 seems to indicate that Pear is there.
 
 This is my first post to this list, so please let me know if I'm not doing
 it right. I couldn't find the archive, so I guess consider that my second
 question.
 
 Thanks in advance!
 
 Jerry Kassebaum

Do you know for sure that your host actually has PEAR installed? It might be
worth you asking them, via support ticket or forum (if thay have one)
whether it is installed and where.


Cheers
-- 
David Robley

A cat is nobody's fool.
Today is Boomtime, the 62nd day of Chaos in the YOLD 3174. 


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



Re: [PHP] Form Validation Issues

2007-05-26 Thread David Robley
tedd wrote:

SNIP on topic stuff

Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them.

Unknown
 
 Hi Jim:
 
 You might try the array below and the quote above, I believe, was
 Douglas MacArthur of WWII fame.

Is that the same Douglas MacArthur who was once known as William
Shakespeare :-) IIRC that is from Twelfth Night.



Cheers
-- 
David Robley

No, I'm from Iowa. I only work in Outer Space.
Today is Sweetmorn, the 73rd day of Discord in the YOLD 3173. 

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



Re: [PHP] Double checking - I should turn off magic quotes

2007-06-06 Thread David Robley
Dave M G wrote:

 Robert , PHP General,
 
 Thank you for replying and explaining the situation clearly.
 Neither! It means using mysql_real_escape_string():
 http://www.php.net/manual/en/function.mysql-real-escape-string.php
 
 I have now made it so each and every queries to the database pass
 through mysql_real_escape_string.

The way you write that makes me hope you understand how
mysql_real_escape_string should be used. You do understand that you don't
run it on the query, rather on the individual string variables that will be
passed to the query.






Cheers
-- 
David Robley

Moderators are not God. God has mercy.
Today is Boomtime, the 11st day of Confusion in the YOLD 3173. 

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



[PHP] Re: Not getting expected result from file()

2007-06-10 Thread David Robley
kvigor wrote:

 Hello,
 
 I'm using the file function create an array.  I'm using a value from a
 form to see if it matches in elements in the array.
 
 My problem is I expect  the condition to be true but info but my DB isn't
 populated as I in the right DB...
 =Code
 Begins==
 $theFileArray = file('C:\htdocs\folder1\file.txt');
 

Your problem starts here - file returns the file in an array. Each element
of the array corresponds to a line in the file, with the newline still
attached. When you compare to a string without the newline at the end, the
comparison fails.

If you have php  5.0.0 you can use the FILE_IGNORE_NEW_LINES flag in the
file() arguments, otherwise use trim() to remove trailing whitespace from
the array elements.



Cheers
-- 
David Robley

I hate playing craps, Tom said dicily.
Today is Boomtime, the 16th day of Confusion in the YOLD 3173. 

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



Re: [PHP] Re: how PHP is batter?

2007-07-05 Thread David Robley
Chris wrote:

 
 Either phrase can be a good or a bad thing, it all depends on tone -
 Scottish is very like Japanese in that respect :p
 
 with regard to batter - isn't it the scots that have pechant for covering
 marsbars with the stuff and deepfrying them?
 
 The aussies do it too - are we just as crazy as the scots?
 
Oy, speak for yerself, cobber. Even frying in Coopers beer batter couldn't
make a mars bar taste like food :-)



Cheers
-- 
David Robley

A seminar on Time Travel will be held two weeks ago.
Today is Sweetmorn, the 40th day of Confusion in the YOLD 3173. 

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



Re: [PHP] Suggestion re: PHP Brain Teasers

2007-07-06 Thread David Robley
Steve Edberg wrote:

 At 7:37 PM -0400 7/5/07, Robert Cummings wrote:
On Thu, 2007-07-05 at 16:27 -0700, Steve Edberg wrote:
  Proposal -

  Perhaps we could separate Brain Teasers, Obfuscated PHP challenges,
  and what-have-you to a separate mailing list, say php-fun (php-phun?
  PHPhun?)? Maybe you could also include 'use of eval()' in that list,
  since I think 97.004% of the time using eval() inevitably leads to
  obfuscation. And one should eschew obfuscation.

We could... but why bother?!

 
 
 Minimizing the circumlocution and periphrasis that is characteristic
 of an exhaustively obfuscated style is conducive to a maximally
 productive ISO-9000/six-sigma enterprise infrastructure that is
 architected towards the rightsized core competencies of an n-tier
 profit maximization strategy.
 
 Errr, wait, I think I just wandered into the 'PHP as a strategic
 BUSINESS language' thread...

That almost made more sense when ROTed :-)




Cheers
-- 
David Robley

It's a bloody lion, said Tom categorically.
Today is Boomtime, the 41st day of Confusion in the YOLD 3173. 

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



[PHP] Re: session_start(): Cannot send session cache limiter...

2007-07-20 Thread David Robley
Vanessa Vega wrote:

 Hello to all!
 
 I encountered this error when the site is uploaded on the server:
 
 session_start(): Cannot send session cache limiter - headers already
 sent
 
 I already put session_start() on topmost part of the file..but i saved the
 file as utf-8..and that seems to be the problem..can anyone share their
 knowledge on this?

I think that saving a file as UTF-8 places two characters at the very
beginning of the file; those characters will be passed to the server and
cause the error you are encountering.


Cheers
-- 
David Robley

My hair's been cut off, Tom said distressfully.
Today is Sweetmorn, the 55th day of Confusion in the YOLD 3173. 

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



Re: Re[2]: [PHP] Pirate PHP books online?

2007-07-27 Thread David Robley
Dotan Cohen wrote:

 On 24/07/07, Ryan A [EMAIL PROTECTED] wrote:

  Php Fiction? Rasmus's List? Codin' in the Rain?

 LOL! That was good! Thanks needed that!


 
 Of course, one should not forgot Debbie Does DocType...
 
 Dotan Cohen
 

Now you owe me a new keyboard that isn't full of a mouthful of beer :-)

I guess that would have an opening scene with dialog something like:

I hope you don't mind me sharing memory while you are processing an array
as the processor flicks garbage collected data into /dev/null



Cheers
-- 
David Robley

Plankton lobbyist: NUKE THE WHALES!
Today is Pungenday, the 62nd day of Confusion in the YOLD 3173. 

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



[PHP] Re: Re: Rules of Engagement

2007-07-30 Thread David Robley
Colin Guthrie wrote:

 Daniel Brown wrote:
 As a relatively-new contributor to this list (read: under 2
 years), I realize that I have no business requesting a change, but
 I'll breech etiquette and hope for the best.
 
 Can we update the filters on the list to have the reply-to address
 header marked to the php-general address?  The reason I ask this is
 because, when people are on vacation (such as Juan is now), we receive
 responses to our personal addresses.  Secondly, we have to continually
 Reply All the messages, which - though it's not a problem - can
 cause issues when attempting to respond to those [URGENT] replies.
 Third, our addresses are included in gmane, et al, which is an
 inherent risk --- I understand.
 
 Maybe it's just the ramblings of someone attempting to read and
 type on a limited-bandwidth mobile device while bored due to delays in
 mass-transit facilities (here, read: I'm fucking exhausted, and yes, I
 dropped the F bomb).  In either case, it's not conducive to a new
 contributor to have to weed through vacation response messages each
 time he/she replies to the list.
 
 I agree here.
 
 I am on many lists and if I'm interested in something then I expect
 people to expect me to read the list for replies. But for noobs, the
 personal reply is quite good.
 
 I guess the rule should be public list - reply to poster,
 subscription list - reply to list.
 
 AFAIK Gmane etc. can be configured to obfuscate email addresses -
 certainly other lists I read through Gmane are...
 
 Col

I'd bet we did this a number of times over the last few years; all I can
offer other than suggesting a search of the archives is
http://www.unicom.com/pw/reply-to-harmful.html which puts a view for not
mucking around with the headers on mailing list messages. FWIW as a
sometime mailing list admin I fully support the products or services
therein :-)



Cheers
-- 
David Robley

I like camping, said Tom intently.
Today is Sweetmorn, the 65th day of Confusion in the YOLD 3173. 

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



[PHP] Re: $HTTP_POST_FILES always produces empty value.

2007-07-30 Thread David Robley
Patrik Hasibuan wrote:

 Dear my friends
 
 I don't understand why $HTTP_POST_FILES always produces empty value.
 
 This is my code
 ===
 //cgi/cgiprodukcatalogadmin.php
 ?php
 $berkasgambarproduk=$HTTP_POST_FILES['gambarproduk']['name'];
 echo gambarproduk: $gambarprodukbr;
 echo berkasgambarproduk: $berkasgambarprodukbr;
 ?
 ===
 This is the output in my Opera internet browser:
 ===
 gambarproduk: /tmp/phppd6DZy
 berkasgambarproduk:
 ===
 this is my php.ini:
 ===
 
 ; File Uploads ;
 
 
 ; Whether to allow HTTP file uploads.
 file_uploads = On
 
 ; Temporary directory for HTTP uploaded files (will use system default if
 not ; specified).
 ;upload_tmp_dir =
 upload_tmp_dir = /srv/www/htdocs/tmpphp
 
 ; Maximum allowed size for uploaded files.
 upload_max_filesize = 100M
 ===
 
 Please tell me, where is my mistake?.
 
 Thank you very much in advance.

Unless you are using an old version of php 4.1.0 you probably should use
the $_FILES array instead of $_HTTP_POST_FILES

Try that and see what happens. More info at http://php.net/file-upload if
you need it.


Cheers
-- 
David Robley

Oxymoron: Working Vacation.
Today is Sweetmorn, the 65th day of Confusion in the YOLD 3173. 

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



Re: [PHP] javascript in head or in body ?

2007-08-12 Thread David Robley
tedd wrote:

 At 9:29 PM +0200 8/7/07, Tijnema wrote:
On 8/7/07, Robert Cummings [EMAIL PROTECTED] wrote:
   Yeah!! This list is for public apologies and Copyright discussion.

  Cheers,
  Rob.
  --

Oh yeah, Tedd is only the first of thousands of people that need to
apologize... :P

Tijnema
 
 
 Ah crap, have I got something else to apologize for?
 
 At this rate, by the time I reach the end of my life, I'll know only
 two sentences, namely I'm sorry and Yes, Dear.

Seems to me you could rather easily condense that to just one sentence with
the same degree of functionality. :-)




Cheers
-- 
David Robley

This isn't hell, but I can see it from here.
Today is Prickle-Prickle, the 5th day of Bureaucracy in the YOLD 3173. 
Celebrate Zaraday

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



Re: [PHP] Re: Data request

2007-09-26 Thread David Robley
Paul Scott wrote:

 
 On Tue, 2007-09-25 at 09:17 -0400, Robert Cummings wrote:
 Oh sure, and now when I'm searching for shit I'll get all these
 Henry's cat references *bleh*.
 
 Well then why not tie in coprophilia as well?
 
 ugh.
 
 --Paul

You gotta love that shit... oh wait, that's what you said :-)



Cheers
-- 
David Robley

A cat is a four footed allergen.
Today is Prickle-Prickle, the 50th day of Bureaucracy in the YOLD 3173. 
Celebrate Bureflux

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



[PHP] Re: Printer Friendly

2006-08-02 Thread David Robley
weetat wrote:

 Hi all ,
 
I have a web page which need to be print to the printer.
However when i use javascript window print() function , the page and
 alignment is out.
 
Read on the net , suggest that i need to setup a printer friendly
 page in the web page.
 
Any ideas how i going to accomplished it in php ?
 
 Thanks

You don't do it with php - you use css and html.



Cheers
-- 
David Robley

I'd like some Chinese food, said Tom wantonly.
Today is Prickle-Prickle, the 68th day of Confusion in the YOLD 3172. 

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



[PHP] Re: looking for a short/simple kind of app...

2006-08-07 Thread David Robley
bruce wrote:

 hi...
 
 i'm looking for a short/simple kind of app to allow me to play around with
 some different tbls..
 
 basically.. i have a couple of tbls where i have a top level tbls, and a
 few subordinate child tbls
 
  parent
child
  child
 
 i'd like to be able to add/modify/delete items from the various tbls.. i'd
 also like to be able to display a kind of breadcrumb across the top of the
 page allowing me to get back to the selected item/tbl...
 
 i'm willing to bet that there are numerous examples of this kind of app.
 i'm simply hoping that someone can point me to one that i can play around
 with...
 
 thanks
 
 -bruce

This is probably a good starting point:
http://www.sitepoint.com/article/hierarchical-data-database/3

and also, but you'll have to write your own script
http://www.dbazine.com/oracle/or-articles/tropashko4



Cheers
-- 
David Robley

I like to think of myself as a divide overflow.
Today is Prickle-Prickle, the 73rd day of Confusion in the YOLD 3172. 

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



Re: [PHP] List Meeting NNOT

2006-08-11 Thread David Robley
Ligaya Turmelle wrote:

 tedd wrote:
 At 7:22 AM +0200 8/10/06, Paul Scott wrote:
 
 On Wed, 2006-08-09 at 18:54 -0500, Jay Blanchard wrote:

  Yes, but not everyone can get to or goes to conferences. And this
  would stand on its own don'tcha think? I think that Chicago is
  perfect, because it is centrally located (kinda') and a neat place to
  boot.


 Kinda...Chicago is a bit of a drive for us in Cape Town, South
 Africa... ;)

 --Paul
 
 
 Start driving now and remember to roll up the windows.
 
 tedd
 Wonder if I can get a scuba diving tank large enough...
 
Also whether you can inflate the tyres enough to keep it afloat...



Cheers
-- 
David Robley

Words are not food, though sometimes we must eat them.
Today is Pungenday, the 4th day of Bureaucracy in the YOLD 3172. 

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



[PHP] Re: Re: Frustrated trying to get help from your site

2006-09-25 Thread David Robley
Michelle Konzack wrote:

 Am 2006-09-22 13:36:40, schrieb Arno Kuhl:
 
 I'm not sure which examples you're referring to but if you mean the user
 contributed notes then the download documentation does include this - at
 
 Yes
 
 least one of the .chm versions does. It's great, but you need to download
 it
 
 .chm ?  -  Windows ??? Me??? plof
 
 regularly if you want the latest notes (obviously). Use one of the skins
 and it's even better (I use the phpZ skin which displays a tab for the
 user notes).
 
 You mean in winhlp32.exe ? Right ?
 
 It is a realy nice tool but unfortunatly for the false OS.
 
 I was already thinking on coding a linhelp program, but
 it seems there is one but I have not found it.
 
 I like to have html files which I can put on my internal
 documentation server.

xchm is probably what you are thinking of - xchm.sourceforge.net



Cheers
-- 
David Robley

Use your own toothbrush! Tom bristled.
Today is Pungenday, the 49th day of Bureaucracy in the YOLD 3172. 

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



[PHP] Re: Re: Re: Frustrated trying to get help from your site

2006-09-27 Thread David Robley
Michelle Konzack wrote:

 Am 2006-09-25 08:33:52, schrieb Ray Hauge:
 
 It's not the best in the world, but it works.
 
 http://xchm.sourceforge.net/index.html
 
 But since the documentation is online and always updated that way, I
 prefer to just use the website.
 
 Me too, but IF you live mobil like me (I have an 88-tons MAN-SuperTruck
 as MotorCaravan) you wil not have Internet Access all the time.  OK, I
 have GlobelSat but it is quiet expensive because I pay for the traffic.

88 tons!! Point us to an image of that please.



Cheers
-- 
David Robley

I'd love some Chinese food, said Tom wantonly.
Today is Setting Orange, the 51st day of Bureaucracy in the YOLD 3172. 

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



[PHP] Re: Re: Re: Frustrated trying to get help from your site

2006-10-03 Thread David Robley
Michelle Konzack wrote:

 Am 2006-09-27 17:39:25, schrieb David Robley:
 
 88 tons!! Point us to an image of that please.
 
 Currently not availlable but it is an ex Pershing II Transporter
 from the US-Army manufactured by the german Enterprise MAN.

You surely don't mean the tracked vehicle that was used to transport the
missiles? How the #%@ can you register and drive something like that.
Boggle!




Cheers
-- 
David Robley

My stereo is working great now, said Tom ecstatically.
Today is Sweetmorn, the 57th day of Bureaucracy in the YOLD 3172. 

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



[PHP] Re: Test

2006-10-04 Thread David Robley
Sheena Mullally wrote:

 test

Sorry, you failed.



Cheers
-- 
David Robley

This tag is devoid of any humor.
Today is Boomtime, the 58th day of Bureaucracy in the YOLD 3172. 

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



<    2   3   4   5   6   7   8   9   10   11   >