php-general Digest 26 Jul 2003 20:56:44 -0000 Issue 2199

Topics (messages 156986 through 157031):

Re: unique id
        156986 by: Tom Rogers
        156999 by: Curt Zirzow

Type safety
        156987 by: Nikhil G. Daddikar
        157000 by: Curt Zirzow

[security] NOT the path of the script in case of error
        156988 by: thierry lhomme

Want to join PHP open source projects, but who wants me?
        156989 by: Pietuka Krustiņš
        157009 by: Chris Shiflett

Which templates to use??
        156990 by: Binay Agarwal
        156997 by: John W. Holmes

Re: funny output
        156991 by: Comex
        156995 by: Ryan A
        156998 by: Curt Zirzow
        157001 by: Ryan A

Re: php5 + php4 on same server
        156992 by: Comex
        156994 by: Alexandru N. Barloiu

mail problem
        156993 by: Paul Marinas
        156996 by: J. Cox
        157024 by: Manuel Lemos

Configure vpopmail with php
        157002 by: Haseeb
        157003 by: Curt Zirzow
        157017 by: Haseeb
        157019 by: Curt Zirzow

XML error: junk after document element
        157004 by: Robert Fitzpatrick

how do I get a remote db connection?
        157005 by: Irvin Amoraal
        157006 by: John W. Holmes
        157007 by: Curt Zirzow

Thanks!
        157008 by: Irvin Amoraal

Re: list admins
        157010 by: Curt Zirzow

Settings problem?
        157011 by: Ryan A
        157014 by: Curt Zirzow

Re: Reading a file from another server
        157012 by: Thomas
        157013 by: CDitty
        157021 by: Curt Zirzow

/n not working
        157015 by: Thomas Hochstetter
        157016 by: John W. Holmes
        157018 by: Curt Zirzow

Re: PHP Email use alternate SMTP
        157020 by: Marek Kilimajer

Re: Are left joins more efficient?
        157022 by: John Hicks

Half solved...............what the @#%# is PHPSESSID?
        157023 by: Ryan A
        157025 by: Marek Kilimajer
        157026 by: Ryan A
        157027 by: John W. Holmes
        157029 by: Ryan A
        157030 by: Jim Lucas

PHP - Flash problem
        157028 by: Thomas

Re: Best way to transfer session IDs
        157031 by: Matthew A. Blasinski

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi,

Saturday, July 26, 2003, 5:58:41 PM, you wrote:
j> Hi there!

j> What's the best way to create uids (unique ids) even when runnig at
j> exactly same time (microseconds)?

j> is this enough ???

j> $r = mt_rand();
j> $uid = uniqid(getmypid() . $r);

j> thanks

j> Jan


I use:

$id = md5(uniqid(rand(),1));

-- 
regards,
Tom


--- End Message ---
--- Begin Message ---
* Thus wrote jan ([EMAIL PROTECTED]):
> Hi there!
> 
> What's the best way to create uids (unique ids) even when runnig at
> exactly same time (microseconds)?
> 
> is this enough ???
> 
> $r = mt_rand();
> $uid = uniqid(getmypid() . $r);

If you're running a cluster of machines I would include information
on the machine that is generating the uid.

$uid = uniqid(getmypid() . $r . '_MACHINE_NAME_');

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message --- We all know PHP is great and flexible but, I have this problem...

I had a function that took an object as parameter, someone went ahead and changed that to accept object's id (integer), because there is no "compilation", some of the code broke. Is there any way to alleviate these kinds of problems that happen w/ scripting?

Thanks.


--- End Message ---
--- Begin Message ---
* Thus wrote Nikhil G. Daddikar ([EMAIL PROTECTED]):
> We all know PHP is great and flexible but, I have this problem...
> 
> I had a function that took an object as parameter, someone went ahead 
> and changed that to accept object's id (integer), because there is no 
> "compilation", some of the code broke. Is there any way to alleviate 
> these kinds of problems that happen w/ scripting?

http://us3.php.net/is_object

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
Hello !

I have a problem with security & found no satisfying solution yet :

at home, when an error occurs in my script I got something like this :

Warning: unlink() failed (No such file or directory) in c:\program
files\easyphp\www\page_perso_free\php_scripts\ultra_php.php on line 356
"texte.txt" n'est pas supprimé...

but my provider in the same case delivers this :

Warning: unlink() failed (No such file or directory) in ultra_php.php on
line 347
"texte.txt" n'est pas supprimé...

that's much better !!

My question is : How do they do that ??

My provider runs PHP 4.2.2


Thanx a lot !!


ps. to this :

<?php echo $_SERVER [SERVER_SOFTWARE] ?>

my provider returns :

Apache/1.3.26 (Unix) Debian GNU/Linux mod_fastcgi/2.2.12 mod_perl/1.26

pps. sorry if I have not sent this message the right way (and for my poor
english too)...


--- End Message ---
--- Begin Message ---
Hello
I've been googling for last couple of hours looking for an open source project 
to join but whether i find inactive ones or some that are not welcoming new 
coders. I would like to join an OO project, that is not quite well developed 
so far, but looks promising. Could you suggest any?

-- 
Best regards,
Pietuka







---
This message contains no viruses. 
Guaranteed by Kaspersky Anti-Virus.
www.antivirus.lv


--- End Message ---
--- Begin Message ---
--- Pietuka Krustiņš <[EMAIL PROTECTED]> wrote:
> I would like to join an OO project, that is not quite well
> developed so far, but looks promising. Could you suggest any?

Check out SourceForge (http://sf.net/). There are thousands of open source
projects hosted there, and there is a help wanted section where project
managers can request aid.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--- End Message ---
--- Begin Message ---
Hi all!

        As a php developer i need to know how can i separate my "business logic tier" 
with "presentation". I mean wht all different kinds of php Templates are available and 
which one to go for better efficiency and speed? Where can i find the resources. 
Please help me out.

Thanks in advance

Binay

--- End Message ---
--- Begin Message --- Binay Agarwal wrote:

Hi all!

As a php developer i need to know how can i separate my "business logic tier" with "presentation". I mean wht all different kinds of php Templates are available and which one to go for better efficiency and speed? Where can i find the resources. Please help me out.


Basic: Include files Medium: Template Engine (Smarty, patTemplate, etc) Advanced: Some kind of XML / XSL(T) solution

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message --- Chris Shiflett wrote:
--- Ryan A <[EMAIL PROTECTED]> wrote:

So how do i get my scripts working again? the authentication part
was working perfectly but now it just kicks me back to the login
page...

plus it looks like I am unable to set sessions properly, and i
suspect thats why i am getting kicked back to the login page.


You're probably right.

This is a wild guess, but I bet register_globals is disabled on your new host.
Check the archives for lots of good information about what this means, what you
need to do, etc. This question comes up weekly, so there should be plenty of
information.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
It's actually ENabled, from the link that he sent us.


--- End Message ---
--- Begin Message ---
Hi,
The first thing I checked was register_globals.....they are on.
(http://www.bestwebhosters.com/phpinfo.php)

Any other ideas/suggestions?

Please help as I am hitting a total blank trying to find out where the
problem is.

Thanks,
-Ryan

----- Original Message -----
From: "Comex" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 8:22 AM
Subject: Re: [PHP] funny output


> Chris Shiflett wrote:
> > --- Ryan A <[EMAIL PROTECTED]> wrote:
> >
> >>So how do i get my scripts working again? the authentication part
> >>was working perfectly but now it just kicks me back to the login
> >>page...
> >>
> >>plus it looks like I am unable to set sessions properly, and i
> >>suspect thats why i am getting kicked back to the login page.
> >
> >
> > You're probably right.
> >
> > This is a wild guess, but I bet register_globals is disabled on your new
host.
> > Check the archives for lots of good information about what this means,
what you
> > need to do, etc. This question comes up weekly, so there should be
plenty of
> > information.
> >
> > Hope that helps.
> >
> > Chris
> >
> > =====
> > Become a better Web developer with the HTTP Developer's Handbook
> > http://httphandbook.org/
> It's actually ENabled, from the link that he sent us.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
* Thus wrote Ryan A ([EMAIL PROTECTED]):
> Hi everyone,
> I am having some funny output and funny things happening to my scripts since
> I changed hosts...
> my login scripts were working fine before but now they dont seem to
> work...also there is a hidden text box appearing in the
> code that i didnt write...this is it:
> <input type="hidden" name="PHPSESSID"
> value="ad2e5a31727b2b4eb28b2d0c2d6ee67e" />

The login script is looking in the $_POST var correct?
 

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
Hi,
thanks for replying.
No, its looking for get, and globals is on.
This is my code:
*****************Start code*****************
<?
session_start();
header("Cache-control: private"); //IE 6 Fix
require_once("configbwh.php");

$type=$_GET[type];
$_SESSION['type'] = $type;

if(!isset($type))
{
include("my.top.php");
 print("ERROR: 69723. Please contact support");
 include("my.bottom.php");
 exit;
}

if(session_is_registered('my_user')){}
 else{
   $_SESSION['id'] = $id;
   header("Location: my.login.php");
   exit;
  }



$result = count ($id);
if($result<1 || $result>5)
{include("my.top.php");
Print("Error: Plans not saved.<br>You have not either not chosen a plan to
add to your MyList account <br>or you have tried to add more than 5 plans at
a time to your MyList account.<br>Please press your back button to correct
the problem.");
 include("my.bottom.php");
exit;
}

$connected=mysql_connect ("$hostt", "$userr", "$passs") or die ('I cannot
connect to the database because: ' . mysql_error());
mysql_select_db ("$db");


$my_user=$_SESSION['my_user'];
$my_ccno=$_SESSION['my_ccno'];


/* the below lines take the string (nname) from between the [] of the id[]
and the the value of the id[] (eg id[]=23 where 23 is the value) then
inserts it into the db thanks to John Holmes.
*/
foreach($id as $nname => $pppno)
{
$q="insert into mylist_slave
values('','$pppno','$nname','$type','$my_user',$my_ccno)";
  if(!($rs = mysql_query($q)))
  { echo "Query failed for ID: $r"; exit; }
}

   include("my.top.php");
   print("Data has been successfully entered.");
   include("my.bottom.php");
   exit;

?>

****************End Code*************

This was working fine....I just cant understand it.

Kindly reply,
-Ryan.



----- Original Message -----
From: "Curt Zirzow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 4:05 PM
Subject: Re: [PHP] funny output


> * Thus wrote Ryan A ([EMAIL PROTECTED]):
> > Hi everyone,
> > I am having some funny output and funny things happening to my scripts
since
> > I changed hosts...
> > my login scripts were working fine before but now they dont seem to
> > work...also there is a hidden text box appearing in the
> > code that i didnt write...this is it:
> > <input type="hidden" name="PHPSESSID"
> > value="ad2e5a31727b2b4eb28b2d0c2d6ee67e" />
>
> The login script is looking in the $_POST var correct?
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message --- Volker wrote:
hi,

you also could run two static compiled versions of apache (if apache) with
php4 and 5 compiled in,
Possible...
but you need another ip-address to bind to
No, you can run them both on the same IP address... that's what he wanted.
- also
have to manage 2 apaches....(not a problem or what? ;-)


--- End Message ---
--- Begin Message ---
Two different types of apache & php on the same mashine is possible. I
used to do that when I used both apache-2 & apache-1. The thing I did is
that I used different ports, one ot them default 80 and the other 8000
for example.

On Sat, 2003-07-26 at 09:24, Comex wrote:
> Volker wrote:
> > hi,
> > 
> > you also could run two static compiled versions of apache (if apache) with
> > php4 and 5 compiled in, 
> Possible...
> > but you need another ip-address to bind to
> No, you can run them both on the same IP address... that's what he wanted.
> > - also
> > have to manage 2 apaches....(not a problem or what? ;-)
> 


--- End Message ---
--- Begin Message ---
Hi, i have to send some e-mails with pictures, in html format, i was
wondering if anyone knows where to find a php class that dose this.

Thanks, Paul

--- End Message ---
--- Begin Message ---
"Paul Marinas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hi, i have to send some e-mails with pictures, in html format, i was
> wondering if anyone knows where to find a php class that dose this.

http://phpmailer.sourceforge.net/ should do the trick.

J. Cox
http://www.xaraya.com




--- End Message ---
--- Begin Message --- Hello,

On 07/26/2003 09:35 AM, Paul Marinas wrote:
Hi, i have to send some e-mails with pictures, in html format, i was
wondering if anyone knows where to find a php class that dose this.

You may want to try using this class that does exactly what you need and more. It lets you compose HTML messages, eventually with text version alternative in the same body to prevent that it gets trapped in spam filters, and lets you include any number of picture files either embedded in the message HTML part or as attachments.


http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/


--- End Message ---
--- Begin Message ---
how can i configure php with vpopmail on linux 7.3
 
please reply ASAP
 
Haseeb.
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

--- End Message ---
--- Begin Message ---
* Thus wrote Haseeb ([EMAIL PROTECTED]):
> how can i configure php with vpopmail on linux 7.3
> 
> please reply ASAP

RTFM

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
 
the detail in not enough in the FM :)
Haseeb
 
 
 
-------Original Message-------
 
Date: Saturday, July 26, 2003 09:48:19 PM
Subject: Re: [PHP] Configure vpopmail with php
 
* Thus wrote Haseeb ([EMAIL PROTECTED]):
> how can i configure php with vpopmail on linux 7.3
>
> please reply ASAP
 
RTFM
 
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

--- End Message ---
--- Begin Message ---
* Thus wrote Haseeb ([EMAIL PROTECTED]):
>  
> the detail in not enough in the FM :)
> Haseeb

Just curious how this line isn't enough:

In PHP 4, these functions are only available if PHP was configured
with --with-vpopmail[=DIR]. 

HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
I am trying to parse and xml document:

<?xml version="1.0"?>
<!DOCTYPE PrequalResponse PUBLIC "-//New Edge Networks//DTD Pilot
Prequalification Response 2.3//EN"
"http://api.newedgenetworks.com/dtd/prequalresponse.dtd";>
<PrequalResponse>
 <TransactionCode><Code>1005</Code><Message>Authentication failed: Invalid
user name or password</Message></TransactionCode>
</PrequalResponse>

I received 'XML error: junk after document element at line 5'. I found some
mention searching the web that the xml_parse() function does not know the
end of the stream:

The problem is that, in the general case, there's no way to
determine if a stream is *supposed* to contain multiple documents.
What is needed is some external way to determine the end of the input;
you can then feed the parser data buffers until the end-of-buffer
function returns true.  You can do this by embedding the chunks of XML
into another protocol; this should not be difficult if you can
determine the size of each XML document in bytes before sending it, so
that each document can be preceeded by the byte-count.  Otherwise,
you'll need a stream encoding that contains explicit end-of-file
markers.

I can set my passing xml document with just '<trythis>1</trythis>' and I get
the same error, except of course it says line 1 instead of line 5.

Any help on how I can be sure the function knows the end of ?

--
Robert



--- End Message ---
--- Begin Message ---
I have two independent websites, both with their own mySQL db's. I would
like to run a query in site A against site B's database. I am trying to
establish a connection using something like:
 $conn = mysql_connect("abc.com:3306", $user, $pass);

A warning is returned to the browser :
Access denied for user: '[EMAIL PROTECTED]' where my_web_host.net is the
name of the host server.

The db's name would be abc_com (This is not the actual name but the form is
consistent with the real db name).

If I try port 3307 I get "Can't connect to MySQL server on 'abc.com'(111),
so I assume that I am able to communicate with the msSQL server itself, but
is a permissions issue. I know that the username and password are correct.

Could it be that remote acccess to the db is disabled? Or am I omitting
something?

Your help is appreciated.

Irvin Amoraal.



--- End Message ---
--- Begin Message --- Irvin Amoraal wrote:

I have two independent websites, both with their own mySQL db's. I would
like to run a query in site A against site B's database. I am trying to
establish a connection using something like:
 $conn = mysql_connect("abc.com:3306", $user, $pass);

A warning is returned to the browser :
Access denied for user: '[EMAIL PROTECTED]' where my_web_host.net is the
name of the host server.

The db's name would be abc_com (This is not the actual name but the form is
consistent with the real db name).

If I try port 3307 I get "Can't connect to MySQL server on 'abc.com'(111),
so I assume that I am able to communicate with the msSQL server itself, but
is a permissions issue. I know that the username and password are correct.

Could it be that remote acccess to the db is disabled? Or am I omitting
something?

Yes, more than likely. You need permission within the grant tables for Site A to connect to it from host Site B.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message ---
* Thus wrote Irvin Amoraal ([EMAIL PROTECTED]):
> I have two independent websites, both with their own mySQL db's. I would
> like to run a query in site A against site B's database. I am trying to
> establish a connection using something like:
>  $conn = mysql_connect("abc.com:3306", $user, $pass);
> 
> A warning is returned to the browser :
> Access denied for user: '[EMAIL PROTECTED]' where my_web_host.net is the
> name of the host server.
> 
> The db's name would be abc_com (This is not the actual name but the form is
> consistent with the real db name).
> 
> If I try port 3307 I get "Can't connect to MySQL server on 'abc.com'(111),
> so I assume that I am able to communicate with the msSQL server itself, but
> is a permissions issue. I know that the username and password are correct.

Correct.

> 
> Could it be that remote acccess to the db is disabled? Or am I omitting
> something?

Yes, the remote host doesn't allow connection from the host you are
conecting to. You'll need to add permissions on B's database for
host A.

HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
Thanks to both John and Curt who gave me the same answer ... and it actully
makes sense. Don't know why I didn't think of it myslef <g>.

Irvin.

"Irvin Amoraal" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have two independent websites, both with their own mySQL db's. I would
> like to run a query in site A against site B's database. I am trying to
> establish a connection using something like:
>  $conn = mysql_connect("abc.com:3306", $user, $pass);
>
> A warning is returned to the browser :
> Access denied for user: '[EMAIL PROTECTED]' where my_web_host.net is the
> name of the host server.
>
> The db's name would be abc_com (This is not the actual name but the form
is
> consistent with the real db name).
>
> If I try port 3307 I get "Can't connect to MySQL server on 'abc.com'(111),
> so I assume that I am able to communicate with the msSQL server itself,
but
> is a permissions issue. I know that the username and password are correct.
>
> Could it be that remote acccess to the db is disabled? Or am I omitting
> something?
>
> Your help is appreciated.
>
> Irvin Amoraal.
>
>



--- End Message ---
--- Begin Message ---
It seems every time I post to the list now I keep getting bounced
message back from someone on the list:

To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED])

Will he get unsubed automatically or do you have to initiate the
change?

If its the latter please do so ASAP..

Thanks Mucho!

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
Hi,
below is my script which was working fine before and i have looked at the
code for the past 2 hours but still get this error:
"Parse error: parse error, unexpected $end in
c:\phpdev\www\bwh\project\my.details.php on line 84"

I am on localhost, win2k machine,PHP Version 4.3.1.

As you can see below it really a pretty simple script and line 84 is the
last line AFTER php terminates, Please help.
heres my code:
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
require_once("configbwh.php");
error_reporting (E_ALL);

if(isset($_SESSION['my_user']) && isset($_SESSION['my_ccno']))
{
$mmy_user=$_SESSION['my_user'];
$mmy_ccno=$_SESSION['my_ccno'];


$connected=mysql_connect ("$hostt", "$userr", "$passs") or die ('I
cannot
connect to the database because: ' . mysql_error());
mysql_select_db ("$db");

$tt = "SELECT ptype, count(*) FROM list_slave WHERE ptype IN ('1', '2',
'3','4','5')  and userr='".$mmy_user."' and ccno='".$mmy_ccno."' GROUP BY
ptype";

if($res = mysql_query($tt))
{

  $x = 1;
  while($row = mysql_fetch_row($res))
  { $var[$x++] = $row[1]; }

}
include("my.top.php");

if (isset($var[1])){ $one = $var[1];} else {$one = 0;}
if (isset($var[2])){ $two = $var[2];} else {$two = 0;}
if (isset($var[3])){ $thr = $var[3];} else {$thr = 0;}
if (isset($var[4])){ $fou = $var[4];} else {$fou = 0;}
if (isset($var[5])){ $fiv = $var[5];} else {$fiv = 0;}
$tot=$one + $two + $thr + $fou + $fiv;
?>
<p> <b>W</b>elcome, this is your "MyList" control panel.<br>
  You may add/save all your favourite plans here for later comparision.<br>
  You can add upto 5 plans at a time and edit, delete them as and when you
so
  wish.<br>
</p>
<table width="40%" border="0" align="center" cellpadding="0"
cellspacing="0">
 <tr>
    <td colspan="2" NOWRAP><div align="center"><font color=red><b>Your
current list of saved plans are:</div></font></b></td>
  </tr>
 <tr>
    <td width="24%"><strong>S</strong>hared:</td>
    <td width="38%"><?php echo $one; ?></td>
  </tr>
  <tr>
    <td><strong>D</strong>edicated:</td>
    <td><?php echo $two; ?></td>
  </tr>
  <tr>
    <td><strong>R</strong>eseller</td>
    <td><?php echo $thr; ?></td>
  </tr>
  <tr>
    <td><strong>C</strong>oLocation:</td>
    <td><?php echo $fou; ?></td>
  </tr>
  <tr>
    <td nowrap><strong>F</strong>reeHosting:</td>
    <td><?php echo $fiv; ?></td>
  </tr>
  <tr>
    <td colspan=2><strong>You have totally <font color=red><?php echo $tot;
?></font> plans saved. </strong></td>

  </tr>
</table>
<p><br>
  If you have any questions use the "contact us" link at the side and we
will
  get back to you ASAP.<br>
  <br>
  Cheers,<br>
  -The BWH team.<br>
</p>


<?php
include("my.bottom.php");
?>
// This is line 84


What do you think is there problem? some settings in php.ini or something?

Cheers,
-Ryan


--- End Message ---
--- Begin Message ---
* Thus wrote Ryan A ([EMAIL PROTECTED]):
> [...]
> if(isset($_SESSION['my_user']) && isset($_SESSION['my_ccno']))
> {
  ^~~~ this never gets closed.


I love vi and '%',  has prevented headaches like this so meny times...

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
I know the url is good, cause I can go on to this domain and look at all my
files.

I guess I should explain a little further...

This server is a game server for Counter-Strike.   I'm trying to read a file
on there called "mapcycle.txt".
This server is a secure server, so I would need to use a username and
password to get on.  I
I've tried a bunch of different things, and now I find that it has a problem
connecting to secure servers.

DO you know of a different way to connect to a secure server anhd get
information other than the way I have been trying?

This is what I'm usuing right now:

<?php
    $prefix = "ftp://";;
    $username = "myUsername";
    $password = "**********";
    $url = "server.username.gameserver.com/";
    $filename = "test.txt";

    $result = readfile($prefix . $username . ":" . $password . "@" . $url .
$filename);
    print ($result);
?>

// OUTPUT
0


if I use anythign other than the ftp:// for a prefix (like http. or https) I
get an error.

Cheers.

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> --- Thomas <[EMAIL PROTECTED]> wrote:
> > readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
> >
> > It doesn't have any errors and comes up blank.
> >
> > If I put:
> >
> > $result =
> > readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
> > print ($result);
> >
> > it ends up showing a '0'  by iteself.
>
> The readfile() functions outputs the contents of the file and returns the
size
> of the file in bytes. So, when you assigned $result to the return value,
you
> demonstrated that readfile() output 0 bytes (which explains why you didn't
see
> anything).
>
> I'm pretty sure your php.ini is set to allow this, otherwise you would
receive
> an error. I'm doubting whether that URL actually contains any content. How
have
> you tested to be sure it does?
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/



--- End Message ---
--- Begin Message --- Have you tried downloading the file to your server and then read it from there? I do this at least 15 times a day with several different sites and I rarely have any problems.

CDitty

At 11:28 AM 7/26/2003, Thomas wrote:
I know the url is good, cause I can go on to this domain and look at all my
files.

I guess I should explain a little further...

This server is a game server for Counter-Strike.   I'm trying to read a file
on there called "mapcycle.txt".
This server is a secure server, so I would need to use a username and
password to get on.  I
I've tried a bunch of different things, and now I find that it has a problem
connecting to secure servers.

DO you know of a different way to connect to a secure server anhd get
information other than the way I have been trying?

This is what I'm usuing right now:

<?php
    $prefix = "ftp://";;
    $username = "myUsername";
    $password = "**********";
    $url = "server.username.gameserver.com/";
    $filename = "test.txt";

    $result = readfile($prefix . $username . ":" . $password . "@" . $url .
$filename);
    print ($result);
?>

// OUTPUT
0


if I use anythign other than the ftp:// for a prefix (like http. or https) I get an error.

Cheers.

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> --- Thomas <[EMAIL PROTECTED]> wrote:
> > readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
> >
> > It doesn't have any errors and comes up blank.
> >
> > If I put:
> >
> > $result =
> > readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
> > print ($result);
> >
> > it ends up showing a '0'  by iteself.
>
> The readfile() functions outputs the contents of the file and returns the
size
> of the file in bytes. So, when you assigned $result to the return value,
you
> demonstrated that readfile() output 0 bytes (which explains why you didn't
see
> anything).
>
> I'm pretty sure your php.ini is set to allow this, otherwise you would
receive
> an error. I'm doubting whether that URL actually contains any content. How
have
> you tested to be sure it does?
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/



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


--- End Message ---
--- Begin Message ---
* Thus wrote Thomas ([EMAIL PROTECTED]):
> I know the url is good, cause I can go on to this domain and look at all my
> files.
> 
> I guess I should explain a little further...
> 
> This server is a game server for Counter-Strike.   I'm trying to read a file
> on there called "mapcycle.txt".
> This server is a secure server, so I would need to use a username and
> password to get on.  I
> I've tried a bunch of different things, and now I find that it has a problem
> connecting to secure servers.
> 
> DO you know of a different way to connect to a secure server anhd get
> information other than the way I have been trying?

I wouldn't use the term 'secure', rather password protected. A
plain text username and password is far from being secure.

> 
> This is what I'm usuing right now:
> 
> <?php
>     $prefix = "ftp://";;
>     $username = "myUsername";
>     $password = "**********";
>     $url = "server.username.gameserver.com/";
>     $filename = "test.txt";
> 
>     $result = readfile($prefix . $username . ":" . $password . "@" . $url .
> $filename);
>     print ($result);
> ?>
> 
> // OUTPUT
> 0

This can be expected output pending a few settings from a phpinfo
result:
  error_reporting:
  safe_mode:
  allow_url_fopen:

> 
> 
> if I use anythign other than the ftp:// for a prefix (like http. or https) I
> get an error.

what are the errors?


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
Hi there.

I got a question from someone why the following (from the manual) will not
bring the desired output:

<?php

/* if I open the following txt file and in explorer*/


$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap($text, 20);

echo "$newtext\n";



/*my output is the following

The quick brown fox jumped over the lazy dog.

*/


/*this should however have the following output according to the php manual

The quick brown fox
jumped over the
lazy dog.

*/
?>

Is this a php.ini setting?

Thomas


-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!


--- End Message ---
--- Begin Message --- Thomas Hochstetter wrote:

Hi there.

I got a question from someone why the following (from the manual) will not
bring the desired output:

<?php

/* if I open the following txt file and in explorer*/


$text = "The quick brown fox jumped over the lazy dog."; $newtext = wordwrap($text, 20);

echo "$newtext\n";



/*my output is the following

The quick brown fox jumped over the lazy dog.

*/


/*this should however have the following output according to the php manual


The quick brown fox
jumped over the
lazy dog.

*/
?>

Is this a php.ini setting?

HTML does not render newlines. You need to use <br />. View the source of this code in your browser and you'll see everything is on it's own line.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message ---
* Thus wrote John W. Holmes ([EMAIL PROTECTED]):
> Thomas Hochstetter wrote:
> >
> >$text = "The quick brown fox jumped over the lazy dog.";
> >$newtext = wordwrap($text, 20);
> >
> >echo "$newtext\n";
> > [...]
>
> HTML does not render newlines. You need to use <br />. View the source 
> of this code in your browser and you'll see everything is on it's own line.
> 

Yes the documentation is a little misleading. I'm in the process of
getting that changed in the documentation.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message --- www.phpclasses.org/mimemessage

it contains a class that can send directly to SMTP server

Tom Vogel wrote:
Hi, i'm trying to set up an email form on my website. When I originally ran
the server from windows I could simply set SMTP = mailhost.ucalgary.ca and
it would work. After moving the server to Mac OS X, I can't get it to work.

I've read a bunch of FAQ's but they all seem to insist that I set up my own
mail server using sendmail. All I need to do is send however, and I would
prefer to do that through the network mail servers.

It looks like sendmail sends out to 0.0.0.0 looking for an smtp server, but
on the bio.ucalgary.ca domain that I am on, there is no mail server.

Getting to the point (pardon my deranged yabbering...), all I need to do is
send messages through mailhost.ucalgary.ca from my server
groningen.bio.ucalgary.ca under OS X.2.

Thanks





--- End Message ---
--- Begin Message ---
Dennis--

You might get a more authoritative answer from the mysql 
"general discussion" list at: 
http://lists.mysql.com

--John

On Monday 25 August 2003 12:59 pm, [EMAIL PROTECTED] 
wrote:
> Hello,
>
> I program for a website that gets massive loads of
> traffic. Optimisation has become an important issue
> lately.
>
> At the moment, all queries on the website follow the same
> format when joining tables:
> SELECT * FROM table1,table2 WHERE table1.id=table2.id;
>
> My question is, would this format be more efficient?
> SELECT * FROM table1 LEFT JOIN table2 ON
> table1.id=table2.id;
>
> Over the last couple of years I have read and heard two
> different answers. Years ago it was said that doing Left
> Joins are faster and more efficient. But with recent
> updates to MySQL I have read that both queries are broken
> down and optimised the same way by MySQL.
>
> Any thoughts? I havn't come across any comparisons on the
> web, so any answers would be appreciated.
>
> (couldn't find any mysql specific groups so i'm posting
> in the next best thing!)
>
> Thanks
>
> -Dennis

--- End Message ---
--- Begin Message ---
Hi,
Ok, have half solved why my scripts all of a sudden stopped working.

This is how my scripts are setup:
There is a form(login.php) where the user puts in his user/pass, then this
is authenticated(auth.php) by the database and a few other sessions are
created (email,cust_number) and also username,password sessions are created.
Then i am using a header("Location....") to send it to details.php,
details.php will check and make sure that the following sessions have been
created username,password,email,cust_number, if any are not valid it will
kick ther person back to login.php...this was working before but not now.

I went to my forms source and checked where it was sending my submitted form
and found a hidden text box there with this data:
<input type="hidden" name="PHPSESSID"
value="46081aa70da693f5edeecc069ed8a627" />

so i took that "PHPSESSID" and its value and added it to my
header("Location....") like so:
header("Location:details.php?PHPSESSID=46081aa70da693f5edeecc069ed8a627")

and every damn thing is working again...

can ANYBODY please tell me what the @#%# is that PHPSESSID, how it got into
my login page and how do i work with it?
because now I have manually put it in my file, do i need to always put it?
how do i get it as a variable and finally how can i take it out of my
computer and jump on it for causing me 5 hours of pain and suffering.any
ways of killing it slowly too is appreciated.

Even if you cant answer the first questions the last two will do, the
[EMAIL PROTECTED]@#%@ [EMAIL PROTECTED]@# PHPSESSID....

Thanks in advance,
-Ryan


                                                  -- No, I dont just sound
crazy....I AM crazy. --


--- End Message ---
--- Begin Message --- You have cookies disabled and session.use_trans_sid is enabled in php.ini. So the session module parses your html output and adds PHPSESSID to all internal links, forms and everything else that is needed. However it does not add session id to Location header, it is your responsibility. Use header('Location: details.php?'.SID); SID is a magic constant that contains '&'.session_name().'='.session_id() (thus you need ? after details.php).

PHPSESSID is here so session module knows which session file to use. If you look into your /tmp (or whatever is set up) directory, a file named sess_46081aa70da693f5edeecc069ed8a627 will be sitting there with all session variables.

Ryan A wrote:

Hi,
Ok, have half solved why my scripts all of a sudden stopped working.

This is how my scripts are setup:
There is a form(login.php) where the user puts in his user/pass, then this
is authenticated(auth.php) by the database and a few other sessions are
created (email,cust_number) and also username,password sessions are created.
Then i am using a header("Location....") to send it to details.php,
details.php will check and make sure that the following sessions have been
created username,password,email,cust_number, if any are not valid it will
kick ther person back to login.php...this was working before but not now.

I went to my forms source and checked where it was sending my submitted form
and found a hidden text box there with this data:
<input type="hidden" name="PHPSESSID"
value="46081aa70da693f5edeecc069ed8a627" />

so i took that "PHPSESSID" and its value and added it to my
header("Location....") like so:
header("Location:details.php?PHPSESSID=46081aa70da693f5edeecc069ed8a627")

and every damn thing is working again...

can ANYBODY please tell me what the @#%# is that PHPSESSID, how it got into
my login page and how do i work with it?
because now I have manually put it in my file, do i need to always put it?
how do i get it as a variable and finally how can i take it out of my
computer and jump on it for causing me 5 hours of pain and suffering.any
ways of killing it slowly too is appreciated.

Even if you cant answer the first questions the last two will do, the
[EMAIL PROTECTED]@#%@ [EMAIL PROTECTED]@# PHPSESSID....

Thanks in advance,
-Ryan


-- No, I dont just sound crazy....I AM crazy. --




--- End Message ---
--- Begin Message ---
Hey,
Thanks for replying.

I know you can manipulate the php.ini file via htaccess or by putting some
instructions in the include file...is there any way to turn on cookies again
and turn off session.use_trans_sid so i can go back to the old way it was?
because I have a lot of header("location:....") statements in a lot of
files.
This just seems a giant PITA.

Cheers,
-Ryan



> You have cookies disabled and session.use_trans_sid is enabled in
> php.ini. So the session module parses your html output and adds
> PHPSESSID to all internal links, forms and everything else that is
> needed. However it does not add session id to Location header, it is
> your responsibility. Use header('Location: details.php?'.SID); SID is a
> magic constant that contains '&'.session_name().'='.session_id() (thus
> you need ? after details.php).
>
> PHPSESSID is here so session module knows which session file to use. If
> you look into your /tmp (or whatever is set up) directory, a file named
> sess_46081aa70da693f5edeecc069ed8a627 will be sitting there with all
> session variables.
>
> Ryan A wrote:
>
> > Hi,
> > Ok, have half solved why my scripts all of a sudden stopped working.
> >
> > This is how my scripts are setup:
> > There is a form(login.php) where the user puts in his user/pass, then
this
> > is authenticated(auth.php) by the database and a few other sessions are
> > created (email,cust_number) and also username,password sessions are
created.
> > Then i am using a header("Location....") to send it to details.php,
> > details.php will check and make sure that the following sessions have
been
> > created username,password,email,cust_number, if any are not valid it
will
> > kick ther person back to login.php...this was working before but not
now.
> >
> > I went to my forms source and checked where it was sending my submitted
form
> > and found a hidden text box there with this data:
> > <input type="hidden" name="PHPSESSID"
> > value="46081aa70da693f5edeecc069ed8a627" />
> >
> > so i took that "PHPSESSID" and its value and added it to my
> > header("Location....") like so:
> >
header("Location:details.php?PHPSESSID=46081aa70da693f5edeecc069ed8a627")
> >
> > and every damn thing is working again...
> >
> > can ANYBODY please tell me what the @#%# is that PHPSESSID, how it got
into
> > my login page and how do i work with it?
> > because now I have manually put it in my file, do i need to always put
it?
> > how do i get it as a variable and finally how can i take it out of my
> > computer and jump on it for causing me 5 hours of pain and suffering.any
> > ways of killing it slowly too is appreciated.
> >
> > Even if you cant answer the first questions the last two will do, the
> > [EMAIL PROTECTED]@#%@ [EMAIL PROTECTED]@# PHPSESSID....
> >
> > Thanks in advance,
> > -Ryan
> >
> >
> >                                                   -- No, I dont just
sound
> > crazy....I AM crazy. --
> >
> >
>


--- End Message ---
--- Begin Message --- Ryan A wrote:

I know you can manipulate the php.ini file via htaccess or by putting some
instructions in the include file...is there any way to turn on cookies again
and turn off session.use_trans_sid so i can go back to the old way it was?
because I have a lot of header("location:....") statements in a lot of
files.

Your browser is not accepting the cookies... Or, your session module has been told not to use cookies. To enable cookies for the session module, use:


php.ini:
session.use_cookies = 1

.htaccess:
php_value session.use_cookies 1

If the value is already 1 or ON, then it's your browser causing the trouble.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message ---
Hey John,
I dont think its the browser because I have tried this with opera 6,opera 7,
IE and NN with the same results...
But when i checked the phpinfo() it says that cookies are enabled....Do you
think its worth it to search and replace each Location header with .SID?

Thanks,
-Ryan



----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Ryan A" <[EMAIL PROTECTED]>
Cc: "Marek Kilimajer" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 9:15 PM
Subject: Re: [PHP] Half solved...............what the @#%# is PHPSESSID?


> Ryan A wrote:
>
> > I know you can manipulate the php.ini file via htaccess or by putting
some
> > instructions in the include file...is there any way to turn on cookies
again
> > and turn off session.use_trans_sid so i can go back to the old way it
was?
> > because I have a lot of header("location:....") statements in a lot of
> > files.
>
> Your browser is not accepting the cookies... Or, your session module has
> been told not to use cookies. To enable cookies for the session module,
use:
>
> php.ini:
> session.use_cookies = 1
>
> .htaccess:
> php_value session.use_cookies 1
>
> If the value is already 1 or ON, then it's your browser causing the
> trouble.
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com
>
>
>
>


--- End Message ---
--- Begin Message ---
Personally, I would do a search-and-replace for header() and replace it with
your own custom header() function.

Then you would only have to change one location.

Jim Lucas
----- Original Message -----
From: "Ryan A" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 1:16 PM
Subject: Re: [PHP] Half solved...............what the @#%# is PHPSESSID?


> Hey John,
> I dont think its the browser because I have tried this with opera 6,opera
7,
> IE and NN with the same results...
> But when i checked the phpinfo() it says that cookies are enabled....Do
you
> think its worth it to search and replace each Location header with .SID?
>
> Thanks,
> -Ryan
>
>
>
> ----- Original Message -----
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> To: "Ryan A" <[EMAIL PROTECTED]>
> Cc: "Marek Kilimajer" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, July 26, 2003 9:15 PM
> Subject: Re: [PHP] Half solved...............what the @#%# is PHPSESSID?
>
>
> > Ryan A wrote:
> >
> > > I know you can manipulate the php.ini file via htaccess or by putting
> some
> > > instructions in the include file...is there any way to turn on cookies
> again
> > > and turn off session.use_trans_sid so i can go back to the old way it
> was?
> > > because I have a lot of header("location:....") statements in a lot of
> > > files.
> >
> > Your browser is not accepting the cookies... Or, your session module has
> > been told not to use cookies. To enable cookies for the session module,
> use:
> >
> > php.ini:
> > session.use_cookies = 1
> >
> > .htaccess:
> > php_value session.use_cookies 1
> >
> > If the value is already 1 or ON, then it's your browser causing the
> > trouble.
> >
> > --
> > ---John Holmes...
> >
> > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
> >
> > PHP|Architect: A magazine for PHP Professionals – www.phparch.com
> >
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Hello everyone,

I'm trying to pass some info into Flash.   this worked fine with another
funciton call instead of Players();
But for some reason it will only pass the first name into flash..that's it.
however, when I check it just in a browser, it works fine.
I'm not sure why this one won't specifically work.

this is what I have.

// Includes etc...
 // Create new Class
 $server = new Rcon();

 // Connect & Retrieve Info
 if($server->Connect($config_server_ip, $config_server_port,
$config_server_password)) {
  $player_results = $server->Players();
  $server->Disconnect();
 }

 // Output to Flash
 $player_info = Array();
 for ($i=1; $i<=count($player_results); $i++) {
  $player_info[($i-1)] = implode(",", $player_results[$i]);
 }

 $player_info2 = implode("|", $player_info);

 print ($player_info2);

This works to browser, but not to Flash.  it really doesn't make sense.

Any help?

Cheers.



--- End Message ---
--- Begin Message --- Chris Shiflett wrote:
--- "Matthew A. Blasinski" <[EMAIL PROTECTED]> wrote:

So, I'm thinking a plausible session id could be made by hashing
their identification (to make it useful to the rightful owner
only) with a private key (to make it hard to get and guess). I
think the identification could be their IP, user agent, and maybe
one or two more constant headers. The private key, of course,
could be anything unguessable and kept secure.


A few comments...

This session ID doesn't have to be generated from any user data. It can be a
completely random and unique string that you generate for any user who arrives
at your site without an active session. Even though it is probably very
difficult to reverse or guess a valid ID from your method above, the extra risk
isn't necessary.

Also, the IP address isn't a very good piece of data to use, because it is not
necessarily consistent. So, while it might make things harder for the bad guys
(to spoof the good guy's IP), it could also can make things hard for the good
guys (they are AOL users, lose their modem connection, etc.).


Thanks for everyone's responses. I was thinking the IP would be usable for tracking users, and a lot of people have pointed out that's not the case. So, I'll probably go with passing it in the URL.

Thanks again,

--
Matt Blasinski (mbv)
Internet Infrastructure Applications Technology
Division of Information Technology
3121 Computer Science and Statistics
1210 West Dayton Street
Madison WI 53706
Work (608) 262-2286
Cell (608) 206-4098


--- End Message ---

Reply via email to