Re[2]: [PHP] Help!! with array's Please

2003-02-27 Thread Richard Kurth
Hello Tom,

Thursday, February 27, 2003, 7:39:52 PM, you wrote:

TR> Hi,

TR> Friday, February 28, 2003, 12:20:38 PM, you wrote:

RK>> I really need somebody to help me with this I am totally lost on what
RK>> to do

RK>> I need a way to read the following text file and add to or delete from
RK>> or change the data.
RK>> I have been able to move it all into an array using this code
RK>> $groups= file("group");
RK>> for ($i=0; $i<$number_in_group; $i++){
RK>> $groups[0];
RK>> $groups[3]; <-- this is the part of the array that I need to change
RK>> }
RK>> But I can not figure out how to search the array and delete from or add
RK>> to the array at a given point. I would like to say add another user to
RK>> the end of site6 or delete a user from site3.
RK>> Could somebody give me a hand here. I have read the manual for arrays
RK>> and still can't figure it out.

RK>> site1:x:503:tester1
RK>> site2:x:504:tester2,tester2a
RK>> site3:x:505:tester3,tester3a,tester3b
RK>> site4:x:506:tester4
RK>> site5:x:507:tester5,tester5a,tester5b
RK>> site6:x:508:tester6
RK>> site7:x:509:tester7,tester7a,tester7b  

RK>> -- 
RK>> Best regards,
RK>>  Richard  mailto:[EMAIL PROTECTED]

TR> your groups array will look like this

TR> groups[0] = site1:x:503:tester1
TR> groups[1] = site2:x:504:tester2,tester2a
TR> so loop through the array

TR> $x = 0;
TR> while(list($key,$val) = each($groups)){

TR> //you need split the array values like this
TR>   list($name,$pass,$gid,$user_list) = split (":", $groups[$x]);
TR>   //see if we have the right one
TR>   if($name = $wanted_name){ //site6
TR>  //then split the usernames into a sub array
TR>  $users = explode(',',$userlist);
TR>  // to add
TR>  $users[] = $newuser;
TR>  // to delete
TR>  unset($users[3])
TR>  // now add it back
TR>  $userlist = implode(',',$users)
TR>  $list = $name.':'.$pass.':'.$gid.':'.$userlist;
TR>  $groups[$x] = $list;
TR>   }
TR>   $x++;
TR>   //here you could fputs to a temp file then copy to the original
TR>   // after finished
TR> }

TR> Then write groups back to disk
TR> -- 
TR> regards,
TR> Tom

Thanks for the help!!

I still can't seam to get it to add a new user at the end of a line of
the selected site name.
Also how do I use the unset($users[3]) do I first have to determine
what number the one I what to delete is.
Here is what I have so far
$newuser="tester45";
$wanted_name="site7";
$groups= file("group");
$x = 0;
while(list($key,$val) = each($groups)){
//you need split the array values like this
 list($name,$pass,$gid,$user_list) = split (":", $groups[$x]);
 //see if we have the right one
 if($name = $wanted_name){ //site6
//then split the usernames into a sub array
 $users = explode(',',$userlist);
 // to add
 $users[] = $newuser;
  // to delete
 //unset($users[3]);
 // now add it back
 $userlist = implode(',',$users);
 $list = $name.':'.$pass.':'.$gid.':'.$userlist;
 $groups[$x] = $list;
  }
  
  $x++;
$handle = fopen("group2", 'a');
fputs($handle, $groups[$x]);
  //here you could fputs to a temp file then copy to the original
  // after finished
}
//Then write groups back to disk





-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]


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



Re: [PHP] Re: mysqldump

2003-02-27 Thread Tom Rogers
Hi,

Thursday, February 27, 2003, 2:55:48 PM, you wrote:
JTJ> Thanks!

>> exec("mysqldump -c -q database -u user -ppassword", $sql);

JTJ> Why is there no space between the -p and password?

>>-ppassword

JTJ> Am I wrong?

JTJ> Thanks,
JTJ> John

Probably because a space is a valid char in password

-- 
regards,
Tom


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



Re: [PHP] Function returns an array of objects...

2003-02-27 Thread Tom Rogers
Hi,

Friday, February 28, 2003, 4:24:54 PM, you wrote:
AS> so i have a function that creates objects (with member variables) and 
AS> pushes those objects onto the array. after adding all of the objects, 
AS> the function then returns the array...

AS> i'm having trouble accessing the members of each object in the 
AS> array...i'm trying to do something like this:

AS> class Object {
AS> var $id;
AS> function Object($param) {
AS> $this->id = $param;
AS> }
AS> }

AS> function getArrayOfObjects() {
AS> $theArray = array();
AS> for ($i = 0; $i < 10; $i++) {
AS> $theArray[] = new Objects($i);
AS> }
AS> return $theArray;
AS> }

AS> $temp = getArrayOfObjects();
echo $temp[0]->>id;  // this should display "0"

AS> do i have to do something with references or dereference the id 
AS> variable some other way? i'm coming from java where something like this 
AS> is extremely easy...

AS> thanks
AS> amit

Try like this  (note the 2 & symbols)

function &getArrayOfObjects() {
$theArray = array();
for ($i = 0; $i < 10; $i++) {
$theArray[] =& new Objects($i);
}
return $theArray;
}
$temp = getArrayOfObjects();
echo $temp[0]->id;
-- 
regards,
Tom


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



Re: [PHP] Passing url?variables

2003-02-27 Thread Leif K-Brooks
http://www.php.net/manual/en/security.registerglobals.php

Mike wrote:

Hi,

I'm running Apache 2.0 and PHP 4.2.2 on a RedHat 8.0 Machine. I'm unable
to pass variables through a URL like index.php?test=something. Can
anyone help here? I've looked through both my httpd.conf and php.ini
files and didn't see anything...
-Michael

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] php install help

2003-02-27 Thread Karl James
Hey guys,

Im having problems getting my helloworld.php file to 
Work on the apache server.
My phpinfo.php works perfect.
I know the code is write
The error message I get is
#
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and
inform them of the time the error occurred, and anything you might have
done that may have caused the error.

More information about this error may be available in the server error
log.





How can I correct this
The linked I used is.
Localhost/phpinfo.php
And the one that is not working is
Localhost/helloworld.php
ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 



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



[PHP] Passing url?variables

2003-02-27 Thread Mike
Hi,

I'm running Apache 2.0 and PHP 4.2.2 on a RedHat 8.0 Machine. I'm unable
to pass variables through a URL like index.php?test=something. Can
anyone help here? I've looked through both my httpd.conf and php.ini
files and didn't see anything...

-Michael


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



[PHP] Function returns an array of objects...

2003-02-27 Thread Amit Snyderman
so i have a function that creates objects (with member variables) and 
pushes those objects onto the array. after adding all of the objects, 
the function then returns the array...

i'm having trouble accessing the members of each object in the 
array...i'm trying to do something like this:

class Object {
var $id;
function Object($param) {
$this->id = $param;
}
}
function getArrayOfObjects() {
$theArray = array();
for ($i = 0; $i < 10; $i++) {
$theArray[] = new Objects($i);
}
return $theArray;
}
$temp = getArrayOfObjects();
echo $temp[0]->id;   // this should display "0"
do i have to do something with references or dereference the id 
variable some other way? i'm coming from java where something like this 
is extremely easy...

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


[PHP] RE: mysqldump

2003-02-27 Thread Uttam
snip from manual for -p option:

|-

-p[password], --password[=...]

Password to use when connecting to server. If a password is not given on the
command line, you will be prompted for it.  Note that if you use the short
form -p you can't have a space between the option and the password.

-|

regds,
-Original Message-
From: Niels Andersen [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 16:09
To: [EMAIL PROTECTED]
Subject: Re: mysqldump


There mey, but need not be a space. As far as I know, the option scanner
in
mysqldump ignores spaces between short options and their values.


"John Taylor-Johnston" <[EMAIL PROTECTED]> wrote in
message
news:[EMAIL PROTECTED]
> Thanks!
>
> > exec("mysqldump -c -q database -u user -ppassword", $sql);
>
> Why is there no space between the -p and password?
>
> >-ppassword
>
> Am I wrong?
>
> Thanks,
> John
>




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



Re: [PHP] help with getting php going(2)

2003-02-27 Thread Kim Kohen
G'day Karl

> Hey guys I finally got my phpinfo file to show on apache server
> But when I try to do a hello world or browser check I get a 500 error
> message

FWIW, I've seen this error when I've had mac line endings instead of unix.

cheers

kim


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



[PHP] help with getting php going(2)

2003-02-27 Thread Karl James
Title: Message





Hey guys I finally got my phpinfo file to show on apache server
But when I try to do a hello world or browser check I 
get a 500 error message
Can anyone help me out, and educate me what I’m doing 
wrong.
 

This is my 
script


 PHP Test

<body>
php
if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) 
{
   echo "You are using Internet Explorer<br />";
}
?>

    


Thanks

ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 
 

ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98856.html">Re: [PHP] Help with getting php going!</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Help+with+getting+php+going%5C%21%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Leif+K%5C-Brooks%22&o=newest&f=1">Leif K-Brooks</a></span>
</div>
<blockquote><span class="msgFragment"><pre>




Please don't send MS Word content in your email.  It crashed Mozilla before
I was able to reply.

Karl James wrote:
   
  
   
  
 
  
 
  
 
  
  


 
  

  Hey guys I finally got my phpinfo 
file to show on apache server
  
  But when I try to do a hello world or browser check
I get a 500 error message
  
  Can anyone help me out, and educate me what I’m 
doing wrong.
  
   
  
   
 
  This
is my script
  
  
  <html>
  
  <head>
  
   <title>PHP Test
  
  
  
  <body>
  
  php
  
  if 
(strstr($_SERVER["HTTP_USER_AGENT"], "MSIE"))
{
  
     echo "You are using Internet
Explorer<br />";
  
  }
  
  ?>
  
  
  
      
  
  
  
  Thanks
  

  ultimatefootballleague.com/index.php
  
  [EMAIL PROTECTED]
  
  
   
  
  

-- 
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98855.html">[PHP] Help with getting php going!</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Help+with+getting+php+going%5C%21%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Karl+James%22&o=newest&f=1">Karl James</a></span>
</div>
<blockquote><span class="msgFragment"><pre>









Hey guys I finally got my phpinfo
file to show on apache server

But when I try to do a hello world or browser check I get
a 500 error message

Can anyone help me out, and educate me what I’m
doing wrong.

 



This is my script



<html>

<head>

 <title>PHP
Test



<body>

php

if
(strstr($_SERVER["HTTP_USER_AGENT"],
"MSIE")) {

   echo "You are
using Internet Explorer<br />";

}

?>



    



Thanks



ultimatefootballleague.com/index.php

[EMAIL PROTECTED]



 







</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98854.html">[PHP] PHP SORT_NUMERIC</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+PHP+SORT_NUMERIC%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jim+Long%22&o=newest&f=1">Jim Long</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi,

I've got to sort the $numeric_arry

This doesn't seem to work:
sort ($numeric_array, SORT_NUMERIC);
I think its sorting $key

asort ($numeric_array, SORT_NUMERIC);
sorts as a string


THANKS AGAIN IN ADVANCE,
Jim Long

JanetVal Wrote:
> Well, as long as you know exactly what you are looking for, you can use 
> 
> >  if ($value != "n/a")) {
> 
> Janet


Jason Lange Wrote:
> Try this code (tested):
> 
> <-- Begin Code -->
> foreach ($list as $key => $value) {
>  // If elements value is a numeral add to numeric_array
>  if (is_numeric($value)) {
>  $numeric_array[$key] = $value;
>  // If value is not a numeral (presumably 'n/a') add to na_array
>  } else {
>  $na_array [$key] = $value;
>  }
> }
> 
> // Re-combine arrays placing all "other" values at the end
> $final_array = array_merge($numeric_array, $na_array);
> <-- End Code -->


Original Question:
>>>I have an array with an html link as key and different $vars as val:
>>>
>>>$list = array (
>>>'http://someplace.com/";>some place' => $vendor1_total,
>>>'http://anotherplace.com/";>another place' =>
> 
> $vendor2__total,
> 
>>>[snip] etc..
>>>
>>>some vals are numeric and some vals are "n/a"
>>>asort works to sort the array as a string, however, I need to sort the
>>>numeric vals numeric, then have the n/a's go away or be output at the
>>>bottom of the sort.

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98853.html">[PHP] make problem with PHP4.3.1</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+make+problem+with+PHP4.3.1%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Darrin+Taylor%22&o=newest&f=1">Darrin Taylor</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi Everyone,
OK I have looked through the archives and all over the net.  I apologise if
this has been seen before but here goes :
No matter what switches I use I get the same error when I "make" ./configure
goes fine.  RedHat 8.1 beta PHP 4.3.1 the error is :
ext/mysql/libmysql/my_lib.lo(.text+0x3d1): In function `my_dir':
/root/php-4.3.1/ext/mysql/libmysql/my_lib.c:169: undefined reference to
`errno'
ext/mysql/libmysql/my_lib.lo(.text+0x5ef): In function `my_stat':
/root/php-4.3.1/ext/mysql/libmysql/my_lib.c:588: undefined reference to
`errno'
ext/mysql/libmysql/my_malloc.lo(.text+0xde): In function `my_malloc':
/root/php-4.3.1/ext/mysql/libmysql/my_malloc.c:24: undefined reference to
`errno'
ext/mysql/libmysql/my_realloc.lo(.text+0xd5): In function `my_realloc':
/root/php-4.3.1/ext/mysql/libmysql/my_realloc.c:44: undefined reference to
`errno'
ext/mysql/libmysql/my_delete.lo(.text+0x86): In function `my_delete':
/root/php-4.3.1/ext/mysql/libmysql/my_delete.c:16: undefined reference to
`errno'
ext/mysql/libmysql/my_tempnam.lo(.text+0x89):/root/php-4.3.1/ext/mysql/libmys
ql/my_tempnam.c:108: more undefined references to `errno' follow
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


Thanx for any help
Darrin


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98852.html">[PHP] =at wit's end with GD Libraries=</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+%3Dat+wit%27s+end+with+GD+Libraries%3D%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Anthony+Ritter%22&o=newest&f=1">Anthony Ritter</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I want to thank those who tried to help with my questions about using the GD
libraries.

I still have not gotten them to function using PHP.

I've put two screenhots of the phpinfo() page at:

www.gonefishingguideservice.com/php_page.htm

If you care to take a look at those images, you'll see that I've got php and
Apache working with MS Win 98.  It also says that directories are enabled.

I've searced for the following files that I believe I need for GD Libraries
and PHP in Explorer and found:

php_gd.dll  -> C:\PHP\extensions

php.ini -> C:\WINDOWS

php4ts.dll -> C:\WINDOWS\System

msvcrt.dll -> C:\WINDOWS\System

When I load the phpinfo() page, it comes up like you see in the screenshots.

However, when I _take out_ the semi-colon as in the line:
...
extension=php_gd.dll  //semi-colon taken out
..

the page - or any page with a file extension.php will _not_load at all using
Apache.

However, when I _reinsert_ the semi-colon in the php.ini file, the .php page
then loads.

Any advice on how I can get the GD libaries to work will be greatly
appreciated.

At wit's end...

Thank you.
Tony Ritter




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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98851.html">[PHP] Can't run PHP cli script from Cron</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Can%27t+run+PHP+cli+script+from+Cron%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Justin+Michael+Couto%22&o=newest&f=1">Justin Michael Couto</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I am trying to run a PHP CLI script from cron using PHP 4.3 and FreeBSD
5.0
 
This is what I have verified:
 
My clock is set right
I can run bash scripts from cron
I have tried running the script as root and as other users
If I run the PHP CLI script by had it works fine
I set cron to run the script every minute just to make sure I am doing
my cron tab right
 
Here is my crontab entry:
 
* * * * * /path/to/file/file_name.php
 
I also have 
 
* * * * * /path/to/file/bash_test_script
 
which contains the following information
 
ls -l >> /path/to/file/holder/file_results.txt
 
With every passing minute the bash script gets run and file
file_results.txt get another ls appendied to it
 
On the other hand, Nothing happens with the PHP script.  Inside the php
script I have it emailing me using the php mail() funtction.  If I run
this script by hand I get an email from the script.  If I run the script
by cron everyminute I get nothing when I should be getting a email every
minute.  
 
I hope someone can help me with this.  
 

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg99093.html">[PHP] JP Graph</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+JP+Graph%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22K%22&o=newest&f=1">K</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi all,
I'm using JPGraph on a localhost for a website opened via a host redirect.
My problem is that nobody can see the graphs but me ('cause I'm on
localhost).

Any clues?

Thx.




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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98850.html">[PHP] Read</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Read%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Karl+James%22&o=newest&f=1">Karl James</a></span>
</div>
<blockquote><span class="msgFragment"><pre>









Hey does anyone know if you can use PHP and ASP 3.0 or  I.I.S  on the same hard drive on XP pro?

I need to know for school, because I’m taking
classes for both languages.

 



ultimatefootballleague.com/index.php

[EMAIL PROTECTED]



 







</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98849.html">[PHP] 404 and parsing templates</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+404+and+parsing+templates%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Richard+Baskett%22&o=newest&f=1">Richard Baskett</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Ok I created an engine, an extremely simple engine that parses a template
file and then according to whatever page and language it is on it calls that
template.  

Now the problem is that, well let me give you an example:

I have a page called index.php which only has an include_once function in
it, which includes the engine.  This engine checks the name of the file,
then checks a cookie and/or the browser prefs for the language then parses
the template with the main table cell of the template as the included file
/en/index.inc.  So if you went to products.php it would parse it and grab
/en/products.inc.. the way I see it is that I really do not need those .php
files and could let my 404 page parse the files as needed, but there should
be a better way of doing this...  Each one of my .php files are the exact
same thing...

Cheers!

Rick

"Only a life lived for others is worth living." - Albert Einstein


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98848.html">[PHP] separating value="n/a" from array</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+separating+value%3D%5C%22n%5C%2Fa%5C%22+from+array%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jim+Long%22&o=newest&f=1">Jim Long</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi,

Thanks to those who have helped me.

Jason Lange Wrote:
> Try this code (tested):
> 
> <-- Begin Code -->
> foreach ($list as $key => $value) {
>  // If elements value is a numeral add to numeric_array
>  if (is_numeric($value)) {
>  $numeric_array[$key] = $value;
>  // If value is not a numeral (presumably 'n/a') add to na_array
>  } else {
>  $na_array [$key] = $value;
>  }
> }
> 
> // Re-combine arrays placing all "other" values at the end
> $final_array = array_merge($numeric_array, $na_array);
> <-- End Code -->

This works.. THANKS!  HOWEVER:

I think PHP is seeing a comma, in a large number and think that it IS
NOT NUMERIC, because when I test a large number it put it in the $na_array

Do I need to add something to this code to stip the commas?

THANKS IN ADAVANCE AGAIN,
Jim Long


Kevin Stone wrote:
> To append my own answer.  In order to sort the non "n/a" values you're going
> to have to build a separate array and perhaps this will simplfy the problem.
> So instead of what I suggested below.. loop the array and start TWO new
> arrays within the loop.  One array for "n/a" values and one for non-"n/a"
> values.  After the values are sorted to their separate arrays do
> asort($nonnavals); then concatonate the two arrays together using
> array_merge(), putting the "n/a" array second.
> 
> - Kevin
> 
> - Original Message -
> From: "Kevin Stone" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, February 27, 2003 12:04 PM
> Subject: Re: [PHP] restating plea for help with sort
> 
> 
> 
>>Hmm well upon first glance looks like all you need to do is loop that
> 
> array
> 
>>and start a new array within the loop.  An If/Else construct checks If the
>>value is "n/a" then append to the back of the new array Else prepend to
> 
> the
> 
>>front of the new array.You append the values manually or use
>>array_push() and array_unshift().  Search the manual for more information.
>>Hope that helps.
>>- Kevin
>>
>>- Original Message -
>>From: "Jim Long" <[EMAIL PROTECTED]>
>>To: <[EMAIL PROTECTED]>
>>Sent: Thursday, February 27, 2003 11:35 AM
>>Subject: [PHP] restating plea for help with sort
>>
>>
>>
>>>Hi,
>>>
>>>I have an array with an html link as key and different $vars as val:
>>>
>>>$list = array (
>>>'http://someplace.com/";>some place' => $vendor1_total,
>>>'http://anotherplace.com/";>another place' =>
> 
> $vendor2__total,
> 
>>>[snip] etc..
>>>
>>>some vals are numeric and some vals are "n/a"
>>>asort works to sort the array as a string, however, I need to sort the
>>>numeric vals numeric, then have the n/a's go away or be output at the
>>>bottom of the sort.
>>>
>>>Please be clear and gentle.. I'm not schooled in php, just a tinkerer
>>>trying to make this mess work.
>>>
>>>Thanks In Advance,
>>>
>>>Jim Long

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98847.html">Re: [PHP] Newbie look for some content specific tutorials</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Newbie+look+for+some+content+specific+tutorials%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22janet%22&o=newest&f=1">janet</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
In a message dated 2/27/2003 12:47:25 PM Pacific Standard Time,
[EMAIL PROTECTED] writes:

>First time poster here and a 1 week old PHP/Mysql programmer
>
>I have bought several books and scoured the net for any and all PHP/MySQL
>tutorials. Here is the problem I am running into:
>
>1. The docs tell how to access MySql through the MySql monitor
>2. any docs that tutor how to make PHP interact with MySql has you doing all
>the functions directly on the page
>3. All the rest are written like VCR instructions (Mine still blinks
>"12:00")
>
>What I am looking for is a tutorial that talks specifically about the
>interaction of PHP forms with MySql
>
>I have figured out how to add records using PHP, and have even figured out a
>crude search function, but being able to update or delete records are
>eluding me.

Here's a mini-tutorial. This is how it basically works. These are the steps:

1. connect to the database
2. send an SQL query to the database
3. If the query sends back some data, it stores it in a temporary table and
you need to get it from that table and do whatever you want to do with it.

Here's code:

For step 1.
$connection = mysql_connect("host","user","password")  or die("can't
connect");
$db = mysql_select_db("dbname") or die("can't connect to db");

For step 2.
$sql = "UPDATE tablename SET custname='$custname'";
{or whatever SQL query you want to execute. If you have books about MySQL,
they will describe the SQL queries you can use.)
$result = mysql_query($sql) or die("couldn't execute query");

For step 3.
If your query returns data that you want to use, such as a SELECT query, the
data is stored in a temporary table and you can use $result to get data from
the temp table. And then you do whatever you want with it. 

To get one row of data, you can use this code:
$row = mysql_fetch_array($result);

Row is now an array with all the fields you selected. You can get any
particular field using $row['fieldname']. You can break it apart using
extract:

extract($row);

Which turns the array into separate variables, given the field names, such as
$fieldname = valuefromdb.

If you have more than one row in your results, you can get all the rows using
a while loop, for example:

while($row = mysql_fetch_array($result))
{
  extract($row);
  echo $custname,$custaddress;
}

This will go through all the rows, echoing the values from the fields,
custname and custaddress.

That's basically it. There are other ways to do these things. But you can do
the basic things you need to do using these PHP statements. You can also look
up the mysql functions in the PHP online manual
(http://www.php.net/manual/en/ref.mysql.php) to see other possibilities for
interacting with MySQL databases from PHP scripts.

The MySQL online manual has a tutorial chapter that you can use. It describes
SQL using the mysql client, but you can read it just to see how to use the
SQL queries. Just put any of the queries described into the $sql variable
below, and that will work. In summary:

$connection = mysql_connect("host","user","password")  or die("Can't connect
to MySQL");
$db = mysql_select_db("dbname") or die("Can't select db");
$sql = "SQL query here";
$result = mysql_query($sql) or die("Couldn't execute query");
And the following only if the query was a SELECT
$row = mysql_fetch_array($result);
extract($row);

Good luck, 

Janet

__
Janet Valade
Author, PHP & MySQL for Dummies
janet.valade.com

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98846.html">Re: [PHP] Help!! with array's Please</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Help%5C%21%5C%21+with+array%27s+Please%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Tom+Rogers%22&o=newest&f=1">Tom Rogers</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi,

Friday, February 28, 2003, 12:20:38 PM, you wrote:

RK> I really need somebody to help me with this I am totally lost on what
RK> to do

RK> I need a way to read the following text file and add to or delete from
RK> or change the data.
RK> I have been able to move it all into an array using this code
RK> $groups= file("group");
RK> for ($i=0; $i<$number_in_group; $i++){
RK> $groups[0];
RK> $groups[3]; <-- this is the part of the array that I need to change
RK> }
RK> But I can not figure out how to search the array and delete from or add
RK> to the array at a given point. I would like to say add another user to
RK> the end of site6 or delete a user from site3.
RK> Could somebody give me a hand here. I have read the manual for arrays
RK> and still can't figure it out.

RK> site1:x:503:tester1
RK> site2:x:504:tester2,tester2a
RK> site3:x:505:tester3,tester3a,tester3b
RK> site4:x:506:tester4
RK> site5:x:507:tester5,tester5a,tester5b
RK> site6:x:508:tester6
RK> site7:x:509:tester7,tester7a,tester7b  

RK> -- 
RK> Best regards,
RK>  Richard  mailto:[EMAIL PROTECTED]

your groups array will look like this

groups[0] = site1:x:503:tester1
groups[1] = site2:x:504:tester2,tester2a
so loop through the array

$x = 0;
while(list($key,$val) = each($groups)){

//you need split the array values like this
  list($name,$pass,$gid,$user_list) = split (":", $groups[$x]);
  //see if we have the right one
  if($name = $wanted_name){ //site6
 //then split the usernames into a sub array
 $users = explode(',',$userlist);
 // to add
 $users[] = $newuser;
 // to delete
 unset($users[3])
 // now add it back
 $userlist = implode(',',$users)
 $list = $name.':'.$pass.':'.$gid.':'.$userlist;
 $groups[$x] = $list;
  }
  $x++;
  //here you could fputs to a temp file then copy to the original
  // after finished
}

Then write groups back to disk
-- 
regards,
Tom


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98845.html">Re: [PHP] output buffering</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+output+buffering%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Leif+K%5C-Brooks%22&o=newest&f=1">Leif K-Brooks</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
You can't display an image like that in HTML.  You need to make a second
PHP script that displays just the image, and call it with a  tag.
Kevin Waterson wrote:

>I am having some problems with ob_*
>
>My goals is basically this
>
>Stuff goes here
>
>More stuff here
>
>The code below works until the showImage method is called, it does 
show the image
>however, it does not output the 'Stuff goes here!' line.
>
>any guidance greatfully recieved.
>Code is below..
>
>Kevin
>
>
>
>class thumbs {
>
>function thumbs(){
>
>}
>
>
>function showThumbs(){
>return 'Thumbs';
>}
>
>
>function select(){
>if(isset($_GET['show']))
>{
>return $this->showImage($_GET['show']);
>}
>  else
>{
>return $buffer.$this->showThumbs();
>}
>}
>
>
>function showImage(){
>  $size = getimagesize ('./australia.jpg');
>  if ($size)
>{
>header("Content-type: {$size['mime']}");
>return file_get_contents('australia.jpg');
>}
>  else
>{
>return ' was not found on this server';
>}
>}
>}  // end class
>
>$thumbs = new thumbs;
>
>ob_start(array($thumbs,'select'));
>
>?>
>
>Stuff goes here!
>
>ob_end_flush();
>?>
>
>
>
>
>
>

--
The above message is encrypted with double rot13 encoding.  Any 
unauthorized attempt to decrypt it will be prosecuted to the full extent 
of the law.





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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98844.html">Re[2]: [PHP] virtual() test</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22Re%5C%5B2%5C%5D%5C%3A+%5C%5BPHP%5C%5D+virtual%5C%28%5C%29+test%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Tom+Rogers%22&o=newest&f=1">Tom Rogers</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi,

Friday, February 28, 2003, 1:16:56 PM, you wrote:
TR> Hi,

TR> Friday, February 28, 2003, 12:09:30 PM, you wrote:
JWH>> Can anyone with Apache verify that you can pass arguments inside of a
JWH>> virtual() call? Something like:

JWH>> Virtual("script.pl?id=1")

JWH>> And have $id available within script.pl.

JWH>> I don't have access to an Apache server right now to test, so thank you
JWH>> very much. 

JWH>> ---John W. Holmes...

JWH>> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
JWH>> today. http://www.phparch.com/


TR> it shows up under
TR> _SERVER["QUERY_STRING"] => id=1

TR> I ran the following script (virt) in cgi-bin

TR> #!/usr/bin/php
TR>  header('Content-type: text/plain');
TR> echo "\n";
TR> echo 'Test script report';
TR> phpinfo(32);
?>>

TR> Then virtual('/cgi-bin/virt?id=1');

TR> -- 
TR> regards,
TR> Tom



That would be

echo QUERY_STRING = "$QUERY_STRING"

in perl

-- 
regards,
Tom


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98843.html">Re: [PHP] virtual() test</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+virtual%5C%28%5C%29+test%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Tom+Rogers%22&o=newest&f=1">Tom Rogers</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi,

Friday, February 28, 2003, 12:09:30 PM, you wrote:
JWH> Can anyone with Apache verify that you can pass arguments inside of a
JWH> virtual() call? Something like:

JWH> Virtual("script.pl?id=1")

JWH> And have $id available within script.pl.

JWH> I don't have access to an Apache server right now to test, so thank you
JWH> very much. 

JWH> ---John W. Holmes...

JWH> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
JWH> today. http://www.phparch.com/


it shows up under
_SERVER["QUERY_STRING"] => id=1

I ran the following script (virt) in cgi-bin

#!/usr/bin/php


Then virtual('/cgi-bin/virt?id=1');

-- 
regards,
Tom


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98842.html">Re: [PHP] non transmitted cookie</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+non+transmitted+cookie%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jason+Sheets%22&o=newest&f=1">Jason Sheets</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
That is why I suggested passing all that over SSL which would make it
very difficult to get the data even if you were able to get the
packets.  If you are operating with data that you care about you
probably need SSL.  There is not much point in creating some type of
applet combination that your user's client will need to support when you
can use SSL which is widely supported already.

Jason
On Wed, 2003-02-26 at 23:44, Dennis Gearon wrote:
> Unless of course, you are listening into the network connection :-)
> 
> Jason Sheets wrote:
> > 
> > Not that I am aware of, it seems you would be better off using SSL, if
> > you are concerned about someone hijacking the sessions you could
> > generate your own session id (I generate random 80 character session ids
> > instead of 32) and also limit the life of the session, you could write
> > logic to change the session ID every n minutes which would make brute
> > forcing the session id even harder.
> > 
> > Jason
> > On Wed, 2003-02-26 at 11:34, Dennis Gearon wrote:
> > > Is there anyway for a page to save information on a user's computer which is 
> > > accessible via java or
> > > javascript, but doesn't get sent with each HTML request the way a cookie is?
> > >
> > > I had this idea, patterned after kerberos:
> > >
> > > 1/ A user logs into a site via a secure link.
> > > 2/ A hash salt is stored on their computer and an
> > >initial hash is generated for the user as a Password
> > >to their session key.
> > > 3/ The user is redirected to the non secure part of the site
> > >and they have both the hash-pw plus session key in their document.
> > > 4/ Each time they access a page on our site, a javascript fires
> > >which generates the next sequence in the hash-pw.
> > > 5/ the server also generates the same new sequence and compares
> > >it. If the session key and the new password agree, then
> > >it is the user attached to the session.
> > >
> > > So, this salt needs to NOT be transmitted via the cookie so
> > > that it does not appear 'in the clear', which  would invalidate
> > > it's use.
> > >
> > > Please CC me when you reply to the list, I am on digest.
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> 
> Carpe Dancem ;-)
> -
> Remember your friends while they are alive
> -
>Sincerely, Dennis Gearon
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98841.html">[PHP] Help!! with array's Please</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Help%5C%21%5C%21+with+array%27s+Please%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Richard+Kurth%22&o=newest&f=1">Richard Kurth</a></span>
</div>
<blockquote><span class="msgFragment"><pre>

I really need somebody to help me with this I am totally lost on what
to do

I need a way to read the following text file and add to or delete from
or change the data.
I have been able to move it all into an array using this code
$groups= file("group");
for ($i=0; $i<$number_in_group; $i++){
$groups[0];
$groups[3]; <-- this is the part of the array that I need to change
}
But I can not figure out how to search the array and delete from or add
to the array at a given point. I would like to say add another user to
the end of site6 or delete a user from site3.
Could somebody give me a hand here. I have read the manual for arrays
and still can't figure it out.

site1:x:503:tester1
site2:x:504:tester2,tester2a
site3:x:505:tester3,tester3a,tester3b
site4:x:506:tester4
site5:x:507:tester5,tester5a,tester5b
site6:x:508:tester6
site7:x:509:tester7,tester7a,tester7b  

-- 
Best regards,
 Richard  mailto:[EMAIL PROTECTED]


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98840.html">Re: [PHP] PHP to read MS-SQL (solution)</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+PHP+to+read+MS%5C-SQL+%5C%28solution%5C%29%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Michael+Sims%22&o=newest&f=1">Michael Sims</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
On Thu, 27 Feb 2003 14:31:45 -0800 (PST), you wrote:

>Basically, it runs on the
>MS-SQL server and allows requests in XML format on a certain port.

That's actually pretty cool, from a tech standpoint, but why not
access the MS-SQL database directly?  From Windows it's easy, you just
need the SQL .dll's installed on the server, and from Linux/Unix you
can build PHP with FreeTDS support (--with-sybase=/usr/local/freetds).

There is an article detailing the second approach here:

http://www.phpbuilder.com/columns/alberto2919.php3

It's rather old, but still has useful information.

My company is using PHP on Linux and accessing a MS SQL 7 server for
all it's data.  We've had it in production for nearly a year now and
it's worked nearly flawlessly.

Sorry if I misunderstood your message...

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98839.html">[PHP] virtual() test</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+virtual%5C%28%5C%29+test%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22John+W.+Holmes%22&o=newest&f=1">John W. Holmes</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Can anyone with Apache verify that you can pass arguments inside of a
virtual() call? Something like:

Virtual("script.pl?id=1")

And have $id available within script.pl.

I don't have access to an Apache server right now to test, so thank you
very much. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/




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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98838.html">[PHP] output buffering</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+output+buffering%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Kevin+Waterson%22&o=newest&f=1">Kevin Waterson</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I am having some problems with ob_*

My goals is basically this

Stuff goes here 

More stuff here

The code below works until the showImage method is called, it does show the image
however, it does not output the 'Stuff goes here!' line.

any guidance greatfully recieved.
Code is below..

Kevin


showImage($_GET['show']);
}
  else
{
return $buffer.$this->showThumbs();
}
}


function showImage(){
  $size = getimagesize ('./australia.jpg');
  if ($size)
{
header("Content-type: {$size['mime']}");
return file_get_contents('australia.jpg');
}
  else
{
return ' was not found on this server';
}
}
}  // end class

$thumbs = new thumbs;

ob_start(array($thumbs,'select'));

?>

Stuff goes here!





-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98837.html">Re: [PHP] restating plea for help with sort</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+restating+plea+for+help+with+sort%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jason+Lange%22&o=newest&f=1">Jason Lange</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Try this code (tested):

<-- Begin Code -->
foreach ($list as $key => $value) {
// If elements value is a numeral add to numeric_array
if (is_numeric($value)) {
$numeric_array[$key] = $value;
// If value is not a numeral (presumably 'n/a') add to na_array
} else {
$na_array [$key] = $value;
}
}
// Re-combine arrays placing all "other" values at the end
$final_array = array_merge($numeric_array, $na_array);
<-- End Code -->
Hope that helps,
Jason
Kevin Stone wrote:
To append my own answer.  In order to sort the non "n/a" values you're going
to have to build a separate array and perhaps this will simplfy the problem.
So instead of what I suggested below.. loop the array and start TWO new
arrays within the loop.  One array for "n/a" values and one for non-"n/a"
values.  After the values are sorted to their separate arrays do
asort($nonnavals); then concatonate the two arrays together using
array_merge(), putting the "n/a" array second.
- Kevin

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 12:04 PM
Subject: Re: [PHP] restating plea for help with sort


Hmm well upon first glance looks like all you need to do is loop that
array

and start a new array within the loop.  An If/Else construct checks If the
value is "n/a" then append to the back of the new array Else prepend to
the

front of the new array.You append the values manually or use
array_push() and array_unshift().  Search the manual for more information.
Hope that helps.
- Kevin
- Original Message -
From: "Jim Long" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 11:35 AM
Subject: [PHP] restating plea for help with sort


Hi,

I have an array with an html link as key and different $vars as val:

$list = array (
'http://someplace.com/";>some place' => $vendor1_total,
'http://anotherplace.com/";>another place' =>
$vendor2__total,

[snip] etc..

some vals are numeric and some vals are "n/a"
asort works to sort the array as a string, however, I need to sort the
numeric vals numeric, then have the n/a's go away or be output at the
bottom of the sort.
Please be clear and gentle.. I'm not schooled in php, just a tinkerer
trying to make this mess work.
Thanks In Advance,

Jim Long

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



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






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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98836.html">RE: [PHP] Preventing the "hijacking" of pictures</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Preventing+the+%5C%22hijacking%5C%22+of+pictures%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22John+W.+Holmes%22&o=newest&f=1">John W. Holmes</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> What about using a MySQL database?  Insert the picture into a field in
> a table, then use a php script to call the data.  I've been working on
> something like this.  Is it practical, or am I barking up the wrong
> tree?

Too much overhead, in my opinion. Same result if you just stored the
files outside of the web root. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98835.html">Fwd: [PHP] Help with Arrays</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22Fwd%5C%3A+%5C%5BPHP%5C%5D+Help+with+Arrays%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Pushpinder+Singh+Garcha%22&o=newest&f=1">Pushpinder Singh Garcha</a></span>
</div>
<blockquote><span class="msgFragment"><pre>


Begin forwarded message:

From: Pushpinder Singh Garcha <[EMAIL PROTECTED]>
Date: Thu Feb 27, 2003  7:57:38 PM US/Eastern
To: olinux <[EMAIL PROTECTED]>
Subject: Re: [PHP] Help with Arrays
Thanks

My question was that each line of the file should be stored as one 
element of the array.
This is because, I need to compare each line of the text file against 
some user values.

TIA
--Pushpinder


On Thursday, February 27, 2003, at 04:33 PM, olinux wrote:

and what problem is that?>

how about just using the example?
http://www.php.net/manual/en/function.file.php
$lines = file ('http://www.example.com/');

// Loop through our array, show html source as html
source; and line numbers too.
foreach ($lines as $line_num => $line) {
echo "Line #{$line_num} : " .
htmlspecialchars($line) . "\n";
}


--- Pushpinder Singh Garcha <[EMAIL PROTECTED]>
wrote:
Hello all

I am having some problem with arrays

THIS IS THE PHP CODE

  $temp = file("file.txt");

if(!$temp)
{
  echo "File could not be read by array !!
";
  exit;
}
else
echo "Array was opened !!";
  $x = count($temp);
  echo "Array Count is: $x";
  echo "$temp[0]";
  //$P = str_replace("\r\n", "\n" , $temp);

  echo "First: $temp[0]";
  $P_new = explode(" ",$temp);
  echo "Next: $P_new[0]";
THIS IS THE TEXT FILE CALLLED ''file.txt''

abc111
asd123
aqw234
www234
edr234
vfr456


When I echo "$temp[0]" ... I get abc111 asd123
aqw234 www234 edr234
vfr456 on one straight line, which is weird. I
should get it on
separate lines.. Also I am unable to separate the
lines of the file
using the explode().
Any help will be highly appreciated

--Pushpinder



Pushpinder Singh Garcha
_
Web Architect


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Pushpinder Singh Garcha
_
Web Architect

Pushpinder Singh Garcha
_
Web Architect

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98834.html">Re: [PHP] HELP PLEASE ! Need PHP Advice !!!</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+HELP+PLEASE+%5C%21+Need+PHP+Advice+%5C%21%5C%21%5C%21%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Justin+French%22&o=newest&f=1">Justin French</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Right, well there's a few issues here.

1.

You're asking if there's a way to parse a QXD file so retrieve the text from
it.  I doubt this can be done.  I had a quick google for it, to no luck.  I
also bothered to open up a Quark 3.32 file in my text editor, to check out
the source.  It looks pretty complex.

However, there MAY be some light at the end of the tunnel.

a) PHP *IS* able to read and write PDF format.  Prerhaps if your newspaper
designers export a PDF of the newspaper (relatively easy). you can pick up
the pieces you need through the PDF, rather than the QXD file.

b) What you're really talking about is using one set of data in multiple
ways (web & print, then maybe email, WAP, PDA, etc).  What I'd be aiming to
do is have all the text/content stored in a shared database or easy-to-parse
file format (like XML), so that the writers write to this format, then the
designers copy + paste to Quark, the editors can edit directly in the XML
file or via database GUIs, and people in charge of other content formats
(like web_ can either copy + paste from the central content, or parse it
with a program like PHP.

c) Perhaps your company should look at Adobe InDesign 2 -- I read an article
which briefly discussed it's ability to parse or read from XML files -- so
you could have a simple XML doc:

---


28

Learning about XML

I wish I had time to explore this properly!

Justin French

[EMAIL PROTECTED]

XML,Justin,Foo,Bah,PHP



In this article, I'll attempt to show you some blah
blah.

Paragraph 1

Paragraph 2

Paragraph 3

This is my footer




---

I *think* InDesign 2 can take this data, and with the designer's help,
format it to a "designed" article.

At the very least, you could export some nice clean plain text for the
designer to copy+paste, which is probably what they already do (copy+paste
from Word to Quark.




2. Image files in Quark need to be either TIFF or EPS format.  So, what you
need is a way of copying these files, converting them to JPEGs, GIFs or
PNGs, and resizing them to suit the web.

I don't really know if the image functions in PHP can do this... best left
to others.

You *could* batch convert everything to a RGB JPEG using photoshops batch
processing and actions, THEN get PHP or Photoshop to do the resizing etc.

However, "cropping and whatnot" of a file is often something that can ONLY
be done by eye... You may never be able to achieve this with automated
computer programs.



Think about the real issue.  Is it "taking stuff from quark and messing with
it", or is it "having a good clean source of data which can be used many
ways"?


Justin French




on 28/02/03 12:24 AM, justin brenton ([EMAIL PROTECTED]) wrote:

> can anyone give me some good advise on how abouts I should go about
> maintaining a newspaper website.
> 
> here is what is currently in place and how i want it to be managed
> 
> right now the newspapers are published in a quark file from that file
> pictures have to be placed in photoshop and resized , croped and what not
> and then inserted into a html page, the content i.e text is in this quark
> file as well and is copied and pasted into a html file, what i want to do is
> have the site automated to some extent so i do not have to be doing all this
> copying and pasteing it's a total waste valueable time. what i would like to
> have it some way to have a php script to take this info from the quark file
> and the pictures and have them either transfered to a html page or to a
> database from there i could call from the php script.
> 
> 
> 
> ANYONE HAVE ANY IDEAS ON A GOOD WAY TO GO ABOUT THIS ... PLEASE CONTACT ME
> 
> [EMAIL PROTECTED]
> 
> remove the NOSPAM from address
> 
> 


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98833.html">[PHP] help with arrays</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+help+with+arrays%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jim+Long%22&o=newest&f=1">Jim Long</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi,

Origninal Post:

> I have an array with an html link as key and different $vars as val:
> 
> $list = array ( 
> 'http://someplace.com/";>some place' => $vendor1_total,
> 'http://anotherplace.com/";>another place' => $vendor2__total,
> [snip] etc..
> 
> some vals are numeric and some vals are "n/a"
> asort works to sort the array as a string, however, I need to sort the
> numeric vals numeric, then have the n/a's go away or be output at the
> bottom of the sort.

Kevin Stone wrote: (THANKS)

> In order to sort the non "n/a" values you're going
> to have to build a separate array and perhaps this will simplfy the problem.
> So instead of what I suggested earlier.. loop the array and start TWO new
> arrays within the loop.  One array for "n/a" values and one for non-"n/a"
> values.  After the values are sorted to their separate arrays do
> asort($nonnavals); then concatonate the two arrays together using
> array_merge(), putting the "n/a" array second.


I can't fiqure out how to set up arrays inside the while loop.

Using this:

while (list ($key, $val) = each ($orderd_list)) {
if ($val == 'n/a'){
$no_plan_list = array ($key => $val);// need an array here for "n/a" 
}else{
$plan_list = array  ($key => $val);// need an array here for numeric 
vals
}
}


Thanks In Advance,
Jim Long

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98832.html">[PHP] need PHP programmer</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+need+PHP+programmer%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jeff%22&o=newest&f=1">Jeff</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Don't know if this is appropriate or not but here we go.

I need help with a project.  requires a PHP developer.  The two programs 
we're using are php and MySQL.  Anyone interested or anyone who can help 
guide me to a place to find help please reply to me directly or to the 
list as you feel appropriate.

I'd like to find someone in Los Angeles area if possible but not essential.

Thanks in advance, Jeff

[EMAIL PROTECTED]

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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98831.html">[PHP] pdf</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+pdf%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22johnsworld%22&o=newest&f=1">johnsworld</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
hey guys, just a quick question re: creating pdf files on the fly.

i was wondering if anyone knew if it is possible to fully justify text?

thanks in anticipation, john



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98830.html">Re: [PHP] problem in writing into an html text file</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+problem+in+writing+into+an+html+text+file%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Michael+P.+Carel%22&o=newest&f=1">Michael P. Carel</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
thanks it's working now


- Original Message -
From: "Matt Honeycutt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 7:23 AM
Subject: RE: [PHP] problem in writing into an html text file


> Check stripslashes(), I think that will help you.
>
> ---Matt
>
> -Original Message-
> From: Michael P. Carel [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 4:53 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] problem in writing into an html text file
>
>
> this code add a backslashes in all doubleqoutes in the html file.
>
> sample:
> before editing my.html file
>
> 
>
> after editing my.html file
>
> 
>
> any idea why and how can i avoid this?
>
>
> > sorry here's the sample code:
> >
> >  > if(!$submit){
> > ?>
> > 
> >  >  $filename="my.html";
> >  $fd=fopen($filename,"r+")  or die("Can't open file $filename");
> >   $message = fread($fd, filesize($filename));
> >   fclose($fd);
> > ?>  > $message;?>/textarea>
> > 
> > 
> >  > }else{
> >
> >   $filename="my.html";
> >   $fd=fopen($filename,"w")  or die("Can't open file $filename");
> >   $fstring=$message;
> >   $fout = fwrite($fd, $fstring);
> >   fclose($fd);
> >
> > }
> > ?>
> >
> > the html file upon modify multiplies all the backslashes.
> >
> > any idea why? thanks in advance.
> >
> >
> >
> > - Original Message -
> > From: "Jason Sheets" <[EMAIL PROTECTED]>
> > To: "Michael P. Carel" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Thursday, February 27, 2003 12:04 PM
> > Subject: Re: [PHP] problem in writing into an html text file
> >
> >
> > > Hello Mike,
> > >
> > > You will need to better describe your problem and preferably show some
> > > source code.
> > >
> > > What characters are being added to it?  You could use str_replace or
the
> > > regular expression replacement functions but you should not get added
> > > characters in general.
> > >
> > > Jason
> > > On Wed, 2003-02-26 at 19:07, Michael P. Carel wrote:
> > > > hi to all,
> > > >
> > > > Im having a problem writing an HTML code in a text file which comes
> from
> > the
> > > > html text area as an editor. There's an added characters inserted to
> it.
> > How
> > > > could i write to it perfectly?
> > > >
> > > > mike
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98829.html">RE: [PHP] Destroying COM objects</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Destroying+COM+objects%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Rich+Gray%22&o=newest&f=1">Rich Gray</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> When using the COM functions in PHP what is the equivalent of 
> ASPs "set object=nothing"?
> I am using the Crystal Report objects and I cannot seem to 
> destroy my Report object.

Have you tried setting it to NULL?
Rich


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98828.html">[PHP] session.use_trans_sid on php 4.3.1</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+session.use_trans_sid+on+php+4.3.1%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Radu+Manole%22&o=newest&f=1">Radu Manole</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi guys ,

Seams like ini_set('session.use_trans_sid',0) does not work right on PHP
4.3.1 on Linux.

//--
PHP config is:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--enable-bcmath' '--enable-calendar' '--with-curl'
'--with-swf=/usr/local/flash' '--enable-ftp' '--with-gd'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl'
'--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans'
'--enable-mbregex' '--with-mcrypt' '--with-ming=../ming-0.2a'
'--enable-magic-quotes' '--with-mysql' '--with-pear' '--enable-sockets'
'--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr'
'--enable-gd-native-ttf' '--enable-versioning' '--with-zlib'
//--

Anyone encountered this problem before?
Thanks,
Radu




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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98827.html">[PHP] Destroying COM objects</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Destroying+COM+objects%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Sterling+Anderson%22&o=newest&f=1">Sterling Anderson</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
When using the COM functions in PHP what is the equivalent of 
ASPs "set object=nothing"?
I am using the Crystal Report objects and I cannot seem to 
destroy my Report object.

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98826.html">RE: [PHP] problem in writing into an html text file</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+problem+in+writing+into+an+html+text+file%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Matt+Honeycutt%22&o=newest&f=1">Matt Honeycutt</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Check stripslashes(), I think that will help you.

---Matt

-Original Message-
From: Michael P. Carel [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 4:53 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] problem in writing into an html text file


this code add a backslashes in all doubleqoutes in the html file.

sample:
before editing my.html file



after editing my.html file



any idea why and how can i avoid this?


> sorry here's the sample code:
>
>  if(!$submit){
> ?>
> 
>   $filename="my.html";
>  $fd=fopen($filename,"r+")  or die("Can't open file $filename");
>   $message = fread($fd, filesize($filename));
>   fclose($fd);
> ?>  $message;?>/textarea>
> 
> 
>  }else{
>
>   $filename="my.html";
>   $fd=fopen($filename,"w")  or die("Can't open file $filename");
>   $fstring=$message;
>   $fout = fwrite($fd, $fstring);
>   fclose($fd);
>
> }
> ?>
>
> the html file upon modify multiplies all the backslashes.
>
> any idea why? thanks in advance.
>
>
>
> - Original Message -
> From: "Jason Sheets" <[EMAIL PROTECTED]>
> To: "Michael P. Carel" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, February 27, 2003 12:04 PM
> Subject: Re: [PHP] problem in writing into an html text file
>
>
> > Hello Mike,
> >
> > You will need to better describe your problem and preferably show some
> > source code.
> >
> > What characters are being added to it?  You could use str_replace or the
> > regular expression replacement functions but you should not get added
> > characters in general.
> >
> > Jason
> > On Wed, 2003-02-26 at 19:07, Michael P. Carel wrote:
> > > hi to all,
> > >
> > > Im having a problem writing an HTML code in a text file which comes
from
> the
> > > html text area as an editor. There's an added characters inserted to
it.
> How
> > > could i write to it perfectly?
> > >
> > > mike
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98825.html">Re: [PHP] problem in writing into an html text file</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+problem+in+writing+into+an+html+text+file%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Michael+P.+Carel%22&o=newest&f=1">Michael P. Carel</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
this code add a backslashes in all doubleqoutes in the html file.

sample:
before editing my.html file



after editing my.html file



any idea why and how can i avoid this?


> sorry here's the sample code:
>
>  if(!$submit){
> ?>
> 
>   $filename="my.html";
>  $fd=fopen($filename,"r+")  or die("Can't open file $filename");
>   $message = fread($fd, filesize($filename));
>   fclose($fd);
> ?>  $message;?>/textarea>
> 
> 
>  }else{
>
>   $filename="my.html";
>   $fd=fopen($filename,"w")  or die("Can't open file $filename");
>   $fstring=$message;
>   $fout = fwrite($fd, $fstring);
>   fclose($fd);
>
> }
> ?>
>
> the html file upon modify multiplies all the backslashes.
>
> any idea why? thanks in advance.
>
>
>
> - Original Message -
> From: "Jason Sheets" <[EMAIL PROTECTED]>
> To: "Michael P. Carel" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, February 27, 2003 12:04 PM
> Subject: Re: [PHP] problem in writing into an html text file
>
>
> > Hello Mike,
> >
> > You will need to better describe your problem and preferably show some
> > source code.
> >
> > What characters are being added to it?  You could use str_replace or the
> > regular expression replacement functions but you should not get added
> > characters in general.
> >
> > Jason
> > On Wed, 2003-02-26 at 19:07, Michael P. Carel wrote:
> > > hi to all,
> > >
> > > Im having a problem writing an HTML code in a text file which comes
from
> the
> > > html text area as an editor. There's an added characters inserted to
it.
> How
> > > could i write to it perfectly?
> > >
> > > mike
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98824.html">RE: [PHP] Automatically included file?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Automatically+included+file%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Rich+Gray%22&o=newest&f=1">Rich Gray</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> New to PHP, I was wondering if PHP, running as a module under Apache 2,
> had an automatically included script that would run prior to any/each
> PHP script served by Apache?
>
> Tks,
> Dwayne

Dwayne
Look into the auto_prepend_file directive that you can specify in php.ini -
this may suit your needs.
Cheers
Rich



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98823.html">Re: [PHP] Re: using php to rotate ad banners</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A+using+php+to+rotate+ad+banners%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Manuel+Lemos%22&o=newest&f=1">Manuel Lemos</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hello,

On 02/27/2003 04:27 PM, Joseph Bannon wrote:
Why don't you just use phpAdsNew?


Because I prefer to write it myself so I can learn
more.
You can learn more studying the solutions provided by those that already 
attempted to implement the same problem. Just study phpAdsNew and you 
will learn more than you will possible learn from this list as this is 
not a trivial issue as you may imagine.

--

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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98822.html">[PHP] Automatically included file?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Automatically+included+file%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Dwayne+Miller%22&o=newest&f=1">Dwayne Miller</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
New to PHP, I was wondering if PHP, running as a module under Apache 2, 
had an automatically included script that would run prior to any/each 
PHP script served by Apache?

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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98821.html">[PHP] PHP to read MS-SQL (solution)</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+PHP+to+read+MS%5C-SQL+%5C%28solution%5C%29%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Bryan+Koschmann+%5C-+GKT%22&o=newest&f=1">Bryan Koschmann - GKT</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Thought I would throw this out if anyone is interested. We have some
proprietary accounting software that uses MS-SLQ as it's backend. Not my
choice, trust me.

Anyhow, I hassled the guy who made the software long enough that he
created a solution until we can swith to MySQL. Basically, it runs on the
MS-SQL server and allows requests in XML format on a certain port. Those
requests contain different information including the SQL query, whether it
returns in XML or deliminated, and how you wanted it delimated (comma,
whatever character).

My PHP script does a very simple fsockopen, fput, fget, then explode to
get the data.

He is planning on releasing it for free (maybe GPL with source if he can)
so if anyone is interested let me know.

Thanks,

Bryan


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98820.html">[PHP] Re:  date, "first of next month"?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A++date%2C+%5C%22first+of+next+month%5C%22%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Bryan+Koschmann+%5C-+GKT%22&o=newest&f=1">Bryan Koschmann - GKT</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
On Wed, 26 Feb 2003, Philip Hallstrom wrote:
|
|Use the w option of date() and loop through adding 86400 to $t until you
|get to a number between 1 and 5.
|
| w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)


I may of gotten ahead of myself, but I tried it using if/else. Looks like
this:

$t = mktime(0,0,0,date('m')+1,1,date('Y'));
$expdate = date("l, F jS Y", $t);

$expdatenum = date("w", $t);

if ($expdatenum == "6") {
$rendate = date("l, F jS Y", strtotime("$expdate +2 days"));
} else {
$rendate = date("l, F jS Y", strtotime("$expdate +1 day"));
}


I'm not sure if it would be more inefficient or what, but it seems to work
(so far). I'm not too worried about efficiency because it will only run
once a month.

Thanks to everyone who replied! I appreciate all the help!

Bryan


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98819.html">Re: [PHP] date problem</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+date+problem%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Lowell+Allen%22&o=newest&f=1">Lowell Allen</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> From: "Alexander Tsonev" <[EMAIL PROTECTED]>
> 
> Hello,
> I would ask you a question about date type
> if I have a variable from date type ($newdate) such as 2003-02-17
> how can I separate $newdate into 3 different variables? I want to create
> such variables:
> $day=17
> $month=2
> $year=2003
> I searched a lot, but I didn't find how to do this.
> I'll be very happy if someone helps!
> 

list($year, $month, $day) = explode("-", $newdate);

--
Lowell Allen


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98818.html">[PHP] Re: Help with Extending PHP</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A+Help+with+Extending+PHP%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22J+Smith%22&o=newest&f=1">J Smith</a></span>
</div>
<blockquote><span class="msgFragment"><pre>

This might help:

http://www.tutorbuddy.com/software/phpcpp/phpcpp/

J


Michel M. Dos Santos wrote:
> 
> 
> Hi,
> 
> I have a doubt about extending functions in PHP. I want to use C++
> language rather than C pure. I saw that dotnet module has cpp file. Is it
> possible ?
> 
> Thanks a lot,
> 
> Michel M. dos Santos


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98817.html">[PHP] Re: date problem</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A+date+problem%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22R%27twick+Niceorgaw%22&o=newest&f=1">R'twick Niceorgaw</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
$date_array=explode("-",$newdate);
$day = $date_array[2];
$month = $date_array[1];
$year = $date_array[0];

Or,
$timestamp - strtotime($newdate);
$today = getdate($timestamp);
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];


"Alexander Tsonev" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
> I would ask you a question about date type
> if I have a variable from date type ($newdate) such as 2003-02-17
> how can I separate $newdate into 3 different variables? I want to create
> such variables:
> $day=17
> $month=2
> $year=2003
> I searched a lot, but I didn't find how to do this.
> I'll be very happy if someone helps!
>
> Thanks in advance, Alexander Tsonev
>
>
>
>



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98816.html">[PHP] Dynamic XUL?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Dynamic+XUL%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Leif+K%5C-Brooks%22&o=newest&f=1">Leif K-Brooks</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I'm considering making a dynamic application for Mozilla/Netscape using 
PHP and XUL.  Has anyone here done this?  Anything I should be aware of?

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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98815.html">[PHP] date problem</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+date+problem%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Alexander+Tsonev%22&o=newest&f=1">Alexander Tsonev</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hello,
I would ask you a question about date type
if I have a variable from date type ($newdate) such as 2003-02-17
how can I separate $newdate into 3 different variables? I want to create
such variables:
$day=17
$month=2
$year=2003
I searched a lot, but I didn't find how to do this.
I'll be very happy if someone helps!

Thanks in advance, Alexander Tsonev





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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98814.html">Re: [PHP] Help with Arrays</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Help+with+Arrays%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22olinux%22&o=newest&f=1">olinux</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
and what problem is that?>

how about just using the example?
http://www.php.net/manual/en/function.file.php

$lines = file ('http://www.example.com/');

// Loop through our array, show html source as html
source; and line numbers too.
foreach ($lines as $line_num => $line) {
echo "Line #{$line_num} : " .
htmlspecialchars($line) . "\n";
}



--- Pushpinder Singh Garcha <[EMAIL PROTECTED]>
wrote:
> Hello all
> 
> I am having some problem with arrays
> 
> THIS IS THE PHP CODE
> 
>   $temp = file("file.txt");
> 
> if(!$temp)
> {
>   echo "File could not be read by array !!
> ";
>   exit;
> }
> else
> echo "Array was opened !!";
> 
>   $x = count($temp);
>   echo "Array Count is: $x";
>   echo "$temp[0]";
> 
>   //$P = str_replace("\r\n", "\n" , $temp);
> 
>   echo "First: $temp[0]";
>   $P_new = explode(" ",$temp);
>   echo "Next: $P_new[0]";
> 
> 
> THIS IS THE TEXT FILE CALLLED ''file.txt''
> 
> abc111
> asd123
> aqw234
> www234
> edr234
> vfr456
> 
> 
> 
> When I echo "$temp[0]" ... I get abc111 asd123
> aqw234 www234 edr234 
> vfr456 on one straight line, which is weird. I
> should get it on 
> separate lines.. Also I am unable to separate the
> lines of the file 
> using the explode().
> 
> Any help will be highly appreciated
> 
> --Pushpinder
> 
> 
> 
> Pushpinder Singh Garcha
> _
> Web Architect
> 


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98813.html">[PHP] Help with Arrays</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Help+with+Arrays%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Pushpinder+Singh+Garcha%22&o=newest&f=1">Pushpinder Singh Garcha</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hello all

I am having some problem with arrays

THIS IS THE PHP CODE

 $temp = file("file.txt");

   if(!$temp)
   {
 echo "File could not be read by array !! ";
 exit;
   }
   else
   echo "Array was opened !!";
 $x = count($temp);
 echo "Array Count is: $x";
 echo "$temp[0]";
 //$P = str_replace("\r\n", "\n" , $temp);

 echo "First: $temp[0]";
 $P_new = explode(" ",$temp);
 echo "Next: $P_new[0]";
��
THIS IS THE TEXT FILE CALLLED ''file.txt''

abc111
asd123
aqw234
www234
edr234
vfr456��


When I echo "$temp[0]" ... I get abc111 asd123 aqw234 www234 edr234 
vfr456 on one straight line, which is weird. I should get it on 
separate lines.. Also I am unable to separate the lines of the file 
using the explode().

Any help will be highly appreciated

--Pushpinder



Pushpinder Singh Garcha
_
Web Architect

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98812.html">RE: [PHP] Newbie look for some content specific tutorials</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Newbie+look+for+some+content+specific+tutorials%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Cal+Evans%22&o=newest&f=1">Cal Evans</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
take a look at the database abstraction layer ADODB at php.weblog.com  Even
if you are like me and never use more than just MySQL, it makes like a lot
easier.

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Hunter, Jess [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 2:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie look for some content specific tutorials


Greets all,

First time poster here and a 1 week old PHP/Mysql programmer

I have bought several books and scoured the net for any and all PHP/MySQL
tutorials. Here is the problem I am running into:

1. The docs tell how to access MySql through the MySql monitor
2. any docs that tutor how to make PHP interact with MySql has you doing all
the functions directly on the page
3. All the rest are written like VCR instructions (Mine still blinks
"12:00")

What I am looking for is a tutorial that talks specifically about the
interaction of PHP forms with MySql

I have figured out how to add records using PHP, and have even figured out a
crude search function, but being able to update or delete records are
eluding me.

Does anyone know of a site that has this type of information with some
extremely well commented samples?

Thanks

Jester

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



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98811.html">[PHP] Re:  Re: Re: Editors</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A++Re%5C%3A+Re%5C%3A+Editors%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Paul+Nicholson%22&o=newest&f=1">Paul Nicholson</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey Jim,
- From the WINE Faq (http://www.winehq.org/).
"3.8. Do I need to have a DOS partition on my system to use Wine?
 You do not need a licensed and installed copy of DOS or MS Windows to 
install, configure and run Wine. However, Wine has to be able to 'see' an MS 
Windows binary (i.e. application) if it is to run it."
You *might* need to download some of the common windows type dlls but thats 
about all. :)
~Paul
On Thursday 27 February 2003 01:12 pm, James Hatridge wrote:
[snip]
> I stopped using Windows at 3.1 . If I understand correctly you have to
> have a copy of W$ 9X (or whatever). If this is true then I can't use wine
> because I don't have a usable copy of W$. Has this changed in the past few
> years?
>
> Thanks
> JIM
> PS Been useing SuSE since version 4.4.1 :)

- -- 
~Paul Nicholson
Design Specialist @ WebPower Design
[EMAIL PROTECTED]
www.webpowerdesign.net
"The webthe way you want it!"


"It said uses Windows 98 or better, so I loaded Linux!"
Registered Linux User #183202 using Register Linux System # 81891
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+XnYXDyXNIUN3+UQRAoUuAKCeN+6ejYXcaBeW2xA2c6PawFY3YgCfWNiA
75QGnpM/751hqcXECTst/t4=
=snUY
-END PGP SIGNATURE-

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98810.html">[PHP] Help with Extending PHP</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Help+with+Extending+PHP%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Michel+M.+dos+Santos%22&o=newest&f=1">Michel M. dos Santos</a></span>
</div>
<blockquote><span class="msgFragment"><pre>


Hi,

I have a doubt about extending functions in PHP. I want to use C++ language 
rather than C pure. I saw that dotnet module has cpp file. Is it possible ?

Thanks a lot,

Michel M. dos Santos

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98809.html">[PHP] Newbie look for some content specific tutorials</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Newbie+look+for+some+content+specific+tutorials%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Hunter%2C+Jess%22&o=newest&f=1">Hunter, Jess</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Greets all,

First time poster here and a 1 week old PHP/Mysql programmer

I have bought several books and scoured the net for any and all PHP/MySQL
tutorials. Here is the problem I am running into:

1. The docs tell how to access MySql through the MySql monitor
2. any docs that tutor how to make PHP interact with MySql has you doing all
the functions directly on the page
3. All the rest are written like VCR instructions (Mine still blinks
"12:00")

What I am looking for is a tutorial that talks specifically about the
interaction of PHP forms with MySql

I have figured out how to add records using PHP, and have even figured out a
crude search function, but being able to update or delete records are
eluding me.

Does anyone know of a site that has this type of information with some
extremely well commented samples?

Thanks

Jester

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98808.html">[PHP] Automatic .htaccess Authentication?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Automatic+.htaccess+Authentication%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Nick+Oostveen%22&o=newest&f=1">Nick Oostveen</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I'm looking for a way to have php automatically log a user into an htaccess 
protected directory.

My problem is as follows.  I currently have a large number of php scripts 
which use a database authentication system.  Unfortunately, there are also 
a number of old CGI scripts which need to be protected by an .htaccess file.

What I'm looking for is a way to allow php to perform the .htaccess 
authentication in the background when the user first logs into the DB based 
authentication so that when they go to access the cgi scripts they are not 
prompted for another login.

Any Ideas?

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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98807.html">[PHP] HELP!! with array's</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+HELP%5C%21%5C%21+with+array%27s%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Richard+Kurth%22&o=newest&f=1">Richard Kurth</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hello ,

I need a way to read the following text file and add to or delete from
or change the data.
I have been able to move it all into an array using this code
$groups= file("group");
for ($i=0; $i<$number_in_group; $i++){
}
But I can not figure out how to search the array and delete from or add
to the array at a given point. I would like to say add another user to
the end of site6 or delete a user from site3.
Could sombody give me a hand here. I have read the manual for arrays
and still can't figure it out.

site1:x:503:tester1
site2:x:504:tester2,tester2a
site3:x:505:tester3,tester3a,tester3b
site4:x:506:tester4
site5:x:507:tester5,tester5a,tester5b
site6:x:508:tester6
site7:x:509:tester7,tester7a,tester7b

  

-- 
Best regards,
 Richard  mailto:[EMAIL PROTECTED]


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98806.html">Re: [PHP] Restate: using php to rotate ad banners</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Restate%5C%3A+using+php+to+rotate+ad+banners%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jason+k+Larson%22&o=newest&f=1">Jason k Larson</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Have you seen phpAdsNew ?

It really kicks ass.  High quality development going on with that 
project.  Plus, they've already worked out all the issues you are having 
with cookies and what not by using sessions.  It's really fast too, and 
they have some caching options to make performance even better.

It's always nice to write your own stuff to learn, but seriously, if you 
are planning to do anything that other people need to rely on for a 
banner management system and server, use phpAdsNew.  You can find it on 
SourceForge.

Regards,
Jason k Larson
Joseph Bannon wrote:
Anyone? Reply?

I recently created some scripts to rotate ad banners
on my site. One script is called show.php, which
serves the banner. The other is called click.php,
which redirects the people to the proper site for
the banner they clicked on.
 
Some people have noticed that when they click on the
banner, they go to another site. Others have noticed
that they just get returned back to the page that
they just were at. I test it without any problems.
 
I have been doing the redirecting using cookies. The
script show.php puts the cookie on their computer.
The script click.php gets the cookie and redirects
them
to the proper place when clicked. Should I be using
cookies or sessions to do this? I think the problem
is that some people have their browser set to not
accept cookies which is why they get directed to other
places.
 

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/


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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98805.html">[PHP] Re: Does PHP supports threads?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A+Does+PHP+supports+threads%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22J+Smith%22&o=newest&f=1">J Smith</a></span>
</div>
<blockquote><span class="msgFragment"><pre>

Actually, there's a threads extension in PECL:

http://cvs.php.net/cvs.php/pear/PECL/threads

J


Justin Garrett wrote:

> PHP does not support threading.  Depending on what you're trying to do you
> may find the process control functions useful
> http://www.php.net/manual/en/ref.pcntl.php
> 
> Justin Garrett
> 


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98804.html">Re: [PHP] Restate: using php to rotate ad banners</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Restate%5C%3A+using+php+to+rotate+ad+banners%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Daniel+Guerrier%22&o=newest&f=1">Daniel Guerrier</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Don't reinvent the wheel :)

http://www.phpadsnew.com/one/
--- Joseph Bannon <[EMAIL PROTECTED]> wrote:
> Anyone? Reply?
> 
> 
> I recently created some scripts to rotate ad banners
> on my site. One script is called show.php, which
> serves the banner. The other is called click.php,
> which redirects the people to the proper site for
> the banner they clicked on.
>  
> Some people have noticed that when they click on the
> banner, they go to another site. Others have noticed
> that they just get returned back to the page that
> they just were at. I test it without any problems.
>  
> I have been doing the redirecting using cookies. The
> script show.php puts the cookie on their computer.
> The script click.php gets the cookie and redirects
> them
> to the proper place when clicked. Should I be using
> cookies or sessions to do this? I think the problem
> is that some people have their browser set to not
> accept cookies which is why they get directed to
> other
> places.
>  
> 
> __
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98803.html">[PHP] Re:  Re: Re: Editors</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A++Re%5C%3A+Re%5C%3A+Editors%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22James+Hatridge%22&o=newest&f=1">James Hatridge</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
HI Paul,,,

On Wednesday 26 February 2003 22:10, Paul Nicholson wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Wednesday 26 February 2003 02:19 pm, James Hatridge wrote:
> [snip]
>
> > Thanks for the address. I looked into it closer and I find that it is
> > only for Windows. Pity.
>
> It will run on linux using wine. Yes, I've tried it...it works!
> ~Paul

I stopped using Windows at 3.1 . If I understand correctly you have to have 
a copy of W$ 9X (or whatever). If this is true then I can't use wine because 
I don't have a usable copy of W$. Has this changed in the past few years? 

Thanks

JIM

PS Been useing SuSE since version 4.4.1 :)


-- 
Jim Hatridge
Linux User #88484
--
 BayerWulf
   Linux System # 129656
 The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98802.html">Re: [PHP] Re: using php to rotate ad banners</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A+using+php+to+rotate+ad+banners%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Joseph+Bannon%22&o=newest&f=1">Joseph Bannon</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> Why don't you just use phpAdsNew?


Because I prefer to write it myself so I can learn
more.

J.



=
RisingMusic.com
450,000 registered users.
14,000 registered bands and artists.

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98801.html">[PHP] Restate: using php to rotate ad banners</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Restate%5C%3A+using+php+to+rotate+ad+banners%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Joseph+Bannon%22&o=newest&f=1">Joseph Bannon</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Anyone? Reply?


I recently created some scripts to rotate ad banners
on my site. One script is called show.php, which
serves the banner. The other is called click.php,
which redirects the people to the proper site for
the banner they clicked on.
 
Some people have noticed that when they click on the
banner, they go to another site. Others have noticed
that they just get returned back to the page that
they just were at. I test it without any problems.
 
I have been doing the redirecting using cookies. The
script show.php puts the cookie on their computer.
The script click.php gets the cookie and redirects
them
to the proper place when clicked. Should I be using
cookies or sessions to do this? I think the problem
is that some people have their browser set to not
accept cookies which is why they get directed to other
places.
 

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98800.html">Re: [PHP] restating plea for help with sort</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+restating+plea+for+help+with+sort%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Kevin+Stone%22&o=newest&f=1">Kevin Stone</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
To append my own answer.  In order to sort the non "n/a" values you're going
to have to build a separate array and perhaps this will simplfy the problem.
So instead of what I suggested below.. loop the array and start TWO new
arrays within the loop.  One array for "n/a" values and one for non-"n/a"
values.  After the values are sorted to their separate arrays do
asort($nonnavals); then concatonate the two arrays together using
array_merge(), putting the "n/a" array second.

- Kevin

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 12:04 PM
Subject: Re: [PHP] restating plea for help with sort


> Hmm well upon first glance looks like all you need to do is loop that
array
> and start a new array within the loop.  An If/Else construct checks If the
> value is "n/a" then append to the back of the new array Else prepend to
the
> front of the new array.You append the values manually or use
> array_push() and array_unshift().  Search the manual for more information.
> Hope that helps.
> - Kevin
>
> - Original Message -
> From: "Jim Long" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, February 27, 2003 11:35 AM
> Subject: [PHP] restating plea for help with sort
>
>
> > Hi,
> >
> > I have an array with an html link as key and different $vars as val:
> >
> > $list = array (
> > 'http://someplace.com/";>some place' => $vendor1_total,
> > 'http://anotherplace.com/";>another place' =>
$vendor2__total,
> > [snip] etc..
> >
> > some vals are numeric and some vals are "n/a"
> > asort works to sort the array as a string, however, I need to sort the
> > numeric vals numeric, then have the n/a's go away or be output at the
> > bottom of the sort.
> >
> > Please be clear and gentle.. I'm not schooled in php, just a tinkerer
> > trying to make this mess work.
> >
> > Thanks In Advance,
> >
> > Jim Long
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98799.html">[PHP] php3 and php4</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+php3+and+php4%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Ozete+C.Filho%22&o=newest&f=1">Ozete C.Filho</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
My friends, why this program no function in php4, just in php3?

Pessoal, esse algoritmo é conhecido como Dijkstra, ele calcula o melhor caminho entre 
pontos( num grafo, por exemplo), mas nao consigo rodar ele no php4, so funciona no 3. 
Alguem sabe me dizer se há algo errado?

 2, d => 3);
$neighbors[b] = array(a => 2, c => 1, e => 4);
$neighbors[c] = array(b => 1, f => 5);
$neighbors[d] = array(a => 3, e => 2);
$neighbors[e] = array(d => 2, b => 4, f => 1);
$neighbors[f] = array(c => 5, e => 1);

function dijkstra($neighbors, $start) {
  $closest = $start;
  while (isset($closest)) {
$marked[$closest] = 1;
reset($neighbors[$closest]);
while(list($vertex, $distance) = each($neighbors[$closest])) {
  if ($marked[$vertex])
continue;
  $dist = $paths[$closest][0] + $distance;
  if (!isset($paths[$vertex]) || ($dist < $paths[$vertex][0])) {
$paths[$vertex] = $paths[$closest];
$paths[$vertex][] = $closest;
$paths[$vertex][0] = $dist;
  }
}
unset($closest);
reset ($paths);
while(list($vertex, $path) = each($paths)) {
  if ($marked[$vertex])
continue;
  $distance = $path[0];
  if (($distance < $min) || !isset($closest)) {
$min = $distance;
$closest = $vertex;
  }
}
  }
  return $paths;
}

$paths = dijkstra($neighbors, "$start");
while(list($vertex, $path) = each($paths))
  echo "$vertex: ", implode(", ", $path), "\n";

?>


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98798.html">[PHP] htmlentities()</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+htmlentities%5C%28%5C%29%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Liam+Gibbs%22&o=newest&f=1">Liam Gibbs</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I seem to be having trouble with htmlentities(). Maybe someone has a clue I can 
borrow. Here's my function:

function FitForHTML($string) {
$asciitable = get_html_translation_table(HTML_ENTITIES);
$string = htmlentities($string, ENT_COMPAT);
$string = str_replace($asciitable[chr(255)], "ÿ", $string);

return $string;
}

When calling this function with the following data: é[a club]+  <>
I get: é♣+  &

(I didn't send this as Unicode. The ♣ was originally a club character.)

Maybe I'm not looking in the correct area, but when I do a search in Google Groups, I 
get one message (well, two: one in English and one in German or some language that 
uses a lot of z's and c's), but that doesn't solve the problem.

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98797.html">Re: [PHP] restating plea for help with sort</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+restating+plea+for+help+with+sort%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Kevin+Stone%22&o=newest&f=1">Kevin Stone</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hmm well upon first glance looks like all you need to do is loop that array
and start a new array within the loop.  An If/Else construct checks If the
value is "n/a" then append to the back of the new array Else prepend to the
front of the new array.You append the values manually or use
array_push() and array_unshift().  Search the manual for more information.
Hope that helps.
- Kevin

- Original Message -
From: "Jim Long" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 11:35 AM
Subject: [PHP] restating plea for help with sort


> Hi,
>
> I have an array with an html link as key and different $vars as val:
>
> $list = array (
> 'http://someplace.com/";>some place' => $vendor1_total,
> 'http://anotherplace.com/";>another place' => $vendor2__total,
> [snip] etc..
>
> some vals are numeric and some vals are "n/a"
> asort works to sort the array as a string, however, I need to sort the
> numeric vals numeric, then have the n/a's go away or be output at the
> bottom of the sort.
>
> Please be clear and gentle.. I'm not schooled in php, just a tinkerer
> trying to make this mess work.
>
> Thanks In Advance,
>
> Jim Long
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98796.html">Re: [PHP] PHP graphs</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+PHP+graphs%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jordan+Elver%22&o=newest&f=1">Jordan Elver</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> Secondly, I'd like to trace a basic X/Y graph with data provided from a DB,
> any PHP help?

JPGraph is good.

-- 
Jordan Elver
Put the key of despair into the lock of apathy. Turn the knob of mediocrity 
slowly and open the gates of despondency - welcome to a day in the average 
office. -- David Brent (The Office)


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98795.html">[PHP] restating plea for help with sort</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+restating+plea+for+help+with+sort%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jim+Long%22&o=newest&f=1">Jim Long</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi,

I have an array with an html link as key and different $vars as val:

$list = array ( 
'http://someplace.com/";>some place' => $vendor1_total,
'http://anotherplace.com/";>another place' => $vendor2__total,
[snip] etc..

some vals are numeric and some vals are "n/a"
asort works to sort the array as a string, however, I need to sort the
numeric vals numeric, then have the n/a's go away or be output at the
bottom of the sort.

Please be clear and gentle.. I'm not schooled in php, just a tinkerer
trying to make this mess work.

Thanks In Advance,

Jim Long

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98794.html">[PHP] PHP graphs</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+PHP+graphs%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22K%22&o=newest&f=1">K</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi guys,
I would like to read the IP address from a PC that connects to my web site.
Any function does that in PHP?

Secondly, I'd like to trace a basic X/Y graph with data provided from a DB,
any PHP help?

Thx.





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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98793.html">[PHP] make error on solaris</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+make+error+on+solaris%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22R%27twick+Niceorgaw%22&o=newest&f=1">R'twick Niceorgaw</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi all,
I'm trying to get a vanila installation of php 4.3.1(only the cli version)
on a solaris 8 system. This is my first day on a solaris box so I don't know
much about it. I'm running into some errors in the final linking stage. Any
one experienced this problem and got any idea to fix it? (error and my
configuration follows below).

Regards
R;twick

Here's the errors I'm getting

Undefined   first referenced
 symbol in file
wtcLerr
/opt/oracle/app/oracle/product/8.1.7/lib/libclient8.a(kpucc.o)  (symbol
belongs to implicit dependency
/opt/oracle/app/oracle/product/8.1.7/lib/libwtc8.so)
wtcMerr
/opt/oracle/app/oracle/product/8.1.7/lib/libclient8.a(kpucc.o)  (symbol
belongs to implicit dependency
/opt/oracle/app/oracle/product/8.1.7/lib/libwtc8.so)
wtcsrin
/opt/oracle/app/oracle/product/8.1.7/lib/libclient8.a(kpuini.o)  (symbol
belongs to implicit dependency
/opt/oracle/app/oracle/product/8.1.7/lib/libwtc8.so)
wtcsrfre
/opt/oracle/app/oracle/product/8.1.7/lib/libclient8.a(kpuini.o)  (symbol
belongs to implicit dependency
/opt/oracle/app/oracle/product/8.1.7/lib/libwtc8.so)
wtcstu
/opt/oracle/app/oracle/product/8.1.7/lib/libclient8.a(kpucc.o)  (symbol
belongs to implicit dependency
/opt/oracle/app/oracle/product/8.1.7/lib/libwtc8.so)
wtclkm
/opt/oracle/app/oracle/product/8.1.7/lib/libclient8.a(kpucc.o)  (symbol
belongs to implicit dependency
/opt/oracle/app/oracle/product/8.1.7/lib/libwtc8.so)
ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

And here is my configure line
./configure --prefix=/export/home/hdradmin/php --disable-cgi --with-pear --e
nable-ftp --without-mysql --with-oci8




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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98792.html">RE: [PHP] Preventing the "hijacking" of pictures</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Preventing+the+%5C%22hijacking%5C%22+of+pictures%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Daniel+Kushner%22&o=newest&f=1">Daniel Kushner</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi Merlin,

What you are describing is named Hot Linking. A quick search on Google gave me this:
http://www.htmlbasix.com/disablehotlinking.shtml


Regards,
Daniel Kushner

Need PHP Training? http://www.nyphp.org/training.php



> -Original Message-
> From: merlin [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 10:18 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Preventing the "hijacking" of pictures
> 
> 
> Hi there,
> 
> I recently discovered the reason why the traffic is rising so high on my
> server. Some people are "stealing" bandwidth. They include
> the link of an image into a forum posting. Now everytime somebody reads this
> threat on the other site this image is
> served by my server!! No one cares about one image, but they become
> dramaticly a lot!
> 
> Is there a reason how to find out that the image is not include into my html
> code, but into the other site code?
> 
> A great idea would be showing a kind of a watermark on this images if they
> are included inside other websites.
> 
> $_SERVER[HTTP_REFERRER] does not help. But there might be another method I
> do not know of.
> 
> Thank you for any help and hints on this topic!
> 
> Merlin
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98791.html">Re: [PHP] post xml</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+post+xml%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Mincu+Alexandru%22&o=newest&f=1">Mincu Alexandru</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
you can provide only one variable in the array:
http_post(
'195.57.250.36',
80,
'/barceloDS/interface/xml',
array(
"xml"=>$xml
)
);

On some date, Diana Castillo wrote:

>thanks a lot I have a question, how would I specifiy the name of the
>variable I am sending if I am sending only one? If I send it like this
does
>it know that what I am sending as $xml is also named the variable xml ?
the
>example only has an array.
>http_post('195.57.250.36',80,'/barceloDS/interface/xml',$xml);
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98790.html">RE: [PHP] HELP PLEASE ! Need PHP Advice !!!</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+HELP+PLEASE+%5C%21+Need+PHP+Advice+%5C%21%5C%21%5C%21%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Victor+Stan%22&o=newest&f=1">Victor Stan</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
First of all, are they paying you to automate or to repurpose the content
for the web? Taking a page designed for print and then "automating" it into
a page for the web is the wrong approach, your problem is not technical it
is a design problem. Technically it is easy, I think, does Quark not have
XML output? Or I think it is able to save document as HTML for the web too,
then if you want to "automate" all u have to do is make a script that
includes those pages inside a site shell. I actually wrote something like
this that one could save an html file from word and upload it and it would
be on the site, but again, I think it's a bad idea. You should NOT try to
automate this, you should look into hiring a fulltime repurposing designer,
at LEAST you should read "designing Web Usability" by Jacob Nielson, then
maybe u get a better idea of what you SHOULD do.

- Vic

-Original Message-
From: justin brenton [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 7:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP] HELP PLEASE ! Need PHP Advice !!!

can anyone give me some good advise on how abouts I should go about
maintaining a newspaper website.

here is what is currently in place and how i want it to be managed

right now the newspapers are published in a quark file from that file
pictures have to be placed in photoshop and resized , croped and what not
and then inserted into a html page, the content i.e text is in this quark
file as well and is copied and pasted into a html file, what i want to do is
have the site automated to some extent so i do not have to be doing all this
copying and pasteing it's a total waste valueable time. what i would like to
have it some way to have a php script to take this info from the quark file
and the pictures and have them either transfered to a html page or to a
database from there i could call from the php script.



ANYONE HAVE ANY IDEAS ON A GOOD WAY TO GO ABOUT THIS ... PLEASE CONTACT ME

[EMAIL PROTECTED]

remove the NOSPAM from address



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

__ 
Post your free ad now! http://personals.yahoo.ca

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98789.html">[PHP] Re: How to create an empty array</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A+How+to+create+an+empty+array%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jun%22&o=newest&f=1">Jun</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Use  $category_list = array()  instead.
When you do $category_list[] = array(), you are creating
an array of arrays. $category_list becomes an array with 1 element and this
element is an empty array. So use $category_list = array();


"Michael Zornek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I want to create an empty array so I can add elements to it later
>
> I'm currently using:
> $catergory_list[] =array();
>
> But when I try to print this list I discover the element zero has the
string
> "Array" in it. How can I create a truly empty array?
>
> ~ Mike
> --
> MikeZornek.com
> New blog, new Q&A column, new content everywhere!
> http://www.mikezornek.com
>



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98788.html">RE: [PHP] Preventing the "hijacking" of pictures</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Preventing+the+%5C%22hijacking%5C%22+of+pictures%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Sysadmin%22&o=newest&f=1">Sysadmin</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
What about using a MySQL database?  Insert the picture into a field in 
a table, then use a php script to call the data.  I've been working on 
something like this.  Is it practical, or am I barking up the wrong 
tree?

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 12:20 PM
To: 'merlin'; [EMAIL PROTECTED]
Subject: RE: [PHP] Preventing the "hijacking" of pictures


> I recently discovered the reason why the traffic is rising so high on
my
> server. Some people are "stealing" bandwidth. They include
> the link of an image into a forum posting. Now everytime somebody
reads
> this
> threat on the other site this image is
> served by my server!! No one cares about one image, but they become
> dramaticly a lot!
> 
> Is there a reason how to find out that the image is not include into
my
> html
> code, but into the other site code?
> 
> A great idea would be showing a kind of a watermark on this images if
they
> are included inside other websites.
> 
> $_SERVER[HTTP_REFERRER] does not help. But there might be another
method I
> do not know of.
> 
> Thank you for any help and hints on this topic!

The best way to handle this is probably with your web server. There are
some rewrite rules that you can apply to the images/ directory that'll
redirect a request for an image to another image if the request doesn't
come from your site. We used to do this on a site I helped run. If
someone tried to hotlink to one of our images, they got an add for some
rather queer looking male swimsuits... :)

Or, the other option is to implement this in PHP. Store your images
outside of the web root. Serve them all up through a PHP page.



foo.php will make sure that the request is valid by possibly checking a
session value or HTTP_REFERRER. If the request is valid, send the
headers and use readfile() to send the image data. If it's not, send the
data for another image or nothing. 

The downside to this is it's harder to manage and all images requests
will be running through PHP pages.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98787.html">Re: [PHP] How do I display the script file name?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+How+do+I+display+the+script+file+name%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Stephen+Ford%22&o=newest&f=1">Stephen Ford</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
By including "\n" the html source looks like this, which is fine. I'll RTFM
about $_SERVER and post back if in trouble.

Thanks for help.

Stephen

$_SERVER['PHP_SELF']= 
$_SERVER['SCRIPT_NAME'] (etc)=  
__FILE__=/path/sfindex03.php
$SCRIPT_FILENAME=/path/sfindex03.php
Basename=sfindex03.php



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98786.html">Re: [PHP] Re: Mail (), BBC: recipients not receiving my Newsletter</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Re%5C%3A+Mail+%5C%28%5C%29%2C+BBC%5C%3A+recipients+not+receiving+my+Newsletter%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Manuel+Lemos%22&o=newest&f=1">Manuel Lemos</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hello,

On 02/27/2003 02:22 PM, Ricardo Fitzgerald wrote:
I've dl your class and read some of your test scripts, but it's not
working at all 
I tested using test_personalized_bulk_mail.php
And I got :'Error: it was not possible to send email message'
You most likely have a PHP configuration problem. It is hard to tell 
before you describe your system. Is it Windows or Unix/Linux? What do 
you have configured in the php.ini file.

Anyway, if you are using Windows, which is my guess, you need to send 
the message via an SMTP server. If you have it configured to send via a 
working SMTP server, you may be having one of many types problems that 
can only be cleared with the some information about that error.

In that case, try using in the script of that class named 
test_smtp_message.php changing it to use your SMTP server and set the 
smtp_debug variable to 1 so you can see the dialog with the SMTP server. 
 That should help figuring what is your problem.

--

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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98785.html">Re: [PHP] How do I display the script file name?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+How+do+I+display+the+script+file+name%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Leif+K%5C-Brooks%22&o=newest&f=1">Leif K-Brooks</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
The 
Jason k Larson wrote:

 > I disagree.  While I tend to stay away from short tags in general, the
 > use of the short echo tag has yet to cause any trouble for me.  And it
 > makes code exceptionally easier to read, which proves to be a
 > valueable asset.  Maybe you could provide and example where a short
 > tag is causing some trouble.  I'd like to see that.  That is, unless
 > it's not a PHP behavior problem, but a scripting or logic issue due to
 > poor development.
 >
 > --
 > Jason k Larson
 >
 >
 > Leif K-Brooks wrote:
 >
 >> I think you mean worse.  Short tags cause nothing but trouble.
 >>
 >> Jason k Larson wrote:
 >>
 >>> or even better:
 >>>
 >>> 
 >>
 >
 >
 >
--
The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent
of the law.




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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98784.html">Re: [PHP] How do I display the script file name?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+How+do+I+display+the+script+file+name%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jason+k+Larson%22&o=newest&f=1">Jason k Larson</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I disagree.  While I tend to stay away from short tags in general, the
use of the short echo tag has yet to cause any trouble for me.  And it
makes code exceptionally easier to read, which proves to be a valueable
asset.  Maybe you could provide and example where a short tag is causing
some trouble.  I'd like to see that.  That is, unless it's not a PHP
behavior problem, but a scripting or logic issue due to poor development.
--
Jason k Larson
Leif K-Brooks wrote:
I think you mean worse.  Short tags cause nothing but trouble.

Jason k Larson wrote:

or even better:






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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98783.html">Re: [PHP] How do I display the script file name?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+How+do+I+display+the+script+file+name%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Stephen+Ford%22&o=newest&f=1">Stephen Ford</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I've checked up on strings, and it seems like the quoting is like the Korn
shell.

You can see below that I found basename() which works fine with __FILE__,
but $_SERVER['PHP_SELF'] etc print nothing. Any ideas?

Stephen


=PHP==
$_SERVER[\'PHP_SELF\']= '.$_SERVER['PHP_SELF']."";

 echo '$_SERVER[\'SCRIPT_NAME\'] (etc)='.$_SERVER['SCRIPT_NAME'].' '.
 $_SERVER['SCRIPT_FILENAME'].' '.
 $_SERVER['PHP_SELF']."";

 echo '__FILE__='.__FILE__."";

 echo '$SCRIPT_FILENAME='.$SCRIPT_FILENAME."";

 echo "Basename=".basename(__FILE__)."";
?>
==IE6 Display=
$_SERVER['PHP_SELF']=

$_SERVER['SCRIPT_NAME'] (etc)=

__FILE__=/path/sfindex03.php

$SCRIPT_FILENAME=/path/sfindex03.php

Basename=sfindex03.php
===



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98782.html">RE: [PHP] Counting table fields having specific values</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Counting+table+fields+having+specific+values%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Rich+Gray%22&o=newest&f=1">Rich Gray</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Mike

Try ...


Rich
> -Original Message-
> From: rentAweek support [mailto:[EMAIL PROTECTED]
> Sent: 27 February 2003 17:32
> To: [EMAIL PROTECTED]
> Subject: [PHP] Counting table fields having specific values
> 
> 
>   I have a table where the row named "hide" can have a value 0 or 1.
> I want to obtain a count of all the rows where "hide" has value 0.
> 
> The following works on mysqladmin:
> 
> SELECT SUM( hide = 0 ) FROM `names` LIMIT 0, - 1 
> 
> Giving
> 
> SUM( hide = 0 ) 
> 7
> 
> The PHP script statements generated are:
> 
> $sql = 'SELECT SUM( hide = 0 ) FROM `names` LIMIT 0, -1';
> $result = mysql_query($sql);
> 
> What assignment statement do I need to write now to obtain the SUM value 
> as shown by mysqladmin please?
> 
> TIA
> 
> Mike
>  
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98781.html">Re: [PHP] How do I display the script file name?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+How+do+I+display+the+script+file+name%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jason+k+Larson%22&o=newest&f=1">Jason k Larson</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Actually, echo can handle multiple arguments, which it thinks those are.

echo 'foo', "bar", $foobar;	//one example

//echo x3
echo 'foo';
echo "bar";
echo $foobar;
echo 'foo'."bar".$foobar;	//yet another echo example

There are even more complex ways too and, of course, the use of ()s ... 
but I think I've made my point.

HTH,
Jason k Larson
M.A.Bond wrote:
With the output you are getting you will not see the output from the .' '.
As it inserts a space into the ouputted text. There is an error after the
$_SERVER['PHP_SELF'] the , should be a . (is this just a typo in the
e-mail?)
Thanks

Mark

-Original Message-
From: Stephen Ford [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2003 16:47
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How do I display the script file name?

Partial success. The code and output are shown below. There are no errors.

What does the ".' '." do pls. Have tried a variety of combinations to see
the effect. Nothing to see... :-(
===PHP==
Line #1 ".' '.$_SERVER['PHP_SELF'], "";
 echo "Line #2";
 echo "Line #3";
 echo "Line #4 ".' '.$_SERVER['SCRIPT_NAME'].' '.
 $_SERVER['SCRIPT_FILENAME'].' '.
 $_SERVER['PHP_SELF']."";
 echo "Line #5";
 echo "Line #6 ", __FILE__,"";
?>
===IE6 display===
Line #1
Line #2

Line #3

Line #4

Line #5

Line #6 
==
Stephen


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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98780.html">Re: [PHP] Problem wit doing ldap_add and modify in same script</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Problem+wit+doing+ldap_add+and+modify+in+same+script%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Bill+MacAllister%22&o=newest&f=1">Bill MacAllister</a></span>
</div>
<blockquote><span class="msgFragment"><pre>


--On Wednesday, February 26, 2003 06:05:20 PM -0500 Jim Greene 
<[EMAIL PROTECTED]> wrote:

> So you suggest turning the $info into an array...  How would I go
> about using the:

No, I don't suggest "turning the $info into any array".  It already is 
an array.  Quoting from the www.php.net documentation:

  "An array in PHP is actually an ordered map."

So, in PHPese $foo['key'] is an array reference.

What I suggest is that you need to initialize it before you reuse the 
$info name in a different context.

Bill

> $info["objectClass"][0]="posixAccount";
> $info["objectClass"][1]="top";
> In the array ? Thanks :)
>
>
>  On Wed, 2003-02-26 at 17:36, Bill MacAllister wrote:
>> Looks to me like a judiciously place $info = array(); would do
>> wonders.
>>
>> Bill
>>
>> --On Wednesday, February 26, 2003 08:23:39 AM -0500 Jim Greene
>> <[EMAIL PROTECTED]> wrote:
>>
>> > Strange problem: Taking the 2 halfs of the scripts (the section to
>> > update uidNumber and the one to add the user) and combining them
>> > causes an error:
>> > Fatal error: ldap_add() [http://www.php.net/function.ldap-add]:
>> > Unknown attribute in the data in /home/jwgreene/ldap-add.php on
>> > line 68
>> >
>> > Yes doing them as 2 seperate scripts works fine. I did read
>> > something about not being able to do a modify, and add in the same
>> > statment, so I do a ldap_unbind after the completion of the first.
>> > Still does the same thing. Any help would be appreciated.. Thanks
>> >
>> >
>> > > >
>> > // LDAP variables
>> > $ldaphost = "ldap.server";  // your ldap servers
>> > $ldapport = 389; // your ldap server's port number
>> > $ldaprdn  = "cn=Directory Manager"; // ldap rdn or dn
>> > $ldappass = "test123";  // associated password
>> > $dn2="uid=default, ou=Users, dc=megalink, dc=net";
>> >
>> > // Connecting to LDAP
>> > $ldapconn = ldap_connect( $ldaphost, $ldapport )
>> > or die("Could not connect to LDAP server.");
>> >
>> > // connect to ldap server
>> >
>> > if ($ldapconn) {
>> >
>> > // binding to ldap server
>> > $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
>> >
>> > // verify binding
>> > if ($ldapbind) {
>> > echo "LDAP bind successful...\n";
>> > $result=ldap_search($ldapconn,"ou=Users,dc=megalink,dc=net
>> > ", "u id=default");
>> > $info = ldap_get_entries($ldapconn, $result);
>> > $defaultUid = $info[0]["uidnumber"][0];
>> > //print $defaultUid;
>> > //print $info[0]["uidnumber"][0];
>> > $newUid=$defaultUid+1;
>> > print "$newUid\n";
>> > $newinfo["uidNumber"]=$newUid;
>> > ldap_modify($ldapconn,$dn2,$newinfo);
>> > echo "LDAP Modify successful...\n";
>> > ldap_unbind($ldapconn);
>> >
>> > } else {
>> > echo "LDAP bind failed...";
>> > }
>> >
>> > }
>> > //Second half of script *works by itself*
>> > $dn="cn=Directory Manager";
>> > $bindPassword = "test123";
>> > $mySalt = substr(
>> > ereg_replace("[^a-zA-Z0-9./]","",
>> > crypt(rand(1000,), rand(10,99))),
>> > 2, 2);
>> > $password = crypt("test123","$mySalt");
>> >
>> > $info["loginShell"]="/bin/false";
>> > $info["uidNumber"]="1002";
>> > $info["gidNumber"]="100";
>> > $info["objectClass"][0]="posixAccount";
>> > $info["objectClass"][1]="top";
>> > $info["uid"]="test2";
>> > $info["gecos"]="test";
>> > $info["cn"]="test2";
>> > $info["homeDirectory"]="/home/test1";
>> > $info["userPassword"]="{crypt}test123";
>> > if (($ldap = ldap_connect("ldap.server","389"))) {
>> > echo "Bind Good...\n";
>> > }
>> > else {
>> > echo "Connection Failed...\n";
>> > }
>> > if (($res = @ldap_bind($ldap, $dn, $bindPassword))) {
>> > ldap_add($ldap, "uid=test2, ou=Users, dc=megalink, dc=net", $info);
>> > echo "User Added...\n";
>> > }
>> > else {
>> > echo "Addition Failed...\n";
>> > }
>> > ?>
>> >
>> > Jim G
>> >
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>>
>>
>>
>> +
>> | Bill MacAllister
>> | 14219 Auburn Road
>> | Grass Valley, CA 95949
>> | Phone: 530-272-8555
> --
> [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
> PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
> PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@
> Jim Greene
> Unix Systems Administrator / Security Engineer
> Oxford Networks
> www.oxfordnetworks.com
> Dial-Up - Colo - Web Hosting - Bandwidth
> [EMAIL PROTECTED]
>
> "Working with UNIX is like wrestling a worthy
> opponent. Working with Windows is like attacking
> a small whining child who is carrying a .38."
>
> [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
> PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
> PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@
>
>



+---</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98779.html">[PHP] how do I strptime?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+how+do+I+strptime%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Paul+Chvostek%22&o=newest&f=1">Paul Chvostek</a></span>
</div>
<blockquote><span class="msgFragment"><pre>

I currently do this:

$raw="Nov 28 18:26:35 2002";
$when=`date -jf '%a %b %e %T %Y' "$raw" '+%s'`;

when I'd much rather do this:

$raw="Nov 28 18:26:35 2002";
$when=strptime($raw, '%a %b %e %T %Y');

which is of course a non-existent function in PHP.  I'd like to stop
calling a subshell every time I process a date, but I'd also like to
avoid jumping through hoops with mktime.

Is there a better way?

Tnx.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98778.html">Re: [PHP] Counting table fields having specific values</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Counting+table+fields+having+specific+values%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Tim+Ward%22&o=newest&f=1">Tim Ward</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
if ($array = mysql_fetcharray($result))
{echo $array["SUM( hide = 0 )"];
}

although for readability I'd prefer an 
" AS sum_hide " in the query and then use 
$array["sum_hide"]

in general for reading from a mysql result ...

// for a single return row (or the just the first row)
if ($result = mysql_query("..."))
{if ($array = mysql_fetch_array($result))
{...
}
}

// for multiple return rows
if ($result = mysql_query("..."))
{while ($array = mysql_fetch_array($result))
{...
}
}

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message - 
From: rentAweek support <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 5:31 PM
Subject: [PHP] Counting table fields having specific values


>   I have a table where the row named "hide" can have a value 0 or 1.
> I want to obtain a count of all the rows where "hide" has value 0.
> 
> The following works on mysqladmin:
> 
> SELECT SUM( hide = 0 ) FROM `names` LIMIT 0, - 1 
> 
> Giving
> 
> SUM( hide = 0 ) 
> 7
> 
> The PHP script statements generated are:
> 
> $sql = 'SELECT SUM( hide = 0 ) FROM `names` LIMIT 0, -1';
> $result = mysql_query($sql);
> 
> What assignment statement do I need to write now to obtain the SUM value 
> as shown by mysqladmin please?
> 
> TIA
> 
> Mike
>  
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98777.html">RE: [PHP] How do I display the script file name?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+How+do+I+display+the+script+file+name%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22M.A.Bond%22&o=newest&f=1">M.A.Bond</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
With the output you are getting you will not see the output from the .' '.
As it inserts a space into the ouputted text. There is an error after the
$_SERVER['PHP_SELF'] the , should be a . (is this just a typo in the
e-mail?)

Thanks

Mark


-Original Message-
From: Stephen Ford [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2003 16:47
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How do I display the script file name?


Partial success. The code and output are shown below. There are no errors.

What does the ".' '." do pls. Have tried a variety of combinations to see
the effect. Nothing to see... :-(

===PHP==
Line #1 ".' '.$_SERVER['PHP_SELF'], "";
 echo "Line #2";
 echo "Line #3";
 echo "Line #4 ".' '.$_SERVER['SCRIPT_NAME'].' '.
 $_SERVER['SCRIPT_FILENAME'].' '.
 $_SERVER['PHP_SELF']."";
 echo "Line #5";
 echo "Line #6 ", __FILE__,"";
?>

===IE6 display===
Line #1

Line #2

Line #3

Line #4

Line #5

Line #6 
==

Stephen



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


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98776.html">[PHP] Counting table fields having specific values</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+Counting+table+fields+having+specific+values%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22rentAweek+support%22&o=newest&f=1">rentAweek support</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
 I have a table where the row named "hide" can have a value 0 or 1.
I want to obtain a count of all the rows where "hide" has value 0.
The following works on mysqladmin:

SELECT SUM( hide = 0 ) FROM `names` LIMIT 0, - 1 

Giving

SUM( hide = 0 ) 
7

The PHP script statements generated are:

$sql = 'SELECT SUM( hide = 0 ) FROM `names` LIMIT 0, -1';
$result = mysql_query($sql);
What assignment statement do I need to write now to obtain the SUM value 
as shown by mysqladmin please?

TIA

Mike





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

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98775.html">RE: [PHP] Emacs?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Emacs%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22John+W.+Holmes%22&o=newest&f=1">John W. Holmes</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I'm fairly certain we decided not to count you anyhow. ;)

John
 
> Nope. It's 41 (I don't use Emacs)
> 
> At 15:30 27.02.2003, Larry Brown spoke out and said:
> [snip]
> >Oops...I stand corrected.
> >
> >Larry S. Brown
> >Dimension Networks, Inc.
> >(727) 723-8388
> >
> >-Original Message-
> >From: Matt Giddings [mailto:[EMAIL PROTECTED]
> >Sent: Thursday, February 27, 2003 12:26 AM
> >To: 'Larry Brown'; 'PHP List'
> >Subject: RE: [PHP] Emacs?
> >
> >Don't you mean 42?
> >
> >> -Original Message-
> >> From: Larry Brown [mailto:[EMAIL PROTECTED]
> >> Sent: Wednesday, February 26, 2003 7:55 PM
> >> To: PHP List
> >> Subject: RE: [PHP] Emacs?
> >>
> >> 25
> >>
> >> -Original Message-
> >> From: Sascha Braun [mailto:[EMAIL PROTECTED]
> >> Sent: Tuesday, February 25, 2003 12:00 PM
> >> To: PHP General list
> >> Subject: [PHP] Emacs?
> >>
> >> How many Persons in this List are using Emacs as there default
Editor?
> >>
> >
> >---
> >Outgoing mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/2003
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> [snip]
> 
> --
>>O Ernest E. Vogelsinger
>(\) ICQ #13394035
> ^ http://www.vogelsinger.at/
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98774.html">RE: [PHP] form with multiple lines to insert</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+form+with+multiple+lines+to+insert%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22John+W.+Holmes%22&o=newest&f=1">John W. Holmes</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> I'm working on a form that will submit multiple lines of data to a
> database.
> 
> The form's style is that of an order form, where there are lines for
each
> item available, and a single submit button at the foot of the page.
> 
> For example:
> 
> ===
> Item  Quantity
> 
> Apples   |__|
> Oranges |__|
> Bananas |__|
> 
>   |SUBMIT|
> 
> ===
> 
> I will admit I'm new to php programming, and I'm a bit stumped about
how
> to
> get multiple lines from the form to INSERT into the database.

You'll need to do 3 inserts, one after the other. Or, format your insert
such as:

INSERT INTO table (col) VALUES (val1),(val2),(val3);

Which will create 3 rows. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98773.html">RE: [PHP] Re: Mail (), BBC: recipients not receiving my Newsletter</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Re%5C%3A+Mail+%5C%28%5C%29%2C+BBC%5C%3A+recipients+not+receiving+my+Newsletter%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Ricardo+Fitzgerald%22&o=newest&f=1">Ricardo Fitzgerald</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
Hi Manuel,

I've dl your class and read some of your test scripts, but it's not
working at all 
I tested using test_personalized_bulk_mail.php
And I got :'Error: it was not possible to send email message'

Thank you,

Rick

Off Price Closeouts
1700 W 8 Ave
Miami, FL 33010
(305) 888 2555
FAX (305) 884 1761


-Mensaje original-
De: Manuel Lemos [mailto:[EMAIL PROTECTED] 
Enviado el: Wednesday, February 26, 2003 11:35 PM
Para: [EMAIL PROTECTED]
Asunto: [PHP] Re: Mail (), BBC: recipients not receiving my Newsletter

Hello,

On 02/26/2003 07:40 PM, Ricardo Fitzgerald wrote:
> I wrote a small form which dumps data to a php script that uses mail
()
> to send an html newsletter, so far is working except
> that it's not sending to BCC: headers, in my form I have a field to
> enter a comma delimited email list, after submiting the form this list
> is stored under one variable $emaillist, and in my php script I used
> $headers .= "Bcc: ".$emaillist."\r\n";
> 
> then I call 
> 
> mail($to, $subject, $message, $headers);
> 
> I don't receive an error message but my email list is not being sent,
> what I'm doing wrong ?

It sounds like one of those bugs of the mail function but it is hard to 
tell what can it be with so little information.

Anyway, you may want to try this class for composing and sending e-mail 
messages that comes with workaround for many problems of the mail() 
function:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos


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


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98772.html">RE: [PHP] Preventing the "hijacking" of pictures</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+Preventing+the+%5C%22hijacking%5C%22+of+pictures%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22John+W.+Holmes%22&o=newest&f=1">John W. Holmes</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> I recently discovered the reason why the traffic is rising so high on
my
> server. Some people are "stealing" bandwidth. They include
> the link of an image into a forum posting. Now everytime somebody
reads
> this
> threat on the other site this image is
> served by my server!! No one cares about one image, but they become
> dramaticly a lot!
> 
> Is there a reason how to find out that the image is not include into
my
> html
> code, but into the other site code?
> 
> A great idea would be showing a kind of a watermark on this images if
they
> are included inside other websites.
> 
> $_SERVER[HTTP_REFERRER] does not help. But there might be another
method I
> do not know of.
> 
> Thank you for any help and hints on this topic!

The best way to handle this is probably with your web server. There are
some rewrite rules that you can apply to the images/ directory that'll
redirect a request for an image to another image if the request doesn't
come from your site. We used to do this on a site I helped run. If
someone tried to hotlink to one of our images, they got an add for some
rather queer looking male swimsuits... :)

Or, the other option is to implement this in PHP. Store your images
outside of the web root. Serve them all up through a PHP page.



foo.php will make sure that the request is valid by possibly checking a
session value or HTTP_REFERRER. If the request is valid, send the
headers and use readfile() to send the image data. If it's not, send the
data for another image or nothing. 

The downside to this is it's harder to manage and all images requests
will be running through PHP pages.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98771.html">Re: [PHP] How to create an empty array</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+How+to+create+an+empty+array%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Adam+Voigt%22&o=newest&f=1">Adam Voigt</a></span>
</div>
<blockquote><span class="msgFragment"><pre>




$category_list = array();



On Thu, 2003-02-27 at 12:17, Michael Zornek wrote:

I want to create an empty array so I can add elements to it later



I'm currently using:

$catergory_list[] =array();



But when I try to print this list I discover the element zero has the string

"Array" in it. How can I create a truly empty array?



~ Mike

-- 

MikeZornek.com

New blog, new Q&A column, new content everywhere!

http://www.mikezornek.com





-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98770.html">[PHP] How to create an empty array</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+How+to+create+an+empty+array%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Michael+Zornek%22&o=newest&f=1">Michael Zornek</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
I want to create an empty array so I can add elements to it later

I'm currently using:
$catergory_list[] =array();

But when I try to print this list I discover the element zero has the string
"Array" in it. How can I create a truly empty array?

~ Mike
-- 
MikeZornek.com
New blog, new Q&A column, new content everywhere!
http://www.mikezornek.com


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


</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98769.html">Re: [PHP] When is garbage collection initiated?</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22%5C%5BPHP%5C%5D+When+is+garbage+collection+initiated%5C%3F%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22Jason+k+Larson%22&o=newest&f=1">Jason k Larson</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
My understanding is:
- each time a request causes a *session file to be created or accessed*.
--
Jason k Larson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

</pre></span>
</blockquote><br>

<h3><span class=subject><a href="/php-general@lists.php.net/msg98768.html">RE: [PHP] post xml</a></span></h3>
<div class="darkgray font13">
<span class="sender pipe">
<span class=date><a href="/search?l=php-general%40lists.php.net&q=date:20030227&o=newest&f=1">2003-02-27</a></span></span>
<span class="sender pipe">
<span class=thead><a href="/search?l=php-general%40lists.php.net&q=subject:%22RE%5C%3A+%5C%5BPHP%5C%5D+post+xml%22&o=newest&f=1">Thread</a></span></span>
<span class=name><a href="/search?l=php-general%40lists.php.net&q=from:%22John+W.+Holmes%22&o=newest&f=1">John W. Holmes</a></span>
</div>
<blockquote><span class="msgFragment"><pre>
> I am sending an xml request as part of the url using urlencode to
encode
> my
> xml.  It doesnt work like that so the server that is receiving it
doesnt
> seem to like the data in the query string.
> However, if I send it from a form using the method post then it works
> fine.
> Is there a way to send it by method post but without having to use a
form?
> Thank you

Make sure you urlencode() the data before you tack it into the URL.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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


</pre></span>
</blockquote><br>
    <h2>  1   <a href="/search?l=php-general%40lists.php.net&q=date%3A20030227&o=newest&start=100">2</a>   <a href="/search?l=php-general%40lists.php.net&q=date%3A20030227&o=newest&start=100" accesskey="n"> > </a> </h2>
  </div>
  <div class="aside" role="complementary">
    <div class="logo">
      <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a>
    </div>
    <h2> 1 - 100 of 161 matches</h2>
    <br>
    
<ul><li><a href="/search?l=php-general%40lists.php.net&q=date%3A20030227&a=1&o=newest&f=1">Advanced search</a></li></ul>
<form class="overflow" action="/search" method="get">
<input type="hidden" name="l" value="php-general@lists.php.net">
<label class="hidden" for="q">Search the list</label>
<input class="submittext" type="text" id="q" name="q" placeholder="Search php-general" value="date:20030227">
<input class="submitbutton" id="submit" type="image" src="/submit.png" alt="Submit">
</form>

    
    <div class="nav margintop" id="nav" role="navigation">
      <h2 class="hidden">
                               Site Navigation
      </h2>
      <ul class="icons font16">
        <li class="icons-home"><a href="/">The Mail Archive home</a></li>
        <li class="icons-list">
          <a href="/php-general@lists.php.net" title="c" id="c">php-general - all messages</a></li>
        <li class="icons-about">
          <a href="/php-general@lists.php.net/info.html">php-general  - about the list</a></li>
        <li class="icons-expand"><a href="/search?l=php-general%40lists.php.net&q=date%3A20030227&o=newest" title="e" id="e">Expand</a></li>
      </ul>
    </div>

    <div class="listlogo margintopdouble">
      <h2 class="hidden">
  				Mail list logo
      </h2>
      <a href="/php-general@lists.php.net"><img src="/php-general@lists.php.net/logo.png" alt="aims"></a>
    </div>
  </div>
  <div class="footer" role="contentinfo">
    <h2 class="hidden">
	        	      Footer information
    </h2>
    <ul>
      <li><a href="/">The Mail Archive home</a></li>
      <li><a href="/faq.html#newlist">Add your mailing list</a></li>
      <li><a href="/faq.html">FAQ</a></li>
      <li><a href="/faq.html#support">Support</a></li>
      <li><a href="/faq.html#privacy">Privacy</a></li>
    </ul>
  </div>
<script language="javascript" type="text/javascript">
document.onkeydown = NavigateThrough;
function NavigateThrough (event)
{
  if (!document.getElementById) return;
  if (window.event) event = window.event;
  if (event.target.tagName == 'INPUT') return;
  if (event.ctrlKey || event.metaKey) return;
  var link = null;
  switch (event.keyCode ? event.keyCode : event.which ? event.which : null) {
    case 69:
      link = document.getElementById ('e');
      break;
    }
  if (link && link.href) document.location = link.href;
}
</script>
</body>
</html>