php-general Digest 11 Oct 2002 10:27:24 -0000 Issue 1637

Topics (messages 119588 through 119624):

Re: MS SQL server TEXT column
        119588 by: John W. Holmes

Re: Calling PHP (cgi) from a perl script and passsing parameters
        119589 by: Sascha Cunz
        119592 by: Jim Carey
        119593 by: Jim Carey

Re: Refresh my Memory
        119590 by: Omar Campos

Redhat 8.0 / php-cvs - /usr/lib/httpd/build/instdso.sh: No such file or directory
        119591 by: Robert Mena

Re: MySQL back up
        119594 by: Ken

Re: PDF to PHP (code)
        119595 by: Ken

Re: displaying fixed number of records
        119596 by: DoL

Best way to put layout, code on pages?
        119597 by: Leif K-Brooks
        119598 by: Jule Slootbeek

Re: site path
        119599 by: Bogdan Stancescu
        119603 by: . Edwin
        119611 by: Bogdan Stancescu

Re: Animation in PHP
        119600 by: Noodle Snacks

Working with dates in PHP
        119601 by: James Purser
        119604 by: Tom Rogers
        119612 by: David Freeman

Re: Capitalizing names ... needs the final touch...
        119602 by: -<[ Rene Brehmer ]>-

Fatal error:  Cannot use [] for reading
        119605 by: Leif K-Brooks
        119606 by: Leif K-Brooks
        119607 by: Bogdan Stancescu
        119608 by: Leif K-Brooks
        119609 by: Bogdan Stancescu
        119610 by: Bogdan Stancescu

Forms issues..
        119613 by: Simon Taylor

MSSQL_RESULT Problem
        119614 by: Francky

Download problems..
        119615 by: Archibald Zimonyi

Compiling PHP against net-snmp 5.0.6
        119616 by: Peter Hicks

Updating session variables values during session
        119617 by: Stéphane Pinel
        119618 by: Simon Taylor
        119619 by: Stéphane Pinel
        119620 by: Simon Taylor
        119622 by: Stéphane Pinel

Re: Updating session variables (resolced: shame on me)
        119621 by: Stéphane Pinel
        119623 by: Simon Taylor

[Slightly OT] Using Mozilla? Here!
        119624 by: Bogdan Stancescu

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 ---
Make sure you're using POST as your form method and not GET. 

---John Holmes...

> -----Original Message-----
> From: Vail, Warren [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 10, 2002 5:04 PM
> To: php
> Subject: [PHP] MS SQL server TEXT column
> 
> Encountered the following problem with the Microsoft SQL Server
interface.
> I am not sure where the problem exists, but I am looking for a
workaround.
> 
> I inserted a row into a table that contained a text column, and
inserted
> over 5kb string into the text field.  On retrieving the row the server
> returned the column values truncated to 4096 bytes exactly.  Tried to
code
> SET TEXTSIZE nnn into my query string, the query refused to return
> anything
> at all.  Then I tried coding SET TEXTSIZE as a separate query on the
same
> connection, just prior to my data query, both appeared to be
successful,
> but
> still only got 4096 bytes of data.
> 
> select DATALENGTH(availabilitySample) from mftsmainframeavailability
where
> availabilityID = 1
> 
> using the MSSQL 7 Query analyzer returns;
> 
> -----------
> 5242
> 
> (1 row(s) affected)
> 
> This shows that my text was stored, I just can't seem to get the
server
> (or
> the interface) to give me back more than 4096 bytes.
> 
> any clues would be greatly appreciated.
> thanks in advance,
> 
> Warren Vail
> Tools, Metrics & Quality Processes
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
What you're referring is CLI, not CGI Version of PHP.

Anyway, i assume, you're using a PHP version 4.2 or higher.
Have a look at the $_SERVER['argc'] and $_SERVER['argv'].

Sascha

Am Donnerstag, 10. Oktober 2002 23:57 schrieb Jim Carey:
> Hi,
> 
> have been having problems passing parameters to a PHP script from a Perl
> script . I call the PHP script using (as an example):
 
> $a=`/home/ozbcoz/http/testphp.php fred=testing`; 
> print "$a"; 
> 
> 
> then I have a PHP script showing: 
> 
> #!/usr/local/php/bin/php -q 
> <? 
>  
> print "count=$argc<br>"; 
> print "0=$argv[0]<br>"; 
> print "1=$argv[1]<br>"; 
> print "2=$argv[2]<br>"; 
> phpinfo(); 
> ?> 
> 
> the outout comes out as: 
> 
> count=0 
> 0= 
> 1= 
> 2= 
> plus the phpinfo bumpf - which shows argc as 0 and an empty array for argv
> 
> sny clues anyone ?
> 
> Jim Carey
> www.OZbcoz.com discount domain registration
> 

--- End Message ---
--- Begin Message ---
yes - am using 4.2.1

output from phpinfo() shows:

_SERVER["argv"] Array
(
)
  
_SERVER["argc"] 0  

which agrees with the $argc and $argv output.

details on the build include:

Build Date Jul 18 2002 08:29:02 
Configure Command './configure' '--prefix=/usr/local/php' 
'--with-config-file-path=/usr/local/bin/' '--enable-ftp' '--without-gd' '--with-mysql' 
 
Server API CGI 

the php.ini shows register_globals on and register_argc_argv on

works fine if I call the php mod directly from the command line - and parses the 
passed variable fine - just doesnt do it when called using the tick (or system 
function) from Perl


Jim Carey
www.OZbcoz.com discount domain registration



> -----Original Message-----
> From: Sascha Cunz [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 11 October 2002 9:28 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Calling PHP (cgi) from a perl script and passsing
> parameters
> 
> 
> What you're referring is CLI, not CGI Version of PHP.
> 
> Anyway, i assume, you're using a PHP version 4.2 or higher.
> Have a look at the $_SERVER['argc'] and $_SERVER['argv'].
> 
> Sascha
> 
> Am Donnerstag, 10. Oktober 2002 23:57 schrieb Jim Carey:
> > Hi,
> > 
> > have been having problems passing parameters to a PHP script from a Perl
> > script . I call the PHP script using (as an example):
>  
> > $a=`/home/ozbcoz/http/testphp.php fred=testing`; 
> > print "$a"; 
> > 
> > 
> > then I have a PHP script showing: 
> > 
> > #!/usr/local/php/bin/php -q 
> > <? 
> >  
> > print "count=$argc<br>"; 
> > print "0=$argv[0]<br>"; 
> > print "1=$argv[1]<br>"; 
> > print "2=$argv[2]<br>"; 
> > phpinfo(); 
> > ?> 
> > 
> > the outout comes out as: 
> > 
> > count=0 
> > 0= 
> > 1= 
> > 2= 
> > plus the phpinfo bumpf - which shows argc as 0 and an empty 
> array for argv
> > 
> > sny clues anyone ?
> > 
> > Jim Carey
> > www.OZbcoz.com discount domain registration
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
sorry - seems my earlier post was base64 - apologies to all :-( - here it is
again


yes - am using 4.2.1

output from phpinfo() shows:

_SERVER["argv"] Array
(
)

_SERVER["argc"] 0

which agrees with the $argc and $argv output.

details on the build include:

Build Date Jul 18 2002 08:29:02
Configure Command './configure' '--prefix=/usr/local/php'
'--with-config-file-path=/usr/local/bin/' '--enable-ftp' '--without-gd'
'--with-mysql'
Server API CGI

the php.ini shows register_globals on and register_argc_argv on

works fine if I call the php mod directly from the command line - and parses
the passed variable fine - just doesnt do it when called using the tick (or
system function) from Perl


Jim Carey
www.OZbcoz.com discount domain registration



> -----Original Message-----
> From: Sascha Cunz [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 11 October 2002 9:28 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Calling PHP (cgi) from a perl script and passsing
> parameters
>
>
> What you're referring is CLI, not CGI Version of PHP.
>
> Anyway, i assume, you're using a PHP version 4.2 or higher.
> Have a look at the $_SERVER['argc'] and $_SERVER['argv'].
>
> Sascha
>
> Am Donnerstag, 10. Oktober 2002 23:57 schrieb Jim Carey:
> > Hi,
> >
> > have been having problems passing parameters to a PHP script from a Perl
> > script . I call the PHP script using (as an example):
>
> > $a=`/home/ozbcoz/http/testphp.php fred=testing`;
> > print "$a";
> >
> >
> > then I have a PHP script showing:
> >
> > #!/usr/local/php/bin/php -q
> > <?
> >
> > print "count=$argc<br>";
> > print "0=$argv[0]<br>";
> > print "1=$argv[1]<br>";
> > print "2=$argv[2]<br>";
> > phpinfo();
> > ?>
> >
> > the outout comes out as:
> >
> > count=0
> > 0=
> > 1=
> > 2=
> > plus the phpinfo bumpf - which shows argc as 0 and an empty
> array for argv
> >
> > sny clues anyone ?
> >
> > Jim Carey
> > www.OZbcoz.com discount domain registration
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
Visit
http://javascript.internet.com/user-details/resolution-page.html
it'll be helpful.


"Stephen" <[EMAIL PROTECTED]> escribió en el mensaje
000e01c270a9$08ba5b90$0200a8c0@melchior">news:000e01c270a9$08ba5b90$0200a8c0@melchior...
Hello,

I forget exactly how to do this so I'm turning to you all for some help. How
can I make it so that if a user does not have a resolution of atleast
1024x768, it sends them to another page or recomends that they up their
screen size before viewing the page? Any help will be great. Thanks!

Thanks,
Stephen Craton
http://www.melchior.us


--- End Message ---
--- Begin Message ---
Hi, I've reinstalled my devel machine with RedHat 8.0.

After a cvs update of php I've decided to recompile
and install since the mod-php (which I did not
install) from RedHat is a little outdated :)

I've removed the config.cache, make clean and make.

The compilation was ok, but while trying to make
install

Installing PHP SAPI module
/usr/lib/httpd/build/instdso.sh
SH_LIBTOOL='/usr/lib/httpd/build/libtool' libphp4.la
/usr/lib/httpd/modules
sh: line 1: /usr/lib/httpd/build/instdso.sh: No such
file or directory
apxs:Error: Command failed with rc=8323072

Any tips.

I've searched the archives with no luck.

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
--- End Message ---
--- Begin Message ---
Okay, I took out all the reason for error, I took the variables out of the
code and replaced them with the actual values. I do not execute the gzip
function. All I get is an empty file. Also I made sure the back up directory
is set to 777.

Now phpMySQLAdmin will perform the same function, so there must be a way to
do this without the phpMySQLAdmin program? Has anyone tried to do what I am
trying to do? Has anyone tried with this code?

One more thing, I borrowed a free script written in perl that uses mysqldump
and it worked. The point here is that I want this to work in PHP so I can
include this code in a bigger application I am writing.

Thanks for all your ideas!


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
000001c27058$c1770170$7c02a8c0@coconut">news:000001c27058$c1770170$7c02a8c0@coconut...
> > Okay here is the new code and this is still not working.
> >
> > <?php
> >
> > require("./config.php");
> >
> > $sqlserver = $server1;
> > $sqlusername = $username1;
> > $sqlpassword = $password1;
> > $sqldatabase = $database1;
> >
> > //******************************
> > $nam_bak=date('D,d-m-Y');
>
> Can you have a filename with a comma in it?
>
> > exec("mysqldump -u\"$sqlusername\" -p\"$sqlpassword\" \"$sqldatabase\"
> >
> > $backupdir/$nam.sql");
>
> Take out the \" quotes around username, password, and database.
>
> >
> > exec("gzip $backupdir/$nam.sql");
>
> ---John Holmes...
>
>


--- End Message ---
--- Begin Message ---
Jason,

I had trouble with PDFLib too, and I turned to this site for help! I found
this much easier to implement and the webmaster will give you lots of help!!

http://ros.co.nz/pdf/

This does not use PDFLib.

"Jason Morehouse" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I've got a pretty detailed PDF that I need to dynamically re-create with
> PHP / pdflib.  Before I sit around for endless hours inputing x, y, fonts
and line
> coordinates, is there *any* tool that can help automate this?
>
> Basically, the miracle I'm looking for would take a PDF file, and export
> it to PHP code that can reproduce it -- or something along that line.
>
> Thanks in Advance!
> -J
>
> --
>  Jason Morehouse (jm[ät]netconcepts[döt]com)
>  Netconcepts - http://www.netconcepts.com
>  Auckland, New Zealand
>  Linux: Because rebooting is for adding hardware.
>


--- End Message ---
--- Begin Message ---
Sorry I am working with flat file records.  I have put all the records in an
array, but would I be able to keep the values in the array and loop thru it
for the subsequent pages (by calling the same page itself)?

Thanks.


"Dol" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
>
> I would like to fixed the number of records for example 10 to be display
on
> a web page.  That is when there is more than 10 records, I would like to
> display a "2" for user to click on to display the second page starting
with
> record number 11, and so on.
>
> Appreciate if someone can share their experience.
>
> Thanks
>
>


--- End Message ---
--- Begin Message ---
I've been using php for a while now, and I've made plenty of web sites 
in that time.  But there's been a nagging problem: the best way to put a 
layout and global code on each page.  My first site had two .txt files 
with header and footer code which were fopen()ed (with absolute paths!) 
and eval()ed on each page at the top and bottom - not the best option! 
 Even if I include()d them and made them .php, that approach would still 
have some problems.  No way to get the global code without the layout, 
and no way to die() and use the layout in functions without knowing what 
variables it needs (for globalizing them).  Right now, I'm doing 
something like this:

    <?php
    include("include.php"); //This contains the database connection code
    and whatever other global code, as well as the layout functions.
    doheader(); //This function contains the top of the layout.
    //Do whatever the page does
    dofooter(); //This function contains the bottom of the layout
    ?>

There are still problems with this, though.  No way to use global code 
at the bottom of the page, for one thing.  I've also considered 
something like:

    <?php
    $uselayout = true; //Set whether this page wants the layout or not.
    include("include.php");
    headercode(); //Database connection and whatever other global code
    that goes at the top, as well as the layout if $uselayout is true.
    //Whatever this page does goes here.
    footercode(); //Whatever global code that goes at the bottom goes
    here, as well as the layout if $uselayout is true.
    ?>

I can't find any problems with this approach, what are everyone;'s 
thoughts on this?

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

--- End Message ---
--- Begin Message ---
What i usually do, is make a file layout.php with a couple of 
functions, header() footer() etc.

then i include ('layout.php') and call the functions when i need them

and i can send things to the header, like the page title etc.

include ('layout.php');
header("Home");
        blablablab
footer();

i hope this is about what you mean

Jule

On Thursday, Oct 10, 2002, at 23:00 US/Eastern, Leif K-Brooks wrote:

> I've been using php for a while now, and I've made plenty of web sites 
> in that time.  But there's been a nagging problem: the best way to put 
> a
>
> layout and global code on each page.  My first site had two .txt files 
> with header and footer code which were fopen()ed (with absolute 
> paths!) and eval()ed on each page at the top and bottom - not the best 
> option! Even if I include()d them and made them .php, that approach 
> would still
>
> have some problems.  No way to get the global code without the layout, 
> and no way to die() and use the layout in functions without knowing 
> what
>
> variables it needs (for globalizing them).  Right now, I'm doing 
> something like this:
>
>    <?php
>    include("include.php"); //This contains the database connection code
>    and whatever other global code, as well as the layout functions.
>    doheader(); //This function contains the top of the layout.
>    //Do whatever the page does
>    dofooter(); //This function contains the bottom of the layout
>    ?>
>
> There are still problems with this, though.  No way to use global code 
> at the bottom of the page, for one thing.  I've also considered 
> something like:
>
>    <?php
>    $uselayout = true; //Set whether this page wants the layout or not.
>    include("include.php");
>    headercode(); //Database connection and whatever other global code
>    that goes at the top, as well as the layout if $uselayout is true.
>    //Whatever this page does goes here.
>    footercode(); //Whatever global code that goes at the bottom goes
>    here, as well as the layout if $uselayout is true.
>    ?>
>
> I can't find any problems with this approach, what are everyone;'s 
> thoughts on this?
>
> -- 
> 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.
>
>
Jule Slootbeek
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Ok, then I honestly don't understand why anyone would rather write this

echo "<a href='" . $myURL . "home'>Go home</a>";

instead of this

echo "<a href='$myURL/home'>Go home</a>";

IMHO, the second comes more natural to write, is easier to understand at 
a glance, is less prone to errors and, well, it's shorter!

Bogdan

@ Edwin wrote:
> Not exactly. Single quotes are fine. I missed the fact that the single
> quotes here
> 
> 
>>>echo("<A HREF='$my_URLhome'>Go home</A>");
> 
> 
> will be included in the source--sorry about that.
> 
> Well, then, to rewrite the code earlier,
> 
> 
>>echo '<a href="' . $my_URL . 'home">Go home</a>';
> 
> 
> this way:
> 
>   echo "<a href='" . $myURL . "home'>Go home</a>";
> 
> that would still not give you the "trailing slash" problem. In other words,
> it's just a matter of how you write the code... ;)
> 
> - E
> 
> On Friday, October 11, 2002 1:06 AM
> Bogdan Stancescu wrote:
> 
> 
>>I'm not sure exactly what you're trying to point out - does XHTML
>>require double quotes?
>>
>>Bogdan
>>
>>@ Edwin wrote:
>>
>>>Just a thought...
>>>
>>>If you're going to write an XHTML compatible code, you wouldn't really
> 
> have
> 
>>>this problem -->
>>>
>>>>  echo("<A HREF='$my_URLhome'>Go home</A>");
>>>
>>>
>>>since you'll probably write something like this:
>>>
>>>  echo '<a href="' . $my_URL . 'home">Go home</a>'; >
>>>Of course, I didn't mean that you can't do that with HTML...
> 
> [snip]

--- End Message ---
--- Begin Message ---
Well, I agree about what you said

> IMHO, the second comes more natural to write, is easier to understand at
> a glance, is less prone to errors and, well, it's shorter!

but remember the topic is about whether the trailing slash would create a
problem or not.

I think you're aware that there are some servers are not configured to
understand that

  http://www.domain.com/somefolder

is equal to http://www.domain.com/somefolder/ . So, NOT having the trailing
slash might even create some problems.

So, it's a matter of opinion (and use) whether adding a trailing slash would
create a problem or not. So imagine how this code will work:

  echo "<a href='$theURL'>Go to some folder</a>";

- E

On Friday, October 11, 2002 2:28 PM
Bogdan Stancescu wrote:
> Ok, then I honestly don't understand why anyone would rather write this
>
> echo "<a href='" . $myURL . "home'>Go home</a>";
>
> instead of this
>
> echo "<a href='$myURL/home'>Go home</a>";
>
> IMHO, the second comes more natural to write, is easier to understand at
> a glance, is less prone to errors and, well, it's shorter!
>
> Bogdan
>
> @ Edwin wrote:
> > Not exactly. Single quotes are fine. I missed the fact that the single
> > quotes here
> >
> >
> >>>echo("<A HREF='$my_URLhome'>Go home</A>");
> >
> >
> > will be included in the source--sorry about that.
> >
> > Well, then, to rewrite the code earlier,
> >
> >
> >>echo '<a href="' . $my_URL . 'home">Go home</a>';
> >
> >
> > this way:
> >
> >   echo "<a href='" . $myURL . "home'>Go home</a>";
> >
> > that would still not give you the "trailing slash" problem. In other
words,
> > it's just a matter of how you write the code... ;)
> >
> > - E
> >
> > On Friday, October 11, 2002 1:06 AM
> > Bogdan Stancescu wrote:
> >
> >
> >>I'm not sure exactly what you're trying to point out - does XHTML
> >>require double quotes?
> >>
> >>Bogdan
> >>
> >>@ Edwin wrote:
> >>
> >>>Just a thought...
> >>>
> >>>If you're going to write an XHTML compatible code, you wouldn't really
> >
> > have
> >
> >>>this problem -->
> >>>
> >>>>  echo("<A HREF='$my_URLhome'>Go home</A>");
> >>>
> >>>
> >>>since you'll probably write something like this:
> >>>
> >>>  echo '<a href="' . $my_URL . 'home">Go home</a>'; >
> >>>Of course, I didn't mean that you can't do that with HTML...
> >
> > [snip]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
If you really need to get picky, then I shall... well, point out the 
obvious:

    echo "<a href='$theURL/'>Go to some folder</a>";

And since we got into this, there are some servers where you don't have 
control over http config, so you shouldn't want to link to directories 
at all - you'd want to specify the exact file to link to, as in

    echo "<a href='$theURL/index.php'>Go to some folder</a>";

Bogdan

@ Edwin wrote:
> Well, I agree about what you said
> 
> 
>>IMHO, the second comes more natural to write, is easier to understand at
>>a glance, is less prone to errors and, well, it's shorter!
> 
> 
> but remember the topic is about whether the trailing slash would create a
> problem or not.
> 
> I think you're aware that there are some servers are not configured to
> understand that
> 
>   http://www.domain.com/somefolder
> 
> is equal to http://www.domain.com/somefolder/ . So, NOT having the trailing
> slash might even create some problems.
> 
> So, it's a matter of opinion (and use) whether adding a trailing slash would
> create a problem or not. So imagine how this code will work:
> 
>   echo "<a href='$theURL'>Go to some folder</a>";
> 
> - E
> 
> On Friday, October 11, 2002 2:28 PM
> Bogdan Stancescu wrote:
> 
>>Ok, then I honestly don't understand why anyone would rather write this
>>
>>echo "<a href='" . $myURL . "home'>Go home</a>";
>>
>>instead of this
>>
>>echo "<a href='$myURL/home'>Go home</a>";
>>
>>IMHO, the second comes more natural to write, is easier to understand at
>>a glance, is less prone to errors and, well, it's shorter!
>>
>>Bogdan
>>
>>@ Edwin wrote:
>>
>>>Not exactly. Single quotes are fine. I missed the fact that the single
>>>quotes here
>>>
>>>
>>>
>>>>>echo("<A HREF='$my_URLhome'>Go home</A>");
>>>
>>>
>>>will be included in the source--sorry about that.
>>>
>>>Well, then, to rewrite the code earlier,
>>>
>>>
>>>
>>>>echo '<a href="' . $my_URL . 'home">Go home</a>';
>>>
>>>
>>>this way:
>>>
>>>  echo "<a href='" . $myURL . "home'>Go home</a>";
>>>
>>>that would still not give you the "trailing slash" problem. In other
> 
> words,
> 
>>>it's just a matter of how you write the code... ;)
>>>
>>>- E
>>>
>>>On Friday, October 11, 2002 1:06 AM
>>>Bogdan Stancescu wrote:
>>>
>>>
>>>
>>>>I'm not sure exactly what you're trying to point out - does XHTML
>>>>require double quotes?
>>>>
>>>>Bogdan
>>>>
>>>>@ Edwin wrote:
>>>>
>>>>
>>>>>Just a thought...
>>>>>
>>>>>If you're going to write an XHTML compatible code, you wouldn't really
>>>
>>>have
>>>
>>>
>>>>>this problem -->
>>>>>
>>>>>> echo("<A HREF='$my_URLhome'>Go home</A>");
>>>>>
>>>>>
>>>>>since you'll probably write something like this:
>>>>>
>>>>> echo '<a href="' . $my_URL . 'home">Go home</a>'; >
>>>>>Of course, I didn't mean that you can't do that with HTML...
>>>
>>>[snip]
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>

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

"Daniel Masson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]
...
> No way man !!
>   hai ,
>        I want to create an animated line in php from (x,y) to
> (x1,y1).will
>   php support animation.if so how do i go about in doing this.how do i
>   draw a char so that it keeps on changing colors till i close browser.
>               thanks for help
>                  Arun

You could use php to generate JS or Flash (via ming)


--- End Message ---
--- Begin Message ---
I am at my wits end at the moment. I am pulling a datetimestamp out of a 
database and attempting to get the year month and day out of it. However 
  I am stumped as how to do it.

The format is "YYYY-MM-DD HH:MM:SS" and its coming out of a mySQL 
database. Is there anyway I can get the information I need out of here?

I have tried $nday = date("d", $row[2]) and so on but all i get out of 
that is Year = 1970, Month = 01, Day = 01.

Heres the code Im using now with getdate()

while($row = mysql_fetch_row($fres))
{
        print($row[2]);
        $odate = getdate($row[2]);
        print($odate['mday']."<br />");
        $oday = date("d", $odate);
        print($odate['mon']."<br />");
        $omonth = date("m", $odate);
        print($odate['year']."<br />");
        $oyear = date("Y", $odate);
        print($oyear."<br />");
}

Any help would be appreciated.

James
                

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

Friday, October 11, 2002, 3:53:55 PM, you wrote:
JP> I am at my wits end at the moment. I am pulling a datetimestamp out of a 
JP> database and attempting to get the year month and day out of it. However 
JP>   I am stumped as how to do it.

JP> The format is "YYYY-MM-DD HH:MM:SS" and its coming out of a mySQL 
JP> database. Is there anyway I can get the information I need out of here?

JP> I have tried $nday = date("d", $row[2]) and so on but all i get out of 
JP> that is Year = 1970, Month = 01, Day = 01.

JP> Heres the code Im using now with getdate()

JP> while($row = mysql_fetch_row($fres))
JP> {
JP>         print($row[2]);
JP>         $odate = getdate($row[2]);
JP>         print($odate['mday']."<br />");
JP>         $oday = date("d", $odate);
JP>         print($odate['mon']."<br />");
JP>         $omonth = date("m", $odate);
JP>         print($odate['year']."<br />");
JP>         $oyear = date("Y", $odate);
JP>         print($oyear."<br />");
JP> }

JP> Any help would be appreciated.

JP> James
                

Try this

$ts = strtotime($row[2]);//get a unix timestamp
$day = date("d",$ts);

-- 
regards,
Tom

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

 > I am at my wits end at the moment. I am pulling a 
 > datetimestamp out of a database and attempting to 
 > get the year month and day out of it.

Do it in your sql query.  Check out chapter 6 of the MySQL manual for
ways to manipulate dates.

Eg.  $query = "select DATE_FORMAT(DTStamp, '%e %b %y') AS DispDate WHERE
some=condition";

Will get you a date as day month year.  There's heaps of options and you
should probably read up on them.

CYA, Dave



--- End Message ---
--- Begin Message ---
Hi Ulf Rompe,

On Tue, 08 Oct 2002 12:10:15 +0200, you wrote about "[PHP] Re:
Capitalizing names ... needs the final touch..." something that looked
like this:

>"-<[ Rene Brehmer ]>-" <[EMAIL PROTECTED]> writes:
>
>>    Firstname Middlename Last-name
>>
>> But I want the last namepart after the slash (-name) to also start
>> with a capital letter.
>
>Just read the comments on ucwords() in the PHP manual, especially the
>one from Joerg Krause. He writes:
>
>| None of the examples above recognizes characters normally used as
>| delimiters. The following uses a regular expression, which is easy to
>| extend, to create an array with the parts of a text. Then it runs the
>| ucfirst-function for each part an implode the array:
>| 
>| $text = "What?No delimiters,shit happens here.this solves all problems.";
>| preg_match_all("/(\w+[,. ?])+/U", $text, $words);
>| foreach($words[0] as $part) $uwords[] = ucfirst($part);
>| $text = implode("", $uwords);
>| echo $text;
>
>All you have to do is adding the "-" to the character class.
>
>> Isn't there some easy way to do this? If I have to go through a FOR
>> routine, it kinda ruins the idea of ucwords() in the first place, so
>> I'd rather avoid that if at all possible.
>
>I doubt the loop will be much slower than ucwords().
>
>> Also, I'd like it to correctly be able to also correctly capitalize
>> Irish and Scottish names (like O'Connor, and MacDonald).
>
>The O'Connor is no problem, just add "'" to the character class. The
>MacDonald is a bit harder to solve. The above function will be of no
>help, and just matching for "Mac\w*" won't work since it would also
>match other names like "Macke". I think you will have to match these
>names against a list of possible words with mid word capitalization.
>
>[x] ulf
>
>-- 
>If you can stay calm, while all around you is chaos... then you 
>probably haven't completely understood the seriousness of the situation.

-- 
Rene Brehmer
System developer in the making...

This message was written on 100% recycled spam.

My website: http://www.geocities.com/cerberus_hotdog
Babes and computer & internet references...
--- End Message ---
--- Begin Message ---
Any idea what that error means?  I'm trying to do something like:
$array[] = array(a => "a value");

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


--- End Message ---
--- Begin Message ---
I am using quotes around the key, just a dumb mistake in the example...

Leif K-Brooks wrote:

> Any idea what that error means?  I'm trying to do something like:
> $array[] = array(a => "a value");
>

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



--- End Message ---
--- Begin Message ---
That piece of code works. Maybe you could be so kind as to post the 
exact piece of code which doesn't work? If it's not too much to ask, of 
course.

Bogdan

Leif K-Brooks wrote:
> Any idea what that error means?  I'm trying to do something like:
> $array[] = array(a => "a value");
> 

--- End Message ---
--- Begin Message ---
$actions[] = array("display" => "Discard");

Bogdan Stancescu wrote:

> That piece of code works. Maybe you could be so kind as to post the 
> exact piece of code which doesn't work? If it's not too much to ask, 
> of course.
>
> Bogdan
>
> Leif K-Brooks wrote:
>
>> Any idea what that error means?  I'm trying to do something like:
>> $array[] = array(a => "a value");
>>
>
>

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



--- End Message ---
--- Begin Message ---
It works both with and without quotes around the key. Which is normal - 
you will be amazed at how forgiving PHP is - try this:

<?
   echo(test);
?>

Bogdan

Leif K-Brooks wrote:
> I am using quotes around the key, just a dumb mistake in the example...
> 
> Leif K-Brooks wrote:
> 
>> Any idea what that error means?  I'm trying to do something like:
>> $array[] = array(a => "a value");
>>
> 

--- End Message ---
--- Begin Message ---
Yup, that works as well. You could try a debugging echo after that line 
and see if it gets executed. You probably have a problem somewhere else.

Bogdan

Leif K-Brooks wrote:
> $actions[] = array("display" => "Discard");
> 
> Bogdan Stancescu wrote:
> 
>> That piece of code works. Maybe you could be so kind as to post the 
>> exact piece of code which doesn't work? If it's not too much to ask, 
>> of course.
>>
>> Bogdan
>>
>> Leif K-Brooks wrote:
>>
>>> Any idea what that error means?  I'm trying to do something like:
>>> $array[] = array(a => "a value");
>>>
>>
>>
> 

--- End Message ---
--- Begin Message ---
I am having difficulty managing forms. for example I have a table builder
class which builds me a table of a query with all the bells and whistles to
make it editable etc. so it creates it's own form to build itself on,
then I have a dateselector class which builds a nice little graphic date
selector, this also uses it's own form as it is not always in a table - it
can be anywhere - as far as I know you can't have a form in a form so I am
cheating a bit at the moment and only creating the dateselector after the
table on a div then moving it into place..
This is working for me, but being a relative newbie I am sure there is a
better way to handling forms.
Any ideas, comments appreciated.
Thanks
_____________________________________
Simon Taylor
AfriTol (Pty) Ltd.
?  [EMAIL PROTECTED]
Å+27 12 361 3303 ext 257
Å+27 72 471 1833
Æ+27 12 365 3810
 
--- End Message ---
--- Begin Message ---
i have some trouble with mssql_result cause it will return me a result
limitted at 255 char max.

in my php.ini i set this value :
mssql.textsize=65536
mssql.textlimit=65536

and in SQLSERVER my field type is VARCHAR(2048)

can you help me please ???


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

I am having problems downloading files using PHP. The download part
works correctly but when I try to browse other links (using IE only,
Netscape works fine) they get stuck. I am using frames. It all works
fine when I reload the page from where I download files.

Is there any way to split up content using PHP? One part gets downloaded
while another part is displayed in the resulting frame.

I have read an RFC and it should work but none of the browsers do as I
want them to so I am doing something wrong. Does anyone have an example?

Archie

---
Archibald Zimonyi
[EMAIL PROTECTED]

"There is no logic like no logic"

--- End Message ---
--- Begin Message ---
Hi everyone

I'm having terrible trouble compiling PHP with net-snmp:

  /bin/sh /usr/local/src/php-4.2.3/libtool --silent --mode=compile gcc  -I.
  -I/usr/local/src/php-4.2.3/ext/snmp -I/usr/local/src/php-4.2.3/main
  -I/usr/local/src/php-4.2.3 -I/usr/local/apache/include
  -I/usr/local/src/php-4.2.3/Zend -I/usr/local/include
  -I/usr/local/mysql/include/mysql -I/usr/local/pdflib/include
  -I/usr/local/snmp/include -I/usr/local/src/php-4.2.3/ext/xml/expat
  -DLINUX=22 -DMOD_SSL=208111 -DUSE_HSREGEX -DEAPI -DUSE_EXPAT
  -I/usr/local/src/php-4.2.3/TSRM -g -O2 -prefer-pic  -c snmp.c
  snmp.c:62: asn1.h: No such file or directory
  snmp.c:63: snmp_api.h: No such file or directory
  snmp.c:64: snmp_client.h: No such file or directory
  snmp.c:65: snmp_impl.h: No such file or directory
  snmp.c:66: snmp.h: No such file or directory
  snmp.c:67: parse.h: No such file or directory
  snmp.c:68: mib.h: No such file or directory
  snmp.c:69: version.h: No such file or directory

These missing .h files are in a subdirectory called 'include/net-snmp/library'
on net-snmp 5.0.6, but on ucd-snmp 4.2.6, 'include/ucd-snmp/library'.

I'm no great coder, so when I tried hacking the .c file to point to the
location of the new headers, I came up against unresolved symbols whilst
compiling.

Has anybody successfuly compiled php with net-snmp? Can anybody help me track
down the problem and hopefully come up with a patch?

Best wishes,


Peter.

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

PHP 4.1.X

I'm trying, during the session time, to change the value of 2 session
variables:

My first attempt was simply like this:

$sess_client = $theClient;
$sess_ref_clientFact = $theRefClient;

...but following pages still get old values from the session variables.

Then I tried this:

    session_unregister("sess_client");
    session_unregister("sess_ref_clientFact");
    $sess_client = $ClientName;
    $sess_ref_clientFact = $ClientRef;
    session_register("sess_client");
    session_register("sess_ref_clientFact");

Same, following pages get old values from these 2 session variables...

I would appreciate if I could get some help ?

Thanks.

-------------------
Stéphane Pinel
[EMAIL PROTECTED]
iChat : [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hiya,
Try using $_SESSION['variablename']
To refer to session variables.
Cheers
Simon

-----Original Message-----
From: Stéphane Pinel [mailto:[EMAIL PROTECTED]] 
Sent: 11 October 2002 11:16
To: [EMAIL PROTECTED]
Subject: [PHP] Updating session variables values during session


Hi,

PHP 4.1.X

I'm trying, during the session time, to change the value of 2 session
variables:

My first attempt was simply like this:

$sess_client = $theClient;
$sess_ref_clientFact = $theRefClient;

...but following pages still get old values from the session variables.

Then I tried this:

    session_unregister("sess_client");
    session_unregister("sess_ref_clientFact");
    $sess_client = $ClientName;
    $sess_ref_clientFact = $ClientRef;
    session_register("sess_client");
    session_register("sess_ref_clientFact");

Same, following pages get old values from these 2 session variables...

I would appreciate if I could get some help ?

Thanks.

-------------------
Stéphane Pinel
[EMAIL PROTECTED]
iChat : [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Same problem...

Thanks.

-------------------
Stéphane Pinel
[EMAIL PROTECTED]
iChat : [EMAIL PROTECTED]



Le 11/10/02 11:26, « Simon Taylor » <[EMAIL PROTECTED]> a écrit :

> Hiya,
> Try using $_SESSION['variablename']
> To refer to session variables.
> Cheers
> Simon
> 
> -----Original Message-----
> From: Stéphane Pinel [mailto:[EMAIL PROTECTED]]
> Sent: 11 October 2002 11:16
> To: [EMAIL PROTECTED]
> Subject: [PHP] Updating session variables values during session
> 
> 
> Hi,
> 
> PHP 4.1.X
> 
> I'm trying, during the session time, to change the value of 2 session
> variables:
> 
> My first attempt was simply like this:
> 
> $sess_client = $theClient;
> $sess_ref_clientFact = $theRefClient;
> 
> ...but following pages still get old values from the session variables.
> 
> Then I tried this:
> 
>   session_unregister("sess_client");
>   session_unregister("sess_ref_clientFact");
>   $sess_client = $ClientName;
>   $sess_ref_clientFact = $ClientRef;
>   session_register("sess_client");
>   session_register("sess_ref_clientFact");
> 
> Same, following pages get old values from these 2 session variables...
> 
> I would appreciate if I could get some help ?
> 
> Thanks.
> 
> -------------------
> Stéphane Pinel
> [EMAIL PROTECTED]
> iChat : [EMAIL PROTECTED]
> 

--- End Message ---
--- Begin Message ---
Have you tried it like this?
 $_SESSION['sess_client'] = $ClientName;
 $_SESSION['sess_ref_clientFact'] = $ClientRef;

If it still gives you the old vars I would look at where the $ClientName and
$ClientRef are coming from.
-----Original Message-----
From: Stéphane Pinel [mailto:[EMAIL PROTECTED]] 
Sent: 11 October 2002 11:32
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Updating session variables values during session


Same problem...

Thanks.

-------------------
Stéphane Pinel
[EMAIL PROTECTED]
iChat : [EMAIL PROTECTED]



Le 11/10/02 11:26, « Simon Taylor » <[EMAIL PROTECTED]> a écrit :

> Hiya,
> Try using $_SESSION['variablename']
> To refer to session variables.
> Cheers
> Simon
> 
> -----Original Message-----
> From: Stéphane Pinel [mailto:[EMAIL PROTECTED]]
> Sent: 11 October 2002 11:16
> To: [EMAIL PROTECTED]
> Subject: [PHP] Updating session variables values during session
> 
> 
> Hi,
> 
> PHP 4.1.X
> 
> I'm trying, during the session time, to change the value of 2 session
> variables:
> 
> My first attempt was simply like this:
> 
> $sess_client = $theClient;
> $sess_ref_clientFact = $theRefClient;
> 
> ...but following pages still get old values from the session 
> variables.
> 
> Then I tried this:
> 
>   session_unregister("sess_client");
>   session_unregister("sess_ref_clientFact");
>   $sess_client = $ClientName;
>   $sess_ref_clientFact = $ClientRef;
>   session_register("sess_client");
>   session_register("sess_ref_clientFact");
> 
> Same, following pages get old values from these 2 session variables...
> 
> I would appreciate if I could get some help ?
> 
> Thanks.
> 
> -------------------
> Stéphane Pinel
> [EMAIL PROTECTED]
> iChat : [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Le 11/10/02 11:39, « Simon Taylor » <[EMAIL PROTECTED]> a écrit :

> Have you tried it like this?
> $_SESSION['sess_client'] = $ClientName;
> $_SESSION['sess_ref_clientFact'] = $ClientRef;

Yes...but it doesn't work.

> 
> If it still gives you the old vars I would look at where the $ClientName and
> $ClientRef are coming from.

At first view, $ClientName and $ClientRef come from a link in the previous
page:

togglecl.php?ClientName=A&ClientRef=B

Then $ClientName is different than session variable $sess_client . That's
why I'm trying to put the $ClientName value to $sess_client session
variable.

Again, Thanks.

-------------------
Stéphane Pinel
[EMAIL PROTECTED]
iChat : [EMAIL PROTECTED]

> -----Original Message-----
> From: Stéphane Pinel [mailto:[EMAIL PROTECTED]]
> Sent: 11 October 2002 11:32
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Updating session variables values during session
> 
> 
> Same problem...
> 
> Thanks.
> 
> -------------------
> Stéphane Pinel
> [EMAIL PROTECTED]
> iChat : [EMAIL PROTECTED]
> 
> 
> 
> Le 11/10/02 11:26, « Simon Taylor » <[EMAIL PROTECTED]> a écrit :
> 
>> Hiya,
>> Try using $_SESSION['variablename']
>> To refer to session variables.
>> Cheers
>> Simon
>> 
>> -----Original Message-----
>> From: Stéphane Pinel [mailto:[EMAIL PROTECTED]]
>> Sent: 11 October 2002 11:16
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] Updating session variables values during session
>> 
>> 
>> Hi,
>> 
>> PHP 4.1.X
>> 
>> I'm trying, during the session time, to change the value of 2 session
>> variables:
>> 
>> My first attempt was simply like this:
>> 
>> $sess_client = $theClient;
>> $sess_ref_clientFact = $theRefClient;
>> 
>> ...but following pages still get old values from the session
>> variables.
>> 
>> Then I tried this:
>> 
>>   session_unregister("sess_client");
>>   session_unregister("sess_ref_clientFact");
>>   $sess_client = $ClientName;
>>   $sess_ref_clientFact = $ClientRef;
>>   session_register("sess_client");
>>   session_register("sess_ref_clientFact");
>> 
>> Same, following pages get old values from these 2 session variables...
>> 
>> I would appreciate if I could get some help ?
>> 
>> Thanks.
>> 
>> -------------------
>> Stéphane Pinel
>> [EMAIL PROTECTED]
>> iChat : [EMAIL PROTECTED]
>> 
> 



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

1) I wake up too early this morning
2) I've lost my glasses
3) I forgot... Session_start()

...shame on me...

Thanks to all.

Regards.

-------------------
Stéphane Pinel
[EMAIL PROTECTED]
iChat : [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hehe - no prob - you can also set it to always start in php.ini if it suits
your needs.
Cheers
Simon

-----Original Message-----
From: Stéphane Pinel [mailto:[EMAIL PROTECTED]] 
Sent: 11 October 2002 12:10
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Updating session variables (resolced: shame on me)



1) I wake up too early this morning
2) I've lost my glasses
3) I forgot... Session_start()

...shame on me...

Thanks to all.

Regards.

-------------------
Stéphane Pinel
[EMAIL PROTECTED]
iChat : [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Just created a Mozilla keyword for the php manual, after being too lazy 
for too long, so here it is, in case anyone else finds it useful:

http://www.php.net/search.php?show=quickref&pattern=%s

The keyword is obviously php (at least in my case). Since I already 
spammed you with this, here are a couple of others I use:

Dictionary
http://dictionary.com/search?q=%s

Google Feeling Lucky
http://www.google.com/search?btnI=1&q=%s

And, in case you don't know about bookmarklets, here's a link: 
http://www.squarefree.com/bookmarklets/

Hope this helps somebody...

Bogdan

--- End Message ---

Reply via email to