php-general Digest 14 Jul 2003 03:19:12 -0000 Issue 2174
Topics (messages 155004 through 155037):
Re: Weird Date problem driving me crazy...
155004 by: John W. Holmes
155013 by: Boaz Yahav
Re: Need PHP on Win2000 Pro
155005 by: Simon Fredriksson
155008 by: John Nichel
Re: Private and protected variables in PHP 5?
155006 by: Marek Kilimajer
Re: Is it possible to test an uploaded file to check the type?
155007 by: Marek Kilimajer
155009 by: Gerard Samuel
155010 by: David Otton
155036 by: Gerard Samuel
Re: Code and Good Design Methods
155011 by: Ray Hunter
Re: How does PHP interact when using Java?
155012 by: Ray Hunter
About fopen() for write and PHP settings
155014 by: George Papatheodorou
Turning string into a table
155015 by: zavaboy
MySql Rollback in PHP within a website
155016 by: bruce
155017 by: John W. Holmes
Replacing newlines (\n) with smething else
155018 by: Jason Giangrande
155020 by: J. Cox
155021 by: Jason Giangrande
155022 by: David Otton
155023 by: Jason Giangrande
155025 by: David Otton
155026 by: Jason Giangrande
PHP weirdness with files named tos.php
155019 by: motorpsychkill
155024 by: John A. Thomason
Re: Replacing newlines (n) with smething else
155027 by: David Nicholson
155029 by: Jason Giangrande
Re: session data missing
155028 by: ulf sundin
ImageTTFText for mac? win? linux?
155030 by: Miranda, Joel Louie M
155034 by: Ralph Guzman
Grabbing info from other Sites
155031 by: Ow Mun Heng
155033 by: Michael Geier
155035 by: Ow Mun Heng
155037 by: Suhas Pharkute
Client script opensource plea
155032 by: Larry Brown
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 ---
Boaz Yahav wrote:
I have two date strings coming out from MySQL.
Both fields are defined as datetime.
When i come to print them like this :
Echo"<B>Ticket Opened</B> : " . date("l, F jS Y
H:i",$row->OpenDate) . "<BR>";
Echo"<B>Problem Start</B> : " . date("l, F jS Y
H:i",$row->ProblemStart) . "<BR>";
I get :
Ticket Opened : Sunday, July 13th 2003 13:37
Problem Start : Thursday, January 1st 1970 02:33
Notice that the 2nd date is wrong and it's some kind of default that the
function
returns. Only if i add strtotime() and only to the 2nd field do i get
the correct answer :
Ticket Opened : Sunday, July 13th 2003 13:37
Problem Start : Saturday, July 12th 2003 20:36
date() expects a UNIX timestamp to be passed to it. MySQL does not store
dates as a UNIX timestamp in DATE, DATETIME, or TIMESTAMP columns.
strtotime() will take a MySQL timestamp, though, and convert it to a
UNIX timestamp.
Also look into using DATE_FORMAT() in your query to format the data
there so you don't have to do anything in PHP.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Thanks John, your answer is right on the $$$.
Changing the query to something like : SELECT
UNIX_TIMESTAMP(ProblemStart) as ProblemStart
solved the problem.
Do i feel sheepish... actually double sheepish cause i already solved
this
long ago and forgot about it :(
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Sunday, July 13, 2003 5:01 PM
To: Boaz Yahav
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Weird Date problem driving me crazy...
Boaz Yahav wrote:
> I have two date strings coming out from MySQL.
> Both fields are defined as datetime.
>
> When i come to print them like this :
>
> Echo"<B>Ticket Opened</B> : " . date("l, F jS Y
> H:i",$row->OpenDate) . "<BR>";
> Echo"<B>Problem Start</B> : " . date("l, F jS Y
> H:i",$row->ProblemStart) . "<BR>";
>
> I get :
>
> Ticket Opened : Sunday, July 13th 2003 13:37
> Problem Start : Thursday, January 1st 1970 02:33
>
> Notice that the 2nd date is wrong and it's some kind of default that
> the function returns. Only if i add strtotime() and only to the 2nd
> field do i get the correct answer :
>
> Ticket Opened : Sunday, July 13th 2003 13:37
> Problem Start : Saturday, July 12th 2003 20:36
date() expects a UNIX timestamp to be passed to it. MySQL does not store
dates as a UNIX timestamp in DATE, DATETIME, or TIMESTAMP columns.
strtotime() will take a MySQL timestamp, though, and convert it to a
UNIX timestamp.
Also look into using DATE_FORMAT() in your query to format the data
there so you don't have to do anything in PHP.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals - www.phparch.com
--- End Message ---
--- Begin Message ---
When I make console scripts for *nix in PHP I have the shebang line and
after that <?php
#!/usr/bin/php -q
<?php
...
?>
Is PHP as powerful as perl on the console area yet?
//Simon
John A. Thomason wrote:
Thanks for your help. Also, I checked out your tutorial and Apache and PHP.
I have Apache installed, and I am using it for backend work. I have been
using Perl, but have discovered PHP, and want to be able to use it on the
command line. Another email told me the solution.
Replace the shebang line with <?PHP and end the script with ?>
And that is how simple the fix was, and now I am going to rewrite all of my
batch files and perl scripts using PHP. I do need a little more
understanding of Apache and will be studying your Apache tutorial. Thanks
again.
John A. Thomason
[EMAIL PROTECTED]
----- Original Message -----
From: "Burhan Khalid" <[EMAIL PROTECTED]>
To: "John A. Thomason" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, July 13, 2003 8:08 AM
Subject: Re: [PHP] Need PHP on Win2000 Pro
On Saturday, July 12, 2003, 10:31:14 PM, John wrote:
JAT> Hello,
JAT> I need some advice on getting PHP 4 up and running on my Windows 2000
JAT> Professional. I have followed all of the instructions in the
installation
JAT> file, but when I try to run a PHP as a batch from the command prompt,
all I
JAT> get is the file listed. Help!
You need a web server in order to run the scripts (unless you are
strictly doing it command line).
I have a tutorial that shows you how to setup Apache with PHP on
Windows (its not OS specific, but it can be applied to any Windows
version).
Here is the link <http://www.meidomus.com/archives/000059.php>
Please read the use comments, and if you have any questions, you can
email me off-list :)
--
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--- End Message ---
--- Begin Message ---
Simon Fredriksson wrote:
When I make console scripts for *nix in PHP I have the shebang line and
after that <?php
#!/usr/bin/php -q
<?php
...
?>
Is PHP as powerful as perl on the console area yet?
In my opinion, no. But Perl has a big head start on php when it comes
to system scripts (not to mention that PHP is designed for web based
applications). I can easily forsee PHP taking over Perl in the system
area (course, they may both fall out of favor as more and more people
are using languages like Python and TCL for system scripts).
--- End Message ---
--- Begin Message ---
Don't have the possibilities to try it out now, but I think you are wrong:
Example:
class Parent {
protected $var = "test";
function blah($somevar) {
...
}
}
class Child extends Parent {
...
}
$parent = new Parent;
print $parent->var; //ouputs "test"
This will error out, you access a protected variable that is accessible
only from the class itself or derived classes (using $this->var).
$child = new Child;
print $child->var; //outputs nothing
Gives error for the same reason as above. But if you declare a public
method in Child class:
function getVar() {
return $this->var;
}
, then this would work:
print $child->getVar();
as you can see $var is only accessible by objects that are specifically
Parents, not Children.
Protected variables are accessible also from derived classes, private
are not. But both are NOT accessible from outside (e.g. using $a=new A;
$a->var;), but only from within class methods (using $this->var).
--- End Message ---
--- Begin Message ---
If you have compiled php with --enable-mime-magic, you can use
mime_content_type()
Dan Anderson wrote:
Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
make sure it is of a certain format? I want to allow a user to only
upload jpegs or mpegs, and want to check what format the file is in.
Thanks in advance,
Dan Anderson
--- End Message ---
--- Begin Message ---
The upload process, already collects info on file types when you upload.
From the manual ->
$_FILES['userfile']['type']
The mime type of the file, if the browser provided this
information. An example would be "image/gif".
So, check $_FILES['userfile']['type'] against a set of allowed file
types, and you're set...
Marek Kilimajer wrote:
If you have compiled php with --enable-mime-magic, you can use
mime_content_type()
Dan Anderson wrote:
Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
make sure it is of a certain format? I want to allow a user to only
upload jpegs or mpegs, and want to check what format the file is in.
Thanks in advance,
Dan Anderson
--- End Message ---
--- Begin Message ---
On Sun, 13 Jul 2003 13:32:00 -0400, you wrote:
>The upload process, already collects info on file types when you upload.
> From the manual ->
>
>> $_FILES['userfile']['type']
>>
>> The mime type of the file, if the browser provided this
>> information. An example would be "image/gif".
>>
>So, check $_FILES['userfile']['type'] against a set of allowed file
>types, and you're set...
A client-supplied value isn't going to be too useful - it can be spoofed, or
may not be present. (I believe a Windows browser would set the mime-type
based purely on the file extension, though I haven't tested this myself).
>Marek Kilimajer wrote:
>
>> If you have compiled php with --enable-mime-magic, you can use
>> mime_content_type()
This is the most-benefit least-effort choice if it's available, though I
believe that flag has been changed since 4.32[?]
--- End Message ---
--- Begin Message ---
David Otton wrote:
$_FILES['userfile']['type']
The mime type of the file, if the browser provided this
information. An example would be "image/gif".
So, check $_FILES['userfile']['type'] against a set of allowed file
types, and you're set...
A client-supplied value isn't going to be too useful - it can be spoofed, or
may not be present. (I believe a Windows browser would set the mime-type
based purely on the file extension, though I haven't tested this myself).
Then my apologies. I thought php determined the file type on upload,
and not rely on user input as your're saying.
Makes me rethink some of my own code :)
--- End Message ---
--- Begin Message ---
True xsl(t) is a language in and of itself along with xpath, xpointer,
and a host of others.
However, it is safe to point out that this is another alternative that
can be reviewed. It possibly may be the hardest to incorporate; however,
it needs to be mentioned as well.
--
BigDog
On Sun, 2003-07-13 at 01:20, Robert Cummings wrote:
> Let's be honest, XSL is is one big logic step itself -- moreover it's a
> whole other language to learn.
>
> Cheers,
> Rob.
>
> On Sun, 2003-07-13 at 02:07, Ray Hunter wrote:
> > Also u could build your own system that is php xml and xslt based. That
> > will really help you separate the logic from the presentation.
> >
> > Check out (dom)xml and (dom)xslt. Sometimes there is still logic in the
> > presentation with template systems....with xslt however, it might be to
> > much for the design (interface) guys.
> >
> > Those should help u out.
> >
> > --
> > BigDog
> >
> >
> > On Sat, 2003-07-12 at 20:08, Dan J. Rychlik wrote:
> > > I am reading PHP and MySQL web development 2nd edition book. Chapter 6 talks
> > > about displaying dynamic web content using class objects. For the type of
> > > project that I am building, this is not optimal. How do I keep my self from
> > > having html mixed with my PHP code? In other words how do I serperate the two.
> > > I need to concentrate on writing good code and not designing a nice looking
> > > website. (someone else is going to do that)
> > >
> > > Can I assign include() statements to a variable ? How would you guys accomplish
> > > this?
> > >
> > > Thanks so much in advance,
> > > Daniel
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
--- End Message ---
--- Begin Message ---
Not to sure how they work together in a php environment, however another
alternative it so use php in a java (servlet,j2ee) environment. It is
harder to set up, however, there are not as many errors. Sometimes there
is a performance increase.
--
BigDog
On Sun, 2003-07-13 at 01:50, Jan Bro wrote:
> Hi,
> I've just got PHP working with Java. It connects to a remote Oracle DB
> with Java and without the Oracle Client installed on my machine,
> it's sure a beauty. What I was wondering, what's behind it, I mean how
> does it work? I transfer Objects in Java and get data out. How do PHP
> and Java interact, after all they are two different technologies.
>
> I've searched google and pretty much every site I could think off, but
> I've found nothing more than a setup tutorial.
>
> By the way, I should mention if you have them interact, Apache + PHP
> doesn't like java packages at all. PHP blows off with a severe error
> message.
>
> thx
> Jan Bro
--- End Message ---
--- Begin Message ---
First of all I apology for my poor use of English of my newbish(?)
questions because I didn't find any solutions the first time I e-mailed
this list. What my problem is:
I am on a server that has these configurations like these:
http://kainga.quasarnet.org/php.php . Let's say my username is user1 and
server files' owner is httpd . I have a script in my public html dir
that tries to fopen("./somefile.txt", "w") [note: is_writable for this
file returns false but its permissions are rw-rw-r--) but it always
fails. However, when the servers' owner changed the somefile.txt's owner
to httpd the script could write to it without any problem. Is there any
way that I can make the script write to somefile.txt without changing
its owner to httpd (I even changed the file's permissions to rwx-rwx-rwx
and it still wouldn't let the script write to it)? I really need help
with this and I hope it can be solved easily.
PS. Whatever I did PHP would return false on is_writable, which returned
true when the file's owner changed to httpd.
Thank you in advance,
Arty2
--- End Message ---
--- Begin Message ---
Is there a way to make for example:
// (Column info)
// String 1:
[This column holds
[Col 1]
[Col 2]]
[This second column holds
[Col 3]
[Col 4]]
// (Row)
// String 2:
[Col 1 (row1)]
[Col 2 (row1)]
[Col 3 (row1)]
[Col 4 (row1)]
// (Row)
// String 3:
[Col 1 (row2)]
[Col 2 (row2)]
[Col 3 (row2)]
[Col 4 (row2)]
// How do I turn the above strings into a table?
// Like this:
<table>
<tr>
<td colspan=2>This column holds</td>
<td colspan=2>This second column holds</td>
</tr>
<tr>
<td>Col 1</td>
<td>Col 2</td>
<td>Col 3</td>
<td>Col 4</td>
</tr>
<tr>
<td>Col 1 (row 1)</td>
<td>Col 2 (row 1)</td>
<td>Col 3 (row 1)</td>
<td>Col 4 (row 1)</td>
</tr>
<tr>
<td>Col 1 (row 2)</td>
<td>Col 2 (row 2)</td>
<td>Col 3 (row 2)</td>
<td>Col 4 (row 2)</td>
</tr>
</table>
You get the idea...
So, any idea how to do that?
I want it to work correctly no matter how many rows and columns there are.
--
- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com
--- End Message ---
--- Begin Message ---
Hey...
I have a question. I need to be able to try to perform a database update,
but if it doesn't succeed, I need to be able to rollback the changes, and to
inform the user that the changes didn't succeed.
I've looked at the MySql site, and can see somewhat how the Commit/RollBack
functions work. However, I'm not sure how to create the required PHP code to
implement this kind of process...
Basically I need to:
Create query...
Perform Update on the table(s)
Perform my check(s)
If the checks fail
alert user
rollback updates
else
success
It's my understanding that I need to somehow set "START TRANSACTION" prior
to beginning the update. But I'm not sure how to do that within the PHP
code... Nor am I sure if there's something else I need to do...
Any examples/hints/sample code will be appreciated. Thanks for any
assistance!
Regards,
Bruce
[EMAIL PROTECTED]
(925) 866-2790
--- End Message ---
--- Begin Message ---
bruce wrote:
I have a question. I need to be able to try to perform a database update,
but if it doesn't succeed, I need to be able to rollback the changes, and to
inform the user that the changes didn't succeed.
I've looked at the MySql site, and can see somewhat how the Commit/RollBack
functions work. However, I'm not sure how to create the required PHP code to
implement this kind of process...
Basically I need to:
Create query...
Perform Update on the table(s)
Perform my check(s)
If the checks fail
alert user
rollback updates
else
success
It's my understanding that I need to somehow set "START TRANSACTION" prior
to beginning the update. But I'm not sure how to do that within the PHP
code... Nor am I sure if there's something else I need to do...
$rs1 = mysql_query("START TRANSACTION");
$rs2 = mysql_query($query1);
$rs3 = mysql_query($query2);
if($error)
{ $rsx = mysql_query("ROLLBACK"); }
else
{ $rsx = mysql_query("COMMIT"); }
Use mysql_error() or mysql_errno() to see if an error occurred.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hi,
I'm trying to replace newlines with something else. For this example
I'll use <br> as the thing to replace a newline with. This is what I
tried and it doesn't work.
$article = str_replace("\n", "<br>", $article);
What am I doing wrong? $article is the string to replace the newlines
in. I tried this with a period and that works as expected. Can I not
replace newlines this way?
Thanks,
Jason Giangrande
--- End Message ---
--- Begin Message ---
"Jason Giangrande" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'm trying to replace newlines with something else. For this example
> I'll use <br> as the thing to replace a newline with. This is what I
> tried and it doesn't work.
>
> $article = str_replace("\n", "<br>", $article);
>
> What am I doing wrong? $article is the string to replace the newlines
> in. I tried this with a period and that works as expected. Can I not
> replace newlines this way?
why not just:
$article = nl2br($article);
--
J. Cox
http://www.xaraya.com
--- End Message ---
--- Begin Message ---
I did not know about nl2br. Thanks.
But what if say I want to replace a newline with something else, say
</p><p>. How would I do that?
Jason
On Sun, 2003-07-13 at 17:09, J. Cox wrote:
> "Jason Giangrande" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> >
> > I'm trying to replace newlines with something else. For this example
> > I'll use <br> as the thing to replace a newline with. This is what I
> > tried and it doesn't work.
> >
> > $article = str_replace("\n", "<br>", $article);
> >
> > What am I doing wrong? $article is the string to replace the newlines
> > in. I tried this with a period and that works as expected. Can I not
> > replace newlines this way?
>
> why not just:
>
> $article = nl2br($article);
>
> --
> J. Cox
> http://www.xaraya.com
>
>
>
--- End Message ---
--- Begin Message ---
On 13 Jul 2003 17:01:24 -0400, you wrote:
>I'm trying to replace newlines with something else. For this example
>I'll use <br> as the thing to replace a newline with. This is what I
>tried and it doesn't work.
nl2br() in the specific case
>$article = str_replace("\n", "<br>", $article);
>
>What am I doing wrong? $article is the string to replace the newlines
>in. I tried this with a period and that works as expected. Can I not
>replace newlines this way?
But in the general case, your code looks ok to me.
echo (str_replace("\n", "<br>", "foo\nbar"));
returns "foo<br>bar" here. Maybe $article doesn't contain what you think it
does?
(BTW, I prefer to replace "\n" with "<br>\n", but that's just a style
thing.)
--- End Message ---
--- Begin Message ---
Perhaps. When getting text from a form field, what is substituted for a
newline (i.e. when someone hits enter).
Jason
On Sun, 2003-07-13 at 17:21, David Otton wrote:
> On 13 Jul 2003 17:01:24 -0400, you wrote:
>
> >I'm trying to replace newlines with something else. For this example
> >I'll use <br> as the thing to replace a newline with. This is what I
> >tried and it doesn't work.
>
> nl2br() in the specific case
>
> >$article = str_replace("\n", "<br>", $article);
> >
> >What am I doing wrong? $article is the string to replace the newlines
> >in. I tried this with a period and that works as expected. Can I not
> >replace newlines this way?
>
> But in the general case, your code looks ok to me.
>
> echo (str_replace("\n", "<br>", "foo\nbar"));
>
> returns "foo<br>bar" here. Maybe $article doesn't contain what you think it
> does?
>
> (BTW, I prefer to replace "\n" with "<br>\n", but that's just a style
> thing.)
>
--- End Message ---
--- Begin Message ---
On 13 Jul 2003 17:27:04 -0400, you wrote:
>Perhaps. When getting text from a form field, what is substituted for a
>newline (i.e. when someone hits enter).
You can work it out for yourself. Run over the string, displaying each
character as it's ASCII equivalent with ord(). Eg
for ($i = 0; $i < strlen($article); $i++) {
echo ("'" . $article[$i] . "'=" . ord($article[$i]) . ', ');
}
(My guess is that you're seeing the difference between a wrapped line and
the user explicitly hitting enter)
--- End Message ---
--- Begin Message ---
It's really strange because I type the following into the form field.
Test
Test
Test
And get this as output.
Test Test Test
Do form fields not preserve spacing or line breaks?
Jason
On Sun, 2003-07-13 at 17:45, David Otton wrote:
> On 13 Jul 2003 17:27:04 -0400, you wrote:
>
> >Perhaps. When getting text from a form field, what is substituted for a
> >newline (i.e. when someone hits enter).
>
> You can work it out for yourself. Run over the string, displaying each
> character as it's ASCII equivalent with ord(). Eg
>
> for ($i = 0; $i < strlen($article); $i++) {
> echo ("'" . $article[$i] . "'=" . ord($article[$i]) . ', ');
> }
>
> (My guess is that you're seeing the difference between a wrapped line and
> the user explicitly hitting enter)
>
--- End Message ---
--- Begin Message ---
I'm running PHP 4.3.1 with Apache 2.0 on Windows XP. Everything works great
except if I name a file tos.php, Apache won't serve it. I'm not really sure
if this is an Apache or PHP thing. Can anyone else replicate this error on
their machines?
Thanks!
--- End Message ---
--- Begin Message ---
I'm running Apache 2/php/perl/mysql on Win2000 and tos.php worked.
john
[EMAIL PROTECTED]
"Motorpsychkill" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm running PHP 4.3.1 with Apache 2.0 on Windows XP. Everything works
great
> except if I name a file tos.php, Apache won't serve it. I'm not really
sure
> if this is an Apache or PHP thing. Can anyone else replicate this error
on
> their machines?
>
> Thanks!
>
--- End Message ---
--- Begin Message ---
Hello,
This is a reply to an e-mail that you wrote on Sun, 13 Jul 2003 at 23:12,
lines prefixed by '>' were originally written by you.
Maybe the browser you are using to fill in the form field is using a
different type of line break. Although I have never seen it done, r by
itself can be used to cause a line break and if that is being done your
code will not be detecting it.
David
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)
--- End Message ---
--- Begin Message ---
My problem is solved. Thank you to everyone who responded.
Jason
On Sun, 2003-07-13 at 18:33, David Nicholson wrote:
> Hello,
>
>
> This is a reply to an e-mail that you wrote on Sun, 13 Jul 2003 at 23:12,
> lines prefixed by '>' were originally written by you.
>
> Maybe the browser you are using to fill in the form field is using a
> different type of line break. Although I have never seen it done, r by
> itself can be used to cause a line break and if that is being done your
> code will not be detecting it.
>
> David
>
> --
> phpmachine :: The quick and easy to use service providing you with
> professionally developed PHP scripts :: http://www.phpmachine.com/
>
> Professional Web Development by David Nicholson
> http://www.djnicholson.com/
>
> QuizSender.com - How well do your friends actually know you?
> http://www.quizsender.com/
> (developed entirely in PHP)
--- End Message ---
--- Begin Message ---
I'm not the admin on the server, so I'll have to manage with the software
provided. And that is php 4.0.6.
I've tried a number of ways to store variables in the session file. This
works:
session_start();
$foo = 'bar';
session_register('foo');
then after session_write_close(); or end of script:
echo $HTTP_SESSION_VARS['foo']; will output 'bar'.
just adding variables directly into the HTTP_SESSION_VARS array won't make
them stick in the session file. Use of session_register() seems to be
required.
Ulf
"Mike Ford" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> > -----Original Message-----
> > From: Kevin Stone [mailto:[EMAIL PROTECTED]
> > Sent: 09 July 2003 20:30
> >
> > ----- Original Message -----
> > From: "ulf sundin" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 09, 2003 1:00 PM
> > Subject: Re: [PHP] session data missing
> >
> >
> > > ok, so now the variable names are registred and stored in
> > the file. But
> > > without values.
> > > check this:
> > >
> > > --firstpage.php----
> > > session_start()
> > > session_register('foo');
> > > $HTTP_SESSION_VARS['foo'] = 'bar';
> > > echo $HTTP_SESSION_VARS['foo']; //outputs bar;
> > >
> > > transport by a href to:
> > > ----secondpage.php----
> > > session_start();
> > > echo $HTTP_SESSION_VARS['foo']; //outputs nothing
> > >
> > > ---
> > > checking the contents of the file called /tmp/sess_{session_id}:
> > > !foo|
> > (snip)
> >
> >
> > Make a choice here..
> >
> > => session_register('foo');
> > => $HTTP_SESSION_VARS['foo'] = 'bar';
> >
> > Use either the session_register() function or the session
> > global array. Not
> > both.
>
> Not true -- $HTTP_SESSION_VARS is *not* like $_SESSION, and its values are
*not* auto-registered. In fact, I still have my copy of the 4.0.6 manual
around, and it specifically gives this as an example:
>
> > Example 1. Registering a variable
> >
> > <?php
> > session_register("count");
> > $HTTP_SESSION_VARS["count"]++;
> > ?>
>
> However, it's a little unclear on whether this should still work
regardless of the register_globals setting, as it also gives this as an
example:
>
> > Example 2. Registering a variable with register_globals enabled
> >
> > <?php
> > session_register("count");
> > $count++;
> > ?>
>
> I guess I'd have to go away and try it to be sure of what behaviour occurs
for each setting of register_globals -- but there seems little point given
that using $_SESSION has been much the best option for several versions now!
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS, LS6 3QS, United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
Im confused.. I know I have TrueType support on php. Now I wonder where will
I put my fonts into my server? Like verdana, etc just a sample. Does this
means even macintosh truetype fonts I can also load in?
--
Thank you,
Louie Miranda ([EMAIL PROTECTED])
--- End Message ---
--- Begin Message ---
http://www.codephobia.com/tutorials/view.php3?idnum=6
-----Original Message-----
From: Miranda, Joel Louie M [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 12:04 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] ImageTTFText for mac? win? linux?
Im confused.. I know I have TrueType support on php. Now I wonder where
will
I put my fonts into my server? Like verdana, etc just a sample. Does
this
means even macintosh truetype fonts I can also load in?
--
Thank you,
Louie Miranda ([EMAIL PROTECTED])
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I have this need/want to grab information from sites for my own
usage and wondering how to do it.
Here's an example.
1. Log into finance.yahoo.com (assuming I need to log on)
2. Type the list of shares I want
3. Let Yahoo process it
4. Use PHP or some other scripting language to pull the data and put it into
my database.
Is this possible at all?
Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Sunday, July 13, 2003 10:58 PM
To: [EMAIL PROTECTED]
Subject: php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173
php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173
Topics (messages 154985 through 155003):
Re: touch file on shared web server?
154985 by: Paul O'Neil
154991 by: Jason Wong
Re: Code and Good Design Methods
154986 by: zbranigan
154987 by: zbranigan
154988 by: Dan J. Rychlik
154994 by: Ray Hunter
154995 by: Robert Cummings
Re: OK, So I am new to these List. Win2000 help!
154989 by: John Nichel
155002 by: John Nichel
Re: Newbie Directory question
154990 by: olinux
Re: Mailing list server with PHP frontend
154992 by: Juan Nin
154993 by: Manuel Lemos
154996 by: Paul Chvostek
How does PHP interact when using Java?
154997 by: Jan Bro
Weird Date problem driving me crazy...
154998 by: Boaz Yahav
php script billing receipt
154999 by: Duncan
Re: Need PHP on Win2000 Pro
155000 by: Burhan Khalid
155001 by: John A. Thomason
Re: dump $_POST into variables????
155003 by: Marek Kilimajer
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]
----------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
assuming the login isn't necessary (which it probably is), you could use
something like Snoopy (http://sourceforge.net/projects/snoopy/) to POST/GET the
required web page and process as required.
Quoting Ow Mun Heng <[EMAIL PROTECTED]>:
> Hi,
>
> I have this need/want to grab information from sites for my own
> usage and wondering how to do it.
>
> Here's an example.
>
> 1. Log into finance.yahoo.com (assuming I need to log on)
> 2. Type the list of shares I want
> 3. Let Yahoo process it
> 4. Use PHP or some other scripting language to pull the data and put it into
> my database.
>
> Is this possible at all?
>
>
>
> Cheers,
> Mun Heng, Ow
> H/M Engineering
> Western Digital M'sia
> DID : 03-7870 5168
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Sunday, July 13, 2003 10:58 PM
> To: [EMAIL PROTECTED]
> Subject: php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173
>
>
>
> php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173
>
> Topics (messages 154985 through 155003):
>
> Re: touch file on shared web server?
> 154985 by: Paul O'Neil
> 154991 by: Jason Wong
>
> Re: Code and Good Design Methods
> 154986 by: zbranigan
> 154987 by: zbranigan
> 154988 by: Dan J. Rychlik
> 154994 by: Ray Hunter
> 154995 by: Robert Cummings
>
> Re: OK, So I am new to these List. Win2000 help!
> 154989 by: John Nichel
> 155002 by: John Nichel
>
> Re: Newbie Directory question
> 154990 by: olinux
>
> Re: Mailing list server with PHP frontend
> 154992 by: Juan Nin
> 154993 by: Manuel Lemos
> 154996 by: Paul Chvostek
>
> How does PHP interact when using Java?
> 154997 by: Jan Bro
>
> Weird Date problem driving me crazy...
> 154998 by: Boaz Yahav
>
> php script billing receipt
> 154999 by: Duncan
>
> Re: Need PHP on Win2000 Pro
> 155000 by: Burhan Khalid
> 155001 by: John A. Thomason
>
> Re: dump $_POST into variables????
> 155003 by: Marek Kilimajer
>
> 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]
>
>
> ----------------------------------------------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
=======================================
Michael Geier
CDM Sports, Inc. Systems Administration
email: [EMAIL PROTECTED]
phone: 314.692.3540
-----------------------------------------------
This email sent using CDM Sports Webmail v3.1
[ http://webmail.cdmsports.com ]
--- End Message ---
--- Begin Message ---
Hi,
Unfortunately, Yahoo.com is just an example.. The site really does
need Login.
The thing is this, I'm developing for an internal site, (My dept) but I need
to access other dept's site to get info but unfortunately They won't give me
access to query the db directly. Prefering me to go through the site and
input accordingly to grab the data.
I just find this to be "SO" troublesome as I need to get this data
for every week. Week In.. Week Out and for a lot of items..
But I will take a look at SNOOPY. (hey.. isn't the name snoopy
copyrighted??)
Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168
-----Original Message-----
From: Michael Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, July 14, 2003 9:47 AM
To: Ow Mun Heng
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Grabbing info from other Sites
assuming the login isn't necessary (which it probably is), you could use
something like Snoopy (http://sourceforge.net/projects/snoopy/) to POST/GET
the
required web page and process as required.
Quoting Ow Mun Heng <[EMAIL PROTECTED]>:
> Hi,
>
> I have this need/want to grab information from sites for my own
> usage and wondering how to do it.
>
> Here's an example.
>
> 1. Log into finance.yahoo.com (assuming I need to log on)
> 2. Type the list of shares I want
> 3. Let Yahoo process it
> 4. Use PHP or some other scripting language to pull the data and put it
into
> my database.
>
> Is this possible at all?
>
>
>
> Cheers,
> Mun Heng, Ow
> H/M Engineering
> Western Digital M'sia
> DID : 03-7870 5168
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Sunday, July 13, 2003 10:58 PM
> To: [EMAIL PROTECTED]
> Subject: php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173
>
>
>
> php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173
>
> Topics (messages 154985 through 155003):
>
> Re: touch file on shared web server?
> 154985 by: Paul O'Neil
> 154991 by: Jason Wong
>
> Re: Code and Good Design Methods
> 154986 by: zbranigan
> 154987 by: zbranigan
> 154988 by: Dan J. Rychlik
> 154994 by: Ray Hunter
> 154995 by: Robert Cummings
>
> Re: OK, So I am new to these List. Win2000 help!
> 154989 by: John Nichel
> 155002 by: John Nichel
>
> Re: Newbie Directory question
> 154990 by: olinux
>
> Re: Mailing list server with PHP frontend
> 154992 by: Juan Nin
> 154993 by: Manuel Lemos
> 154996 by: Paul Chvostek
>
> How does PHP interact when using Java?
> 154997 by: Jan Bro
>
> Weird Date problem driving me crazy...
> 154998 by: Boaz Yahav
>
> php script billing receipt
> 154999 by: Duncan
>
> Re: Need PHP on Win2000 Pro
> 155000 by: Burhan Khalid
> 155001 by: John A. Thomason
>
> Re: dump $_POST into variables????
> 155003 by: Marek Kilimajer
>
> 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]
>
>
> ----------------------------------------------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
=======================================
Michael Geier
CDM Sports, Inc. Systems Administration
email: [EMAIL PROTECTED]
phone: 314.692.3540
-----------------------------------------------
This email sent using CDM Sports Webmail v3.1
[ http://webmail.cdmsports.com ]
--- End Message ---
--- Begin Message ---
Why don't you use MSN services to get quotes. MSN does care for login. I am
using this to get quotes after 15 minutes on my Cell Phone.
I am using culr functions to get it.
Suhas
_________________________________
Encrypt your PHP code for FREE at
http://encphp.sspsoft.com
_________________________________
----- Original Message -----
From: "Ow Mun Heng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 13, 2003 7:43 PM
Subject: [PHP] Grabbing info from other Sites
Hi,
I have this need/want to grab information from sites for my own
usage and wondering how to do it.
Here's an example.
1. Log into finance.yahoo.com (assuming I need to log on)
2. Type the list of shares I want
3. Let Yahoo process it
4. Use PHP or some other scripting language to pull the data and put it into
my database.
Is this possible at all?
Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Sunday, July 13, 2003 10:58 PM
To: [EMAIL PROTECTED]
Subject: php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173
php-general Digest 13 Jul 2003 14:58:27 -0000 Issue 2173
Topics (messages 154985 through 155003):
Re: touch file on shared web server?
154985 by: Paul O'Neil
154991 by: Jason Wong
Re: Code and Good Design Methods
154986 by: zbranigan
154987 by: zbranigan
154988 by: Dan J. Rychlik
154994 by: Ray Hunter
154995 by: Robert Cummings
Re: OK, So I am new to these List. Win2000 help!
154989 by: John Nichel
155002 by: John Nichel
Re: Newbie Directory question
154990 by: olinux
Re: Mailing list server with PHP frontend
154992 by: Juan Nin
154993 by: Manuel Lemos
154996 by: Paul Chvostek
How does PHP interact when using Java?
154997 by: Jan Bro
Weird Date problem driving me crazy...
154998 by: Boaz Yahav
php script billing receipt
154999 by: Duncan
Re: Need PHP on Win2000 Pro
155000 by: Burhan Khalid
155001 by: John A. Thomason
Re: dump $_POST into variables????
155003 by: Marek Kilimajer
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]
----------------------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
This, most certainly OT, is a plea for fellow developers oriented in
OpenSource solutions to help resolve a problem in case you have dealt with
it before. I have written a PHP app that uses function keys at times to
help speed data processing for my client VIA javascript. This app works
fine when the client is using IE or Netscape on the windows platform.
However, when the client is on Linux, the function keys are not being
captured on Mozilla or Netscape. I presented this problem in my Javascript
mailing list and on the RedHat mailing list and no one seems to have had any
experience dealing with it and consequently I haven't a work around. My
apologies for presenting a clearly OT question, but I know there are a ton
of experienced developers here and I reaching for someone who might have
dealt with this.
Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388
--- End Message ---