OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Thu Oct 31 2002 - 12:16:37 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 31 Oct 2002 18:16:37 -0000 Issue 1677

    Topics (messages 122198 through 122296):

    test
            122198 by: joskey
            122201 by: joskey
            122202 by: John Meyer
            122203 by: Leif K-Brooks
            122204 by: Khalid El-Kary

    Problems with sessions
            122199 by: Tomas Kubis

    problem with global vars
            122200 by: Tomas Kubis
            122225 by: Marek Kilimajer

    Re: Plug-in strategies?
            122205 by: Charles Wiltgen

    .htaccess and mod rewrite.
            122206 by: Brendon G
            122207 by: John Nichel

    Re: XML to MS Word
            122208 by: Charles Wiltgen
            122209 by: Manuel Lemos

    Re: Yet another question
            122210 by: user.domain.invalid

    mixed
            122211 by: Shaun
            122229 by: Marek Kilimajer
            122233 by: John W. Holmes

    My mail have a problem!!
            122212 by: joskey
            122213 by: John Nichel
            122239 by: -<[ Rene Brehmer ]>-

    Re: File Upload Problem
            122214 by: David Robley
            122244 by: Richard Archer

    Anything wrong with this function?
            122215 by: Steve Jackson
            122216 by: John Nichel
            122218 by: John Nichel

    Re: SAP documentation
            122217 by: Gerald Roehrbein/Pctdmn

    Re: parse error
            122219 by: Marek Kilimajer

    Re: Plus sign changing to space in html form
            122220 by: Phoebe Bright
            122235 by: Phoebe Bright

    Re: can OCIBindByName bind an in/out placeholder of plsql
            122221 by: DIGINEXT
            122224 by: DIGINEXT
            122226 by: DIGINEXT
            122232 by: DIGINEXT

    Re: infinate loops
            122222 by: Marek Kilimajer

    Re: paper size print problem
            122223 by: Marek Kilimajer

    This is a test mail for my mail list!
            122227 by: jianking

    At last an error message!
            122228 by: Steve Jackson
            122230 by: Marek Kilimajer
            122250 by: Pekka Saarinen

    Re: Capitalizing names etc. part II - found a solution
            122231 by: Ford, Mike [LSS]
            122240 by: Richard Archer

    Re: Php web hosting
            122234 by: -<[ Rene Brehmer ]>-
            122236 by: Richard Archer
            122252 by: Adam Voigt
            122253 by: Clint Tredway

    Re: Multiple Addresses Mailer
            122237 by: -<[ Rene Brehmer ]>-
            122238 by: -<[ Rene Brehmer ]>-
            122262 by: olinux

    storing inc.php outside doc root
            122241 by: rolf vreijdenberger
            122242 by: Marek Kilimajer

    Re: How to prevent failure email from being sent?
            122243 by: Richard Archer

    Re: Free compiler for Win
            122245 by: Richard Archer

    How do you select?
            122246 by: Steve Jackson
            122248 by: Jon Haworth
            122249 by: Erwin

    Re: CSS pulls me back in
            122247 by: Liam.Gibbs.dfait-maeci.gc.ca

    search tricks of the trade
            122251 by: Edward Peloke
            122254 by: PHP List

    Missing
            122255 by: Adam Voigt
            122269 by: Chris Hewitt
            122270 by: Adam Voigt

    Who can tell me where I can get the cracked Zend Encoder3.0 ?
            122256 by: jianking
            122258 by: John W. Holmes
            122259 by: John Wards
            122260 by: Cory Hicks
            122271 by: Brian V Bonini

    Re: Need help...
            122257 by: BAROILLER Pierre-Emmanuel

    wow
            122261 by: Evan Nemerson
            122265 by: Evan Nemerson

    RE:[Not even in the topic ballpark] [PHP] wow
            122263 by: Jay Blanchard

    date validation problem!
            122264 by: ppf
            122266 by: Jon Haworth
            122281 by: John W. Holmes

    Is there an ISP that supports GD Library 2.0?
            122267 by: René Fournier
            122276 by: Evan Nemerson
            122279 by: evan.coeus-group.com

    String to Ascii
            122268 by: Ben Chivers
            122277 by: Evan Nemerson

    Re: Variable over url
            122272 by: Sascha Cunz

    Stop At Return
            122273 by: Adam Voigt
            122278 by: Evan Nemerson

    strtotime bug? end of the month.
            122274 by: Jeff Bearer
            122275 by: Adam Voigt
            122280 by: John W. Holmes
            122284 by: Michael Hazelden
            122294 by: Jeff Bearer

    Changing the key
            122282 by: John Meyer
            122283 by: John W. Holmes

    How to set paper size for PDF?
            122285 by: Drew Kime

    unlink function
            122286 by: Andres, Cyrille
            122287 by: Adam Voigt
            122290 by: Evan Nemerson

    stipslashes
            122288 by: ed.home.homes2see.com

    ^M at the end of each line when I use php to write file
            122289 by: Brandon Orther
            122292 by: Evan Nemerson

    command to determine the end of a page?
            122291 by: Jeff Bluemel
            122293 by: Adam Voigt
            122295 by: Evan Nemerson
            122296 by: Jay Blanchard

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    test

    attached mail follows:


    test

    attached mail follows:


    Do I get a cookie for passing this test?

    attached mail follows:


    I'll give you one instead...
    setcookie("yourcookie","here it is!");

    John Meyer wrote:

    >Do I get a cookie for passing this test?
    >
    >
    >

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

    attached mail follows:


    hey it's a PHP mailing list, people here are developers, you must send something with action inside it like this

    "Testing 5 Testing 5" "Testing and awaiting for server response" even if youa ren't awaiting "Loading ..."

    :))

    _________________________________________________________________ Get faster connections -- switch to MSN Internet Access! http://resourcecenter.msn.com/access/plans/default.asp

    attached mail follows:


    Hello, I have big problem. I upgraded PHP from 4.1.2 to 4.2.3 and my scripts with doesn´t work. Please help me! in php.info register globals=On

    I have two sripts:

    first.php <? session_start(); $ID = $txtusername . md5(microtime()); session_register('ID'); ... .... Header("Location: second.php"); ?>

    second.php

    <? ..... .....SELECT uzivatel from uzivatele WHERE md_hash='$ID'; ?>

    In second.php ID is empty; but in previous version of php work it ok??

    thanks Tomas Kubis

    attached mail follows:


    Hello, I have big problem. I upgraded PHP from 4.1.2 to 4.2.3 and my scripts with doesn´t work. Please help me! in php.info register globals=On

    For example I have one script: first.php <? global $a; $a=150; Header("Location: second.php"); ?>

    second.php

    <? echo $a; echo $GLOBALS['a']; echo "END"; ?>

    Where I have a bug?

    Thank you very much

    Tomas Kubis

    attached mail follows:


    globals don't don't persist between requests

    Tomas Kubis wrote:

    >Hello, > I have big problem. I upgraded PHP from 4.1.2 to 4.2.3 and my scripts with >doesn´t work. Please help me! >in php.info register globals=On > >For example I have one script: >first.php ><? >global $a; >$a=150; >Header("Location: second.php"); >?> > >second.php > ><? >echo $a; >echo $GLOBALS['a']; >echo "END"; >?> > >Where I have a bug? > >Thank you very much > >Tomas Kubis > > > > >

    attached mail follows:


    Manuel Lemos wrote...

    >> Does anyone know of articles that discuss best practices for supporting >> plug-ins? I searched for a while, but there doesn't seem to be anything out >> there. > > Use a base class to implement the common plugin API (generalization)... > You may want to take a look at Metabase... > You may also want to look into MetaL...

    Thank you for the advice and pointers! :^)

    -- 
    Charles Wiltgen
    

    "Well, once again my friend, we find that science is a two-headed beast. One head is nice, it gives us aspirin and other modern conveniences... but the other head of science is bad! Oh beware the other head of science...it bites!" -- The Tick

    attached mail follows:


    I was looking over a tutorial on Php builder on making search engine friendly sites. While i got the concept of the tutorial and have it working here. I was wondering is it possible to get a php script to run out of the home directory of apache.

    tutorial: http://www.phpbuilder.com/columns/tim19990117.php3?page=1

    in the tut they redirect any calls to files in /local/ to a php file in the root of the site.

    I'd like to if possible redirect it to script that's stored outside of the home folder for apache.

    Why you ask? 1. One file to update for any number of websites. 2. So clients don't go touching it. (i know permissions could solve this. but the reason one is more important.)

    In my .htaccess in the root of the site i have

    Options +FollowSymLinks RewriteEngine On RewriteRule local.*$ local.php

    Works fine..

    but when i change it to a directory outside of the root it never gets to process or give an error.

    Any ideas? is it possible?

    Cheers

    Brendon

    attached mail follows:


    .htaccess only works for the document root directory and below. You could try making a symbolic link to the directory in the document root (I don't know if this will work).

    Brendon G wrote: > I was looking over a tutorial on Php builder on making search engine > friendly sites. While i got the concept of the tutorial and have it > working here. I was wondering is it possible to get a php script to run out > of the home directory of apache. > > tutorial: http://www.phpbuilder.com/columns/tim19990117.php3?page=1 > > > in the tut they redirect any calls to files in /local/ to a php file in the > root of the site. > > I'd like to if possible redirect it to script that's stored outside of the > home folder for apache. > > Why you ask? > 1. One file to update for any number of websites. > 2. So clients don't go touching it. (i know permissions could solve this. > but the reason one is more important.) > > > In my .htaccess in the root of the site i have > > Options +FollowSymLinks > RewriteEngine On > RewriteRule local.*$ local.php > > Works fine.. > > but when i change it to a directory outside of the root it never gets to > process or give an error. > > > Any ideas? is it possible? > > Cheers > > Brendon > > > >

    attached mail follows:


    Justin French wrote...

    > I'd say RTF is a format you're going to be able to come to grips with > quicker than .doc -- just take a look at the source of a word doc -- it's > pretty obscure!!!

    And proprietary, and soon to be obsolete. But Office 11 files will be XML files.

    -- 
    Charles Wiltgen
    

    "Well, once again my friend, we find that science is a two-headed beast. One head is nice, it gives us aspirin and other modern conveniences... but the other head of science is bad! Oh beware the other head of science...it bites!" -- The Tick

    attached mail follows:


    Hello,

    On 10/31/2002 04:38 AM, Charles Wiltgen wrote: > Justin French wrote... > > >>I'd say RTF is a format you're going to be able to come to grips with >>quicker than .doc -- just take a look at the source of a word doc -- it's >>pretty obscure!!! > > > And proprietary, and soon to be obsolete. But Office 11 files will be XML > files.

    RTF is not a closed format. Just dig in the Internet and you will find the specs. OTOH, Office 11 XML will not be understood by any of the previous Word version, if anything else for a while now.

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    Besides that there is no reason to include the file after the use of the variable. When i started writing php i saw in every other program that the include was the first line in every function that needs it. Like : function test() {

    include("file"); ..... ....

    Peter Houchin wrote: > try it and see .. though I am pretty sure that it won't work unless you > define the variable else where in the file b4 calling it. other wise the > variable will either be blank or give you an error saying undefined variable > if it's used before the include. > > >>-----Original Message----- >>From: Trasca Ion-Catalin [mailto:tic2000home.ro] >>Sent: Thursday, 31 October 2002 10:56 AM >>To: php-generallists.php.net >>Subject: [PHP] Re: Yet another question >> >> >>Yes, this works, but only if I include the file before the use of the >>variable, but, what if I use the include() after the use of the variable? >> >>-- >>Trasca Ion-Catalin >>"Tjoumaidis" <ttjoumlistsfreemail.gr> wrote in message >>news:3DBF8DE6.70701freemail.gr... >> >>>Yes if you include the file >>> >>>include ("file"); >>> >>>then you can refer to any of the variables the file contains >>> >>> >>>Trasca Ion-Catalin wrote: >>> >>>>It's posible to call a variable from another file? >>>> >>>>-- >>>>Trasca Ion-Catalin >>>> >>>> >>> >>> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> > >

    attached mail follows:


    Hi,

    In asp there is a session timeout function that allows the session to end after the session is INACTIVE for x seconds/minutes ! How do i do this in php ?

    Is there a way to open a php page in internet expl. without having a url/adress bar or a back and forward button , if so how do i go to work?

    I asked this before, but say for instance - the user is busy on a secure page , but without logging out he enters another url in the address bar.The session of my page , does it end or does the session carry to the next page ? If so how can i stop it ?

    thanks , shaun!

    attached mail follows:


    Shaun wrote:

    >Hi, > >In asp there is a session timeout function that allows the session to >end after the session is INACTIVE for x seconds/minutes ! How do i do this >in php ? > > session_cache_expire(value_in_minutes); documentation is not very clear about it, but I guess it needs to be set before session_start() can be set also in php.ini using session.cache_expire directive

    >Is there a way to open a php page in internet expl. without having a >url/adress bar >or a back and forward button , if so how do i go to work? > > this is javascript new_win = open(' url ', 'new_win_name', window_features) you need to set right window features, check out developer.netscape.com - client side javascript, object window, method open

    >I asked this before, but say for instance - the user is busy on a secure >page , but without logging out he enters another url in the address bar.The >session >of my page , does it end or does the session carry to the next page ? If so >how can >i stop it ? > session are per domain, or if you set path using session_set_cookie_params(), even per path. If the user comes back within time limit, the session is still active

    > >thanks , shaun! > > > > >

    attached mail follows:


    > In asp there is a session timeout function that allows the session to > end after the session is INACTIVE for x seconds/minutes ! How do i do this > in php ?

    You can set the lifetime of the session in php.ini. session.gc_maxlifetime is the time after which, inactive sessions will be deleted. session.gc_probability controls the percentage chance that the garbage collection (session deletion) will be triggered with each session_start(). You can also set some of the cookie parameters. All the details are in the manual, give it a try. http://www.php.net/manual/en/ref.session.php > Is there a way to open a php page in internet expl. without having a > url/adress bar > or a back and forward button , if so how do i go to work?

    No, use javascript.

    > I asked this before, but say for instance - the user is busy on a secure > page , but without logging out he enters another url in the address > bar.The > session > of my page , does it end or does the session carry to the next page ? If > so > how can > i stop it ?

    The session cookie will remain on his computer. It's only good for your site though. If they return, the session will still be active, unless it's been they wait over X minutes and the session file on the server is deleted by the garbage collection.

    Remember how HTTP works. All your web server does is process requests. You can't tell between requests if the user went somewhere else or not.

    ---John Holmes...

    attached mail follows:


    My mail have a problem, I can receive this mail list, but can send to it, who can tell me a better free mail which support pop3 and smtp?

    attached mail follows:


    Ummmm....

    *wonders if he should point out the obvious*

    joskey wrote: > My mail have a problem, I can receive this mail list, > but can send to it, who can tell me a better free mail which support pop3 and smtp? > >

    attached mail follows:


    Hi joskey,

    Your mail came through fine ... but if you want to run a mail-server, and have got either windows or novell netware, take a peak at Mercury, it's free, has POP and SMTP, and inludes a listerver and advanced filtering:

    www.pmail.com

    It's extremely stable, only license quirk is that you may not send mail to more than 50 people without having their concent first (spam protection).

    Rene

    On Thu, 31 Oct 2002 16:5:50 +0800, you wrote about "[PHP] My mail have a problem!!" something that looked like this:

    >My mail have a problem, I can receive this mail list, >but can send to it, who can tell me a better free mail which support pop3 and smtp?

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

    This message was written on 100% recycled spam.

    Come see! My brand new site is now online! http://www.metalbunny.net

    attached mail follows:


    In article <000001c2805a$8a2a11a0$4b0a0a0askink>, dfreemanoutbackqld.net.au says... > > G'day David > > > > My problem is that files uploaded through a form are > > > increasing in size. > > > Doesn't that look like the EOL characters are being > > translated after the fashion of ftp ascii transfers? > > > Maybe have a look at the two versions in a > > hex viewer and see if that is the case? > > Yes, I'd considered that. That was what I'd gone looking for in config > files etc. I'd hoped to find a switch for ftp transfer mode. Didn't > find one though. > > However, partly because of your email and partly because I noted that > the file size increase was the same every time (27 bytes) I decided to > load it into a hex editor. > > What I found was that at the top of the file, the following had been > added: > > -----8<----- > Content-Type: image/gif > > -----8<----- > > I also found that if I remove these two lines the image will display > perfectly. > > So, my next question is, why does my linux box add this to an uploaded > image and my windows box not do so? Can someone make a suggestion on > where I should be looking? Is the addition of this information a server > (Apache) thing? Or is it a php thing? > > CYA, Dave

    That's, er, odd?? Dunno whether you might find anything useful from

    http://www.google.com/search?q=upload+file+content+type+form+multipart+ima ge+php&sourceid=opera&num=0&ie=utf-8&oe=utf-8

    (unwrap that). As I understand it, upload by form has nothing to do with ftp - it's part of http - and I assume that it is intended to do an 'exact' copy? Perhaps a code snippet, just in case anyone can pick something odd about it.

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    I've had 2 thoughts on this one. They're fairly uneducated an just meandering speculation, but it's my tuppence-worth so...

    My initial thought was this: I believe the Content-Type: MIME header is added by your browser. HTTP standards say that anything sending a file over HTTP is supposed to tell the recipient what type of file it's sending. It does this by adding the Content-Type: header at the start of the stream. Normally, PHP will read this header and put it in the $_FILES['userfile']['type'] variable. Perhaps your Linux browser adds the header in such a way that PHP cannot extract it properly, and simply thinks it's part of the file? You could try checking the $_FILES['userfile']['type'] variable to see if it contains the correct MIME type.

    It then dawned on me that I know either Apache or PHP (can't remember which, possibly both, but most likely Apache) can so some clever stuff where it fills in missing MIME type headers by analysing the file being transferred. It's possible that your Linux browser is not sending a Content-Type: header and so Apache tries to fill one in and it's APACHE that is adding the iffy header that PHP doesn't recognise. Alternatively, it's possible that your browser IS adding the header, but Apache doesn't recognise it, so adds another one. PHP happily extracts the first one, but doesn't spot the second one so it creeps through.

    Of course, all that could be wrong as I'm not an expert on file uploads, but it might be a place to start looking.

    Regards, Rich

    -----Original Message----- From: David Freeman [mailto:dfreemanoutbackqld.net.au] Sent: 30 October 2002 9:23 pm To: php-generallists.php.net Subject: RE: [PHP] Re: File Upload Problem

    G'day David

    > > My problem is that files uploaded through a form are > > increasing in size.

    > Doesn't that look like the EOL characters are being > translated after the fashion of ftp ascii transfers?

    > Maybe have a look at the two versions in a > hex viewer and see if that is the case?

    Yes, I'd considered that. That was what I'd gone looking for in config files etc. I'd hoped to find a switch for ftp transfer mode. Didn't find one though.

    However, partly because of your email and partly because I noted that the file size increase was the same every time (27 bytes) I decided to load it into a hex editor.

    What I found was that at the top of the file, the following had been added:

    -----8<----- Content-Type: image/gif

    -----8<-----

    I also found that if I remove these two lines the image will display perfectly.

    So, my next question is, why does my linux box add this to an uploaded image and my windows box not do so? Can someone make a suggestion on where I should be looking? Is the addition of this information a server (Apache) thing? Or is it a php thing?

    CYA, Dave

    attached mail follows:


    Can anyone see why I am having problems with this page. I'm trying to connect to the DB and display results using the function get_order_id_receipt. The DB connection works because I can produce the cart based on the users session so I don't get why this doesn't work.... <? include ('products_fns.php'); include ('order_fns.php'); include ('db_fns.php'); include ('output_fns.php'); // The shopping cart needs sessions, so start one session_start(); do_html_header("Please print out this page for your records."); function get_order_id_receipt($orderid, $shipping) { //Get order ID from DB to pass to receipt. $conn = db_connect(); $query = "select orderid from receipts"; $shippingquery = "select shipping from receipts"; $orderid = mysql_result($query); $shipping = mysql_result($shippingquery); //return $orderid; } //debug test echo mysql_error(); echo "test & $orderid"; echo "test & $shipping"; display_receipt($orderid); echo "<table width='760' cellpadding='0' background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; display_cart($cart, false, 0); echo "<table width='760' cellpadding='0' background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; echo "<table width='760' cellpadding='0' background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; display_success_form(); //empty shopping cart //session_destroy(); do_html_footer(); ?>

    Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com <http://www.violasystems.com/> stephen.jacksonviolasystems.com Mobile +358 50 343 5159

    attached mail follows:


    You're not executing the query, or selecting a db. But that's just the tip of the iceberg. If you have more than one "orderid" and more than one "shipping" your queries will return all of them. I'm not sure if this is what you want, but if it is, you really should be using something like mysql_fetch_array() instead of mysql_result(). If you're looking for just one result, you should change your SQL to somethere like this....

    SELECT `orderid` FROM `databasename.receipts` WHERE `some_unique_key` = 'some_unique_identifier'

    function get_order_id_receipt($orderid, $shipping) { //Get order ID from DB to pass to receipt. $conn = db_connect(); $query = "select orderid from receipts"; $shippingquery = "select shipping from receipts"; mysql_select_db ( YOUR_DATABASE_NAME ); $orderid_result = mysql_query ( $query ); $orderid = mysql_result($orderid_result);

    $shipping = mysql_result($shippingquery); //return $orderid; }

    Steve Jackson wrote: > Can anyone see why I am having problems with this page. > I'm trying to connect to the DB and display results using the function > get_order_id_receipt. > The DB connection works because I can produce the cart based on the > users session so I don't get why this doesn't work.... > > <? > include ('products_fns.php'); > include ('order_fns.php'); > include ('db_fns.php'); > include ('output_fns.php'); > // The shopping cart needs sessions, so start one > session_start(); > > do_html_header("Please print out this page for your records."); > > > function get_order_id_receipt($orderid, $shipping) > { > //Get order ID from DB to pass to receipt. > $conn = db_connect(); > $query = "select orderid from receipts"; > $shippingquery = "select shipping from receipts"; > $orderid = mysql_result($query); > $shipping = mysql_result($shippingquery); > //return $orderid; > } > //debug test > echo mysql_error(); > echo "test & $orderid"; > echo "test & $shipping"; > display_receipt($orderid); > echo "<table width='760' cellpadding='0' > background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; > display_cart($cart, false, 0); > echo "<table width='760' cellpadding='0' > background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; > > echo "<table width='760' cellpadding='0' > background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; > display_success_form(); > //empty shopping cart > //session_destroy(); > do_html_footer(); > ?> > > > > Steve Jackson > Web Developer > Viola Systems Ltd. > http://www.violasystems.com <http://www.violasystems.com/> > stephen.jacksonviolasystems.com > Mobile +358 50 343 5159 > > > > >

    attached mail follows:


    You still need to execute the query to get a result set.

    >>> $query = "select orderid from receipts"; >>> $shippingquery = "select shipping from receipts"; >>> $orderid = mysql_result($query); >>> $shipping = mysql_result($shippingquery);

    $query and $shippingquery are not result sets.

    $this_var = mysql_query ( $query ); $orderid = mysql_result ( $this_var ); mysql_free_result ( $this_var ); $that_var = mysql_query ( $shippingquery ); $shipping = mysql_result ( $that_var ); mysql_free_result ( $that_var );

    However, I don't think you're going to get the desired result from mysql_result() unless you're only planning on returning one piece of data.

    Steve Jackson wrote: > Well the db_connect() function selects the DB so I don't need to repeat > that. > And I've tried Select orderid from receipts where customerid = '10' as a > test and it still returned nothing. > > Steve Jackson > Web Developer > Viola Systems Ltd. > http://www.violasystems.com > stephen.jacksonviolasystems.com > Mobile +358 50 343 5159 > > > > >>-----Original Message----- >>From: John Nichel [mailto:jnichelby-tor.com] >>Sent: 31. lokakuuta 2002 10:57 >>To: stephen.jacksonviolasystems.com >>Cc: PHP General; MySQL General Mailing list >>Subject: Re: [PHP] Anything wrong with this function? >> >> >>You're not executing the query, or selecting a db. But >>that's just the >>tip of the iceberg. If you have more than one "orderid" and >>more than >>one "shipping" your queries will return all of them. I'm not sure if >>this is what you want, but if it is, you really should be using >>something like mysql_fetch_array() instead of mysql_result(). >> If you're >>looking for just one result, you should change your SQL to somethere >>like this.... >> >>SELECT `orderid` FROM `databasename.receipts` >> WHERE `some_unique_key` = 'some_unique_identifier' >> >>function get_order_id_receipt($orderid, $shipping) >>{ >> //Get order ID from DB to pass to receipt. >> $conn = db_connect(); >> $query = "select orderid from receipts"; >> $shippingquery = "select shipping from receipts"; >> >> mysql_select_db ( YOUR_DATABASE_NAME ); >> $orderid_result = mysql_query ( $query ); >> $orderid = mysql_result($orderid_result); >> >> $shipping = mysql_result($shippingquery); >> //return $orderid; >>} >> >>Steve Jackson wrote: >> >>>Can anyone see why I am having problems with this page. >>>I'm trying to connect to the DB and display results using >> >>the function >> >>>get_order_id_receipt. The DB connection works because I can produce >>>the cart based on the users session so I don't get why this doesn't >>>work.... >>> >>><? >>> include ('products_fns.php'); >>> include ('order_fns.php'); >>> include ('db_fns.php'); >>> include ('output_fns.php'); >>> // The shopping cart needs sessions, so start one >>> session_start(); >>> >>> do_html_header("Please print out this page for your records."); >>> >>> >>> function get_order_id_receipt($orderid, $shipping) >>> { >>> //Get order ID from DB to pass to receipt. >>> $conn = db_connect(); >>> $query = "select orderid from receipts"; >>> $shippingquery = "select shipping from receipts"; >>> $orderid = mysql_result($query); >>> $shipping = mysql_result($shippingquery); >>> //return $orderid; >>> } >>> //debug test >>> echo mysql_error(); >>> echo "test & $orderid"; >>> echo "test & $shipping"; >>> display_receipt($orderid); >>> echo "<table width='760' cellpadding='0' >>>background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; >>> display_cart($cart, false, 0); >>> echo "<table width='760' cellpadding='0' >>>background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; >>> >>> echo "<table width='760' cellpadding='0' >>>background='images/shopbg.gif'><tr><td>&nbsp;</td></tr></table>"; >>> display_success_form(); >>> //empty shopping cart >>> //session_destroy(); >>> do_html_footer(); >>>?> >>> >>> >>> >>>Steve Jackson >>>Web Developer >>>Viola Systems Ltd. >>>http://www.violasystems.com <http://www.violasystems.com/> >>>stephen.jacksonviolasystems.com >>>Mobile +358 50 343 5159 >>> >>> >>> >>> >>> >> >> > > > > >

    attached mail follows:


    Hello,

    you can access SAP tables direct via the native database interface for example via the Oracle interface. All you have to know is what is inside the different tables and you have to get the password or a read only account to SAP tables from your DBA. ;-)

    For example the creditor tables are bsik (open bill) and bsak (paid bill, when I remember correct) and debitor tables are bsid and bsad and parts of adresses are stored in table kna1 and so on.

    Good luck. I've done a lot of coding with direct access to SAP. It works, it's fast and it's not proprietary and you do not have to spend tons of money for SAP ABAP lessions.

    best regards Gerald

    attached mail follows:


    line 60 and 61 should read:

    echo 'temp/'.$userfile_name[$i-1]; $fp=fopen('temp/'.$userfile_name[$i-1],"w+");

    Andres, Cyrille wrote:

    >here is my code : > >// for each file to upload :.... >$j=0; >echo "$hotelNr[$j] et $j"; >while($hotelNr[$j] != "") >{ > //display the caracteristics of each file to download > echo"<br>HOotelNr[$j]=$hotelNr[$j]<br>";?> > <table border="1"> > <tr><td><?php printf("<b>Name</b> :</td><td> >%s",$userfile_name[$hotelNr[$j]-1]);// >$HTTP_POST_FILES["userfile"]["name"]);?></td></tr> > <tr><td><?printf("<b>Temporary Name :</b></td> <td>%s", >$userfile[$hotelNr[$j]-1] >);//$HTTP_POST_FILES["userfile"]["tmp_name"]);?></td></tr> > <tr><td><?printf("<b>Size :</b></td><td>%s", >$userfile_size[$hotelNr[$j]-1] >);//$HTTP_POST_FILES["userfile"]["size"]);?></td></tr> > <tr><td><?printf("<b>Type :</b></td><td>%s", >$userfile_type[$hotelNr[$j]-1]);//$HTTP_POST_FILES["userfile"]["type"]);?></ >td></tr> > > > <tr><td> > <? > > //copy the file on the server > $i=$hotelNr[$j]; > echo "temp/$userfile_name[$i-1]"; > $fp=fopen("temp/$userfile_name[0]","w+"); > > if (copy >($HTTP_POST_FILES["userfile"]["tmp_name"][$hotelNr[$j]-1],"temp/".$HTTP_POST >_FILES["userfile"]["name"][$hotelNr[$j]-1])) > printf("<h4>File successfully copied !</h4>"); > else > printf("<h4>Error: failed to copy file !</h4>"); > > $j++; > echo "</td></tr> > </table><br>"; >} >?> > >-----Original Message----- >From: Stuart Dallas [mailto:stuartstut.net] >Sent: Wednesday, October 30, 2002 11:29 AM >To: Andres, Cyrille >Cc: Jonathan Sharp; PHP List; php >Subject: Re: [PHP] parse error > > >On Wednesday, Oct 30, 2002, at 19:21 Europe/London, Andres, Cyrille >wrote: > > >>thx, but I still have the same error >>I think I have a poltergheist in my computer !!! >> >> > >Show us a couple of lines before this. > > >

    attached mail follows:


    I am battling with the same problem on both IE and Netscape on Mac OS 10.2. Is this a Mac thing?

    I ammended your code in the hope that something was being passed that only looked like a space..

    <?php echo $_POST['test'].'<br>'; for($n=1;$n<=strlen($_POST['test']);$n++) { echo var_dump(hexdec(substr($_POST['test'],$n-1,1))); } php?> <form actiom='test.php' method=POST> <input type=text value='' name=test> <input type=submit value='submit'> </form>

    If I enter a+b it returns: a b int(10) int(0) int(11)

    I can't ask users to enter a<PLUS>b or some such code, there must be a solution. I don't belive this is going to defeat the collective brains of the PHP list!

    Phoebe.

    Stan wrote: > When i post a string containing plus sign with htmp form to a php scritp, > the '+' is changed to space. > e.g: i enter 'as+df' to a text input but $_POST[] returns 'as df' instead. > It must be in php or apache configuration bcause i have this problem only on > sytem with FreeBSD. On windows it works as expected. > > Know someone how could i make the '+' left intact? Please help. > > > <? > echo $_POST['test']; > ?> > <form actiom='test.php' method=POST> > <input type=text value='' name=test> > <input type=submit value='submit'> > </form> > >

    attached mail follows:


    Here is a fudge that uses Javascript to convert the + into {PLUS} then PHP converts it back again. The only problem is Javascript is only converting the first +, so a+b+c becomes a+b c.

    <?php $testVal=str_replace("{PLUS}","+",$_POST['test']); echo $testVal; php?> <script> function SaveHiddenChars() { document.form1.test.value=document.form1.test.value.replace("+","{PLUS}"); } </script> <form name="form1" actiom='test.php' method=POST onSubmit="SaveHiddenChars();"> <input type=text value='' name=test> <input type=submit value='submit'> </form>

    Stan wrote: > When i post a string containing plus sign with htmp form to a php scritp, > the '+' is changed to space. > e.g: i enter 'as+df' to a text input but $_POST[] returns 'as df' instead. > It must be in php or apache configuration bcause i have this problem only on > sytem with FreeBSD. On windows it works as expected. > > Know someone how could i make the '+' left intact? Please help. > > > <? > echo $_POST['test']; > ?> > <form actiom='test.php' method=POST> > <input type=text value='' name=test> > <input type=submit value='submit'> > </form> > >

    attached mail follows:


    I discovered recently that it was impossible to bind an output placeholder plsql (an input work only).

    Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3 Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3 Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2

    With script : inoutdemo.sql CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, par_in_out IN OUT VARCHAR2, par_out OUT VARCHAR2) IS BEGIN par_out:=par_in; par_in_out:=par_in||' '||par_in_out; END;

    $db=OCILogon("usr_adm","adm_inv"); $stmt=OCIParse($db,"BEGIN inoutdemo(:in,:inout,:out);END;"); OCIBindByName($stmt,":in",$in,32); OCIBindByName($stmt,":inout",$inout,32); OCIBindByName($stmt,":out",$out,32); $in="Hello "; $inout="World!"; OCIExecute($stmt); echo $in."\n".$inout."\n".$out."\n";

    //Result Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /opt/apache/htdocs/fab.php4 on line 58 Hello World!

    I tested this script with the 3 configuration but it's the same error

    I changed $in, &inout , &out into $&in, $&out, $&inout but it's the same error

    Please help me !!!

    Fabien JOSEPH

    attached mail follows:


    I discovered recently that it was impossible to bind an output placeholder plsql (an input work only).

    Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3 Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3 Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2

    With script : inoutdemo.sql CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, par_in_out IN OUT VARCHAR2, par_out OUT VARCHAR2) IS BEGIN par_out:=par_in; par_in_out:=par_in||' '||par_in_out; END;

    $db=OCILogon("usr_adm","adm_inv"); $stmt=OCIParse($db,"BEGIN inoutdemo(:in,:inout,:out);END;"); OCIBindByName($stmt,":in",$in,32); OCIBindByName($stmt,":inout",$inout,32); OCIBindByName($stmt,":out",$out,32); $in="Hello "; $inout="World!"; OCIExecute($stmt); echo $in."\n".$inout."\n".$out."\n";

    //Result Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /opt/apache/htdocs/fab.php4 on line 58 Hello World!

    I tested this script with the 3 configuration but it's the same error

    I changed $in, &inout , &out into $&in, $&out, $&inout but it's the same error

    Please help me !!!

    Fabien JOSEPH

    attached mail follows:


    I discovered recently that it was impossible to bind an output placeholder plsql (an input work only).

    Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3 Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3 Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2

    With script : inoutdemo.sql CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, par_in_out IN OUT VARCHAR2, par_out OUT VARCHAR2) IS BEGIN par_out:=par_in; par_in_out:=par_in||' '||par_in_out; END;

    $db=OCILogon("usr_adm","adm_inv"); $stmt=OCIParse($db,"BEGIN inoutdemo(:in,:inout,:out);END;"); OCIBindByName($stmt,":in",$in,32); OCIBindByName($stmt,":inout",$inout,32); OCIBindByName($stmt,":out",$out,32); $in="Hello "; $inout="World!"; OCIExecute($stmt); echo $in."\n".$inout."\n".$out."\n";

    //Result Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /opt/apache/htdocs/fab.php4 on line 58 Hello World!

    I tested this script with the 3 configuration but it's the same error

    I changed $in, &inout , &out into $&in, $&out, $&inout but it's the same error

    Please help me !!!

    Fabien JOSEPH

    attached mail follows:


    I discovered recently that it was impossible to bind an output placeholder plsql (an input work only).

    Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3 Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3 Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2

    With script : inoutdemo.sql CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, par_in_out IN OUT VARCHAR2, par_out OUT VARCHAR2) IS BEGIN par_out:=par_in; par_in_out:=par_in||' '||par_in_out; END;

    $db=OCILogon("usr_adm","adm_inv"); $stmt=OCIParse($db,"BEGIN inoutdemo(:in,:inout,:out);END;"); OCIBindByName($stmt,":in",$in,32); OCIBindByName($stmt,":inout",$inout,32); OCIBindByName($stmt,":out",$out,32); $in="Hello "; $inout="World!"; OCIExecute($stmt); echo $in."\n".$inout."\n".$out."\n";

    //Result Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /opt/apache/htdocs/fab.php4 on line 58 Hello World!

    I tested this script with the 3 configuration but it's the same error

    I changed $in, &inout , &out into $&in, $&out, $&inout but it's the same error

    Please help me !!!

    Fabien JOSEPH

    attached mail follows:


    where is $row['BillPeriod'] set? and what is its value?

    Chris Knipe wrote:

    >Lo, > >Quite desperate now... Or at least, I'm starting to get there... Can anyone >perhaps see why this loop is not exiting??? > >$quit=$now; >$glet=getdate($row['RenewDate']); > >// debug >echo "howlong: " . $howlong; > >while($quit<$howlong) { > > // debug > echo "quit: " . $quit . "<br>"; > > $quit=mktime(0, 0, 0, $glet['mon']+$row['BillPeriod'], $glet['mday'], >$glet['year']); > $retl+=$row['Cost']; > $glet=getdate($quit); >} > > >The values, > >$now = 1036360800 (mktime()) >$row['RenewDate'] = 1035928800 (MySQL DB - VARCHAR(12)) >$row['Cost'] = xx.xx (MySQL DB - DOUBLE(6,2)) > >$howlong is defined further up.... >$howlong=mktime(0, 0, 0, $_POST['month'], 1, $_POST['year']) >where... > 0 < $_POST['month'] > 12 > 2001 < $_POST['year'] > 2005 > >>From the debug (Browser output)... >howlong: 1133388000 - now: 1036023598 (RenewDate: 1036360800) >quit: 1036023598 >quit: 1036360800 >quit: 1036360800 >quit: 1036360800 > >Thus, $quit is never incremented.... I'm *STUMPED* why not, or how to fix >this? :(( Each time, PHP times out (Script execution time exceeded), and it >*always* gives a line number for the timeout, that is inside the above while >loop. Hence, to my understanding, the loop never exits.... > >The loop, comes from cbms from voxel.net, stats.php > >Thanks for the help! > >-- >me > > > >

    attached mail follows:


    ask at a windows-user list

    R B wrote:

    > I want to set up a specific size of paper to print a report. > I made this with a PDF document and in screen looks like the size that > i need, but when i print it, the printer doesn't respect the size and > always print with the letter or default acrobat size. > I check the printer properties and doesn't have a customs size option. > > What can i do? > > Thanks, > > RB > > _________________________________________________________________ > MSN. Más Útil Cada Día http://www.msn.es/intmap/ > >

    attached mail follows:


    TEST

    attached mail follows:


    function get_order_id_receipt($orderid, $shipping) { //Get order ID from DB to pass to receipt. $conn = db_connect(); $datequery = "select date from receipts where customerid = '10'"; $query = "select orderid from receipts where customerid = '10'"; $shippingquery = "select shipping from receipts where customerid = '10'"; $date_result = mysql_query($datequery); $date = mysql_result($date_result); $orderid_result = mysql_query($query); $orderid = mysql_result($orderid_result); $shipping_result = mysql_query($shippingquery); $shipping = mysql_result($shipping_result); return $orderid; return $shipping; } I get these errors echoed from mysql_error() Warning: Wrong parameter count for mysql_result() in order_fns.php on line 127

    Warning: Wrong parameter count for mysql_result() in order_fns.php on line 129

    Warning: Wrong parameter count for mysql_result() in order_fns.php on line 131

    What does that mean?

    Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com <http://www.violasystems.com/> stephen.jacksonviolasystems.com Mobile +358 50 343 5159

    attached mail follows:


    The function needs more or less parameters than supplied, in this case either 2 or 3, check the manual

    Steve Jackson wrote:

    >function get_order_id_receipt($orderid, $shipping) > { > //Get order ID from DB to pass to receipt. > $conn = db_connect(); > $datequery = "select date from receipts where customerid = '10'"; > $query = "select orderid from receipts where customerid = '10'"; > $shippingquery = "select shipping from receipts where customerid = >'10'"; > $date_result = mysql_query($datequery); > $date = mysql_result($date_result); > $orderid_result = mysql_query($query); > $orderid = mysql_result($orderid_result); > $shipping_result = mysql_query($shippingquery); > $shipping = mysql_result($shipping_result); > return $orderid; > return $shipping; > } > >I get these errors echoed from mysql_error() >Warning: Wrong parameter count for mysql_result() in order_fns.php on >line 127 > >Warning: Wrong parameter count for mysql_result() in order_fns.php on >line 129 > >Warning: Wrong parameter count for mysql_result() in order_fns.php on >line 131 > >What does that mean? > >Steve Jackson >Web Developer >Viola Systems Ltd. >http://www.violasystems.com <http://www.violasystems.com/> >stephen.jacksonviolasystems.com >Mobile +358 50 343 5159 > > > > > > >

    attached mail follows:


    At 10/31/2002, you wrote: >function get_order_id_receipt($orderid, $shipping) > { > //Get order ID from DB to pass to receipt. > $conn = db_connect(); > $datequery = "select date from receipts where customerid = '10'"; > $query = "select orderid from receipts where customerid = '10'"; > $shippingquery = "select shipping from receipts where customerid = >'10'"; > $date_result = mysql_query($datequery); > $date = mysql_result($date_result); > $orderid_result = mysql_query($query); > $orderid = mysql_result($orderid_result); > $shipping_result = mysql_query($shippingquery); > $shipping = mysql_result($shipping_result); > return $orderid; > return $shipping; > } > >I get these errors echoed from mysql_error() >Warning: Wrong parameter count for mysql_result() in order_fns.php on >line 127 > >Warning: Wrong parameter count for mysql_result() in order_fns.php on >line 129 > >Warning: Wrong parameter count for mysql_result() in order_fns.php on >line 131 > >What does that mean?

    Try

    function get_order_id_receipt($orderid, $shipping) { //Get order ID from DB to pass to receipt. $conn = db_connect(); $datequery = "select date from receipts where customerid = '10'"; $query = "select orderid from receipts where customerid = '10'"; $shippingquery = "select shipping from receipts where customerid = '10'"; $date_result = mysql_query($datequery); $date = mysql_result($date_result,0); $orderid_result = mysql_query($query); $orderid = mysql_result($orderid_result,0); $shipping_result = mysql_query($shippingquery); $shipping = mysql_result($shipping_result,0); return $orderid; return $shipping; }

    See http://fi2.php.net/manual/fi/function.mysql-result.php

    But with mysql_result you'll get see one CELL only. Maybe you need to use something like

    $dates = array(); while ($row = mysql_fetch_array( $date_result)) { array_push($dates, $row["date"]); } return $dates;

    ------------------------- Pekka Saarinen http://photography-on-the.net -------------------------

    attached mail follows:


    > -----Original Message----- > From: -<[ Rene Brehmer ]>- [mailto:metalbunnymetalbunny.net] > Sent: 30 October 2002 19:54 > [snip, snip, snip...]

    > My structure also ensure that > if someone's > called something like Mackenzie for first name, it will not > be incorrectly > cap'ed, as it only does the scotch-check on the last names...

    And what if someone's last name *is* Mackenzie? Or Macdonald? Or any one of several others I can think of that exist in both forms?

    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: m.fordlmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

    attached mail follows:


    Hi Rene,

    You should consider the fact that, even as surnames, names like Mackintosh and Mackenzie (and as someone else suggested here 'Macon') generally should NOT have a capital letter. Mackintosh is an English name, not Scottish, and people who spell it with a capital K have gotten their ancestry mixed up somewhere!

    Anyway, perhaps a way around this would be to have a known exceptions list? You could just stick all your Mc/Mac code inside: if (in_array($lastname, $mcExceptions)) { ... }

    At the end of the day, it's really up to the person how they capitalise their own name, but I guess mind reading is (currently) a bit beyond PHP.

    Regards, Rich

    -----Original Message----- From: -<[ Rene Brehmer ]>- [mailto:metalbunnymetalbunny.net] Sent: 30 October 2002 7:54 pm To: php-generallists.php.net Subject: Capitalizing names etc. part II - found a solution

    Hi y'all

    A while back I requested help for properly capitalizing names out of passed string values, as ucwords() and tokenizing didn't do the trick.

    Some kind soul gave me this scripple to work with:

    > $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;

    Which didn't work at all (even changing the variables to match my own), but only got me several errors for each line...

    My task was to make it take a string like "firstname_middlename_firstlastname-lastlastname" and properly capitalize it. Also wanted it to do it correctly with names like O'Connor, MacEnroe, McCarthy and such... The scribble above would be able to do it with the O'Connors and name-name formats, but useless with Mac/Mc names ... plus the above script part didn't work at all on my system (PHP 4.2.3 on Apache 2.0.40 on WinXP Pro).

    OK ... so I wanted a compact structure that could do this easily, and correctly, on ANY name I threw at it...so I've spent a couple of hours finding useful functions in PHP that would do the trickery easiest ... and ended up with this:

    $name = $HTTP_GET_VARS['name'];

    // pull real name out of $name $realname = ""; // okay, let's get the names cap'ed correctly... $startat = 0; // these vars are used for substring pulling $stoplen = 0; // parse 1, find funny chars and cap after them for ($i = 0; $i < strlen($name); $i++) { $ltr = substr($name, $i, 1); // pull out letter i of name $stoplen = $i - $startat; // set the stop point for substring // if current letter is a marker if ($ltr == "_" | $ltr == "-" | $ltr == "'") { // add substring $realname .= ucfirst(substr($name, $startat, $stoplen)); $startat = $i + 1; // set new start point for substring } if ($ltr == "_") { // if space, add space $realname .= " "; } elseif ($ltr == "-") { // if dash, add dash $realname .= "-"; } elseif ($ltr == "'") { $realname .= "'"; } } // the last name won't be added in parse 1, // this piece adds the last name AFTER checking and capping for Mac/Mc // so this is essentially pass 2 $lastname = substr($name, $startat, $stoplen + 1); // find Mac/Mc $maclen = 0; // we set this to zero to make it easier to check for found if (strstr($lastname, "mc") != false) { // if Mc is found... $maclen = 2; } elseif (strstr($lastname, "mac") != false) { // if Mac is found $maclen = 3; } if ($maclen > 0) { // add the MacSomething with proper capitalization $realname .= ucfirst(substr($lastname, 0, $maclen)); $realname .= ucfirst(substr($lastname, $maclen, strlen($lastname))); } else { // if we can't find Mac/Mc, just add the last name... $realname .= ucfirst($lastname); } // end namegame

    The curious thing is that this actually runs faster than the strtok() + ucwords() combo I had before, plus it does the trick correctly, everytime. If anyone can see a more efficient way of doing this, I'm all for it.

    Do note that I've intentionally made it so that the last word of all names won't be added to the $realname, until it's determined whether or not it starts with Mac/Mc. The point to this is simple: It's a lot more complicated to scan for the Mac/Mc after the full name is assembled, than it is while it's being built. My structure also ensure that if someone's called something like Mackenzie for first name, it will not be incorrectly cap'ed, as it only does the scotch-check on the last names...

    If you can do this simpler, or have any comments for this way of doing it, please let me know. You may freely copy and dsitribute this as you wish.

    Rene

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

    This message was written on 100% recycled spam.

    Come see! My brand new site is now online! http://www.metalbunny.net

    attached mail follows:


    Hi Steve Jackson,

    On Wed, 30 Oct 2002 20:36:50 +0200, you wrote about "[PHP] Php web hosting" something that looked like this:

    >Anyone like to recommend a good host with good uptime for a high traffic >site? >The host would need excellent technical support as well as be feature rich >(Multiple MySQL database support/listserver/SSL support etc.)

    I use e-navn.dk. They've got an international branch called dotserv.com. They've got blindingly fast support ... I've had them reply to support requests by e-mail in a matter of hours ... on a saturday...

    The Danish one is among Scandinavias cheapest and most respected/used webhosts.

    You can get whatever you want there. Their solutions are all mix-and-match based. CGI, and PHP, and mail comes with free with all webhotels, ASP with some (it depends on size what get included). Anything else is extra for a small fee...or you can buy bigger and get it for free.

    They offer Personal CGI (make/use your own), Perl, Perlscript, SSI, PHP, ASP, JSP, Frontpage support, MySQL, Access, Postgres, SSL, besides what comes with the hotels.

    You can run Real video, and they offer modules for e-shopping sites. Guaranteed 99% uptime, 24/7 support, free traffic, 155 Mbit line...

    Just contact them about your needs, and they'll give a fixed price per month ... you just pay as much in advance as you want ...

    Enough commercials: For the Danish host (e-navn.dk), go here: http://www.enavn.dk/cgi-bin/index.cgi?ref_id=hPaB5xsMCT7GwywY8R5ZN5fbAdGMraP3

    For the international host (dotserv.com), go here: http://www.dotserv.com

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

    This message was written on 100% recycled spam.

    Come see! My brand new site is now online! http://www.metalbunny.net

    attached mail follows:


    I use phpwebhosting and I've always found them to be very quick with their support response. They're also very friendly and helpful, and happy to go that little bit further for you. Need a feature that isn't listed? No harm in asking them and they'll generally do whatever they can to provide it for you.

    They're also the only hosts I've found that don't have a strict bandwidth/transfer limit, and so won't go charging you per Mb. This is especially surprising at their price point ($9.95). I've found slightly cheaper hosting in the UK (which is actually where I'm based) but I just prefer the "We won't set limits if you won't abuse it" attitude of phpwebhosting, even though I don't have a remotely high traffic site! I've never found the thousand-odd miles of water between us to affect communication in any way.

    Regards, Rich

    -----Original Message----- From: Steve Jackson [mailto:stevewebpage.co.uk] Sent: 30 October 2002 6:37 pm To: Php-General Subject: Php web hosting

    Anyone like to recommend a good host with good uptime for a high traffic site? The host would need excellent technical support as well as be feature rich (Multiple MySQL database support/listserver/SSL support etc.)

    I have been trying out phpwebhosting.com and they seem very good but I am not happy with their technical support which is very slow response time. We are based in Europe and they are in the US which might lead to problems as they haven't answered any of our queries. Saying that they have a good automated process in place which is easy to use.

    Anyone out there have high volume sites with a feature rich hosting solution?

    Any examples of Phpwebhosting welcomed as well.

    regards steve.

    attached mail follows:


    I've recently had a very good experience with a hosting company, there website is at: http://www.spenix.com/

    Great feature set, superior support, and so-far perfect uptime/performance in hardware, software, and bandwidth. I definetly recommend them to anyone looking for quality hosting.

    Adam Voigt adam.voigtcryptocomm.com

    On Wed, 2002-10-30 at 13:36, Steve Jackson wrote: > Anyone like to recommend a good host with good uptime for a high traffic > site? > The host would need excellent technical support as well as be feature rich > (Multiple MySQL database support/listserver/SSL support etc.) > > I have been trying out phpwebhosting.com and they seem very good but I am > not happy with their technical support which is very slow response time. We > are based in Europe and they are in the US which might lead to problems as > they haven't answered any of our queries. Saying that they have a good > automated process in place which is easy to use. > > Anyone out there have high volume sites with a feature rich hosting > solution? > > Any examples of Phpwebhosting welcomed as well. > > regards > steve.

    attached mail follows:


    I am using www.imhosted.com for my clients at the moment. I have had some small issues but they are quick to lend a helping hand.

    Clint

    -----Original Message----- From: Adam Voigt [mailto:adamcryptocomm.com] Sent: Thursday, October 31, 2002 7:47 AM To: Steve Jackson Cc: Php-General Subject: Re: [PHP] Php web hosting

    I've recently had a very good experience with a hosting company, there website is at: http://www.spenix.com/

    Great feature set, superior support, and so-far perfect uptime/performance in hardware, software, and bandwidth. I definetly recommend them to anyone looking for quality hosting.

    Adam Voigt adam.voigtcryptocomm.com

    On Wed, 2002-10-30 at 13:36, Steve Jackson wrote: > Anyone like to recommend a good host with good uptime for a high > traffic site? The host would need excellent technical support as well > as be feature rich (Multiple MySQL database support/listserver/SSL > support etc.) > > I have been trying out phpwebhosting.com and they seem very good but I

    > am not happy with their technical support which is very slow response > time. We are based in Europe and they are in the US which might lead > to problems as they haven't answered any of our queries. Saying that > they have a good automated process in place which is easy to use. > > Anyone out there have high volume sites with a feature rich hosting > solution? > > Any examples of Phpwebhosting welcomed as well. > > regards > steve.

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

    attached mail follows:


    Hi Manuel Lemos,

    On Thu, 31 Oct 2002 02:28:31 -0300, you wrote about "Re: [PHP] Multiple Addresses Mailer" something that looked like this:

    >You are contradicting yourself. Most mailing list programs put all >recipients in Bcc: and queue only on message, so it is the same thing >that you are recommending against and for it.

    But most listservers generate a new message for each receiver. Most mailservers, my own included, do not accept more than 5 recipients in the bcc field...50 total for to and cc combined (some allow more).

    The limit's there to prevent spam. Also it would be abuse of the intent to use bcc for the entire list of receivers. Also you cannot have a bcc without a to field anyway ...

    >Spam filters that discard messages which the recipients are in Bcc: are >wrong, just like everybody that filters messages with general criteria >like that. Anyway, it is their problem if they discard messages arbitrarily.

    If the bcc field is the only field with a receiver, then the message is malformed and should be rejected. The To:, Subject:, and Date: fields are required to fullfill RFC 822. If you only get Bcc: and no To:, then the message should be bounced, that's how alot of spam used to be addressed, and some still is.

    >You need to check with the ISP if sending to many recipients respects >the acceptable use policy. If they don't accept bulk mailing, it doesn't >matter the method you use.

    I've never met an ISP that would refuse bulk mailing, as long as you can proove that you've got concent from the receivers for the messages. My mail server handles all the concent things itself, and sofar my ISPs have not complained about the up to 3 digit amounts of message that go out each day, with up to 4 digits coming in...

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

    This message was written on 100% recycled spam.

    Come see! My brand new site is now online! http://www.metalbunny.net

    attached mail follows:


    Hi Manuel Lemos,

    On Wed, 30 Oct 2002 18:03:13 -0300, you wrote about "[PHP] Re: Multiple Addresses Mailer" something that looked like this:

    >> I want to be able to send mail so that each recipient thinks that this >> mail was ONLY sent to him/her. > >Put all recipients in the Bcc: instead of To: header.

    You'll still need something in the To: field ... something valid too that is...

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

    This message was written on 100% recycled spam.

    Come see! My brand new site is now online! http://www.metalbunny.net

    attached mail follows:


    > I've never met an ISP that would refuse bulk > mailing, as long as you can > proove that you've got concent from the receivers > for the messages. My > mail server handles all the concent things itself, > and sofar my ISPs have > not complained about the up to 3 digit amounts of > message that go out each > day, with up to 4 digits coming in... >

    I have a site hosted on a shared server and if I try to generate an email with more than 75 BCC addresses it will not be sent. I was instructed to use the listserve software that they provide to do mailings like this. They don't disapprove high volume mailing, but they do have a problem if you use BCC. I guess that it's either harder on the server or because its most likely spam.

    On my dedicated servers (another company) we can do whatever we please, but I do think that a large number of filters are tipped off by a high volume of BCC's ...

    olinux

    __________________________________________________ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/

    attached mail follows:


    hi, I want to include a file that is one directory above my web document root on the server. eg. www.mydom.com/file.php wants to include a file that is one dir higher, so that file is not accesible via the web. how can I access this file, if I specify a include("../inc.php"); it doesn't work. I also want to use this for downloading files only via php scripts! thanks

    --
    Rolf Vreijdenberger
    De Pannekoek en De Kale
    Maystraat 6
    2593 VW Den Haag
    T: 06-24245719
    E: rolfdepannekoekendekale.nl
    W: www.depannekoekendekale.nl
    

    attached mail follows:


    What error do you get, this should generaly work

    rolf vreijdenberger wrote:

    >hi, >I want to include a file that is one directory above my web document root on >the server. >eg. www.mydom.com/file.php wants to include a file that is one dir higher, >so that file is not accesible via the web. >how can I access this file, if I specify a include("../inc.php"); it doesn't >work. >I also want to use this for downloading files only via php scripts! >thanks > >-- >Rolf Vreijdenberger >De Pannekoek en De Kale >Maystraat 6 >2593 VW Den Haag >T: 06-24245719 >E: rolfdepannekoekendekale.nl >W: www.depannekoekendekale.nl > > > > >

    attached mail follows:


    Noah,

    If you delete the webmaster email key you might find that it makes up some non-existent e-mail address based on your server name.

    You could try adding an 'Errors-To: errorsyourdomain.com' header in the e-mail which is supposed to tell the receiving server to send any errors to a specific address. It's never used by anyone so chances are there are servers out there that will ignore it, but it's worth a go. Then, depending on what e-mail client you have, you could have a rule that did some clever jiggery-pokery and removed the offending address from the list without even bothering you.

    Regards, Rich

    On Monday 28 October 2002 01:24, Noah Spitzer-Williams wrote: Hey guys, My service sends out emails every few days to members who wish to have stats sent to them. The problem is once an email becomes inactive, I the webmaster gets a failure email sent to me. This is starting to add up and I can get upwards of 20 of these a day. It just seems likea waste of space and bandwidth... is there anyway I can prevent this? If i delete the webmaster email key in php.ini will my emails not have a reply address?

    attached mail follows:


    http://www.ioncube.com/encoder/online_encoder.php

    It's not free, but it's a LOT cheaper than the Zend Encoder.

    Regards, Rich

    -----Original Message----- From: R B [mailto:rbphphotmail.com] Sent: 31 October 2002 12:57 am To: listssharedserver.net Cc: php-generallists.php.net Subject: Re: [PHP] Free compiler for Win

    I want a php code compiler. I wrote above visual studio 6.0 because i read in the mailking list archieve that it was posible with that software, but i want a good free compiler because i don't want to distribute my php code.

    Thanks

    RB

    >From: Stuart <listssharedserver.net> >To: "R B" <rbphphotmail.com> >CC: php-generallists.php.net >Subject: Re: [PHP] Free compiler for Win Date: Thu, 31 Oct 2002 >00:40:05 >+0000 > >On Wednesday, Oct 30, 2002, at 23:02 Europe/London, R B wrote: >>I need to know how to compile php code with ms visual studio 6.0. > >Do you want to compile PHP or PHP code? If you want to compile PHP >itself >full instructions are included in the source distribution. If you want to >compile PHP code then I believe there are a couple about - Google should be >able to find them for you - but I'm pretty sure none of them work within >Visual Studio. If you are looking for a speed increase for a web site your >best bet is the Zend accelerator: >http://www.zend.com/store/products/zend-accelerator.php > >I hope that helps. > >-- >Stuart > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ MSN Fotos: la forma más fácil de compartir e imprimir fotos. http://photos.msn.es/support/worldwide.aspx

    attached mail follows:


    I want to the select the very last record from my MySQL DB. How do I do it?

    Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com <http://www.violasystems.com/> stephen.jacksonviolasystems.com Mobile +358 50 343 5159

    attached mail follows:


    Hi Steve,

    > I want to the select the very last record from > my MySQL DB. How do I do it?

    Depends what you mean by "last". You can either do a select with an order and a limit: SELECT foo FROM bar ORDER BY timestamp DESC LIMIT 1

    Or you can get the last primary key with PHP's mysql_insert_id() function.

    Cheers Jon

    attached mail follows:


    Steve Jackson wrote: > I want to the select the very last record from my MySQL DB. How do I > do it?

    If the table has an id, use select * from <table> order by id desc limit 0,1

    Grtz Erwin

    attached mail follows:


    <<is Constants.inc in the same directory as Stylesheet.php?>>

    It's in the same directory. Maybe I have to make things global? Lemme check on that.

    attached mail follows:


    Ok, I have my php/mysql site almost finished, are there any special tricks to making the site rise to the top of the list in search engines? I added all the info in the 'meta' part of the site.

    Thanks, Eddie

    attached mail follows:


    Too many to list in an email. This site has allot of information.

    http://searchenginewatch.com/

    attached mail follows:


    Ok, what am I missing? The file "sdlksd" doesn't exist, and the program's not dying, any ideas?

    #!/usr/local/php_4.2.3/bin/php -q <?php

    if(!file_exists("sdlksd")) die("DOH!");

    ?>

    Adam Voigt adam.voigtcryptocomm.com

    attached mail follows:


    Adam Voigt wrote:

    >#!/usr/local/php_4.2.3/bin/php -q ><?php > >if(!file_exists("sdlksd")) > die("DOH!"); > >?> > I think it works. I get "DOH!" printed when I try this. What do you get? I'm doing this from a web browser rather than command line though, so I don't use your #!/usr... line. HTH Chris

    attached mail follows:


    For some reason, if I didn't change it to:

    die("DOH!\n");

    it wouldn't work, I guess in console mode, you have to shunt an extra newline character (\n) before it will work.

    Adam Voigt adam.voigtcryptocomm.com

    On Thu, 2002-10-31 at 11:28, Chris Hewitt wrote: > Adam Voigt wrote: > > >#!/usr/local/php_4.2.3/bin/php -q > ><?php > > > >if(!file_exists("sdlksd")) > > die("DOH!"); > > > >?> > > > I think it works. I get "DOH!" printed when I try this. What do you get? > I'm doing this from a web browser rather than command line though, so I > don't use your #!/usr... line. > HTH > Chris > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Who can tell me where I can get the cracked Zend Encoder 3.0 ?

    attached mail follows:


    Go away...

    ----- Original Message ----- From: "jianking" <liaus10mail.net> To: "PHP Mail List" <php-generallists.php.net> Sent: Thursday, October 31, 2002 10:00 AM Subject: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0 ?

    > Who can tell me where I can get the cracked Zend Encoder 3.0 ? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On Thursday 31 Oct 2002 3:00 pm, jianking wrote: > Who can tell me where I can get the cracked Zend Encoder 3.0 ? Are you a muppet?

    This list is run by the people who make Zend Encoder!

    FOOL

    attached mail follows:


    Be gone already!

    On Thu, 2002-10-31 at 09:00, jianking wrote: > Who can tell me where I can get the cracked Zend Encoder 3.0 ? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    My, my. We have a rocket scientist amongst us....

    > -----Original Message----- > From: jianking [mailto:liaus10mail.net] > Sent: Thursday, October 31, 2002 10:00 AM > To: PHP Mail List > Subject: [PHP] Who can tell me where I can get the cracked Zend > Encoder3.0 ? > > > Who can tell me where I can get the cracked Zend Encoder 3.0 ? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Received fro Yves le duaron : Try this for example ;

    "'<".$pattern."([^>]*)?(\/)?>(?(2)|(.*)?<\/".$pattern.">)'siU"

    Please notice the U (ungreedy) to enhance the speed. This also match empty tags ...

    Sorry I have no login to send this to the mailing list, do this for me please !

    "Baroiller Pierre-Emmanuel" <baroillerdaoditu.com> a écrit dans le message de news: 20021030001215.4948.qmailpb1.pair.com... > Hi everyone... > > I've got a little problem : > > I've got an html template, with javasript functions and stylesheets in many > places... > This html template is made via a big big template handler i've done... > All seems to work... But, now, I would like to clean this html page to > procude a 'readable' page > If got a page like this : > <html> > <head> > </head> > <body> > xyxyxyxyxyx > <script> > function nb1() {} > </script> > yyyyyyyyyyyyyyyyy > yyyyyyyyyyyyyy > <style> > .outter {} > </style> > </body> > </html> > > And.. I would like to produce a page like this : > > <html> > <head> > <style> > .outter {} > </style> > <script> > function nb1() {} > </script> > </head> > <body> > xyxyxyxyxyx > yyyyyyyyyyyyyyyyy > yyyyyyyyyyyyyy > </body> > <html> > > > Anyone have and idea ? > I've tried with some preg_match_all() but... The only that work for me is > '/<head[^>]*>(.*)<\/head[^>]*>/si' witch returns the head content... (where > I'll add style & script contents).. > I've tried to change 'head' with 'script' or 'style' but.. It doesn't > work... > Like I'm not a regex guru ...I'm looking for help.. > > > Regards, > P.E. Baroiller > > >

    attached mail follows:


    http://www.auschron.com/issues/dispatch/2000-08-11/xtra_feature2.html

    -- 
    If there is no higher reason--and there is none--then my own reason must be 
    the supreme judge of my life.
    

    -Leo Nikolaevich Tolstoy

    attached mail follows:


    Ladies and Gentlemen,

    I would like to apologize for an eMail I just sent (Message-ID: <200210310751.54286.evancoeus-group.com>) to the php-general mailing list. The content of this eMail contained a link to a news article which detailed an absurd Texas law. I tried to send it to a friend (currently living in Texas) who I knew would find it amusing. Unfortunately, I clicked the wrong address, and it was sent to php-generallists.php.net.

    The content of this article, while not, IMHO, too offensive, were nonetheless completely inappropriate for posting to php-general. I would therefore like to formally apologize to any who recieved my eMail in error. It was an honest mistake. Sorry.

    Sincerly, Evan Nemerson

    On Thursday 31 October 2002 07:51 am, Evan Nemerson wrote: > http://www.auschron.com/issues/dispatch/2000-08-11/xtra_feature2.html

    attached mail follows:


    -----Original Message----- From: Evan Nemerson [mailto:evancoeus-group.com] Sent: Thursday, October 31, 2002 9:52 AM To: php-generallists.php.net Subject: [PHP] wow

    http://www.auschron.com/issues/dispatch/2000-08-11/xtra_feature2.html

    --
    If there is no higher reason--and there is none--then my own reason must be
    the supreme judge of my life.
    

    -Leo Nikolaevich Tolstoy

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

    attached mail follows:


    Hi all: I am having some problem with date validation I am trying to validate the date in a form Field I had provided a text field for date, so have to expect all the different possible entry, When i tried with checkdate() method it needs the parametes in (int month,int date, int year). It make the code more complex , What i am looking is some thing similar to is_int(), like the one we have in VB isdate() thanks in advance Prad

    __________________________________________________ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/

    attached mail follows:


    Hi,

    > I had provided a text field for date, so have to > expect all the different possible entry,

    This is generally a *very* bad idea. If a visitor to your site enters "4/3/01", do they mean the 4th March or the 3rd April?

    I find the best thing to do is provide three drop-downs: one contains numbers from 1-31, one contains the names of months, and one contains numbers from 2000 onwards. Using this, it's impossible to enter a date that could be interpreted in more than one way (although you still can do things like 31st Feb, so you still need checkdate).

    If you absolutely must do this you can always break the date up into components (split on the delimiter) and pass the components to checkdate().

    > When i tried with checkdate() method it needs the > parametes in (int month,int date, int year). It make > the code more complex

    Generally it's better to have complex code that works than simple code that doesn't.

    Cheers Jon

    attached mail follows:


    > I am having some problem with date validation > I am trying to validate the date in a form Field > I had provided a text field for date, so have to > expect all the different possible entry, > When i tried with checkdate() method it needs the > parametes in (int month,int date, int year). It make > the code more complex , What i am looking is some > thing similar to is_int(), like the one we have in VB > isdate() > thanks in advance

    There's nothing like that, you have to create it yourself. I personally hate the three drop down method that someone else suggested, but that's just me.

    I prefer to have a text box like you, but tell the user what the accepted format is. You can then write a simple function to parse their answer and make sure it's correct. You can also use that function to convert it to a Unix timestamp or MySQL timestamp.

    I prefer to accept my dates in the military format of DDMMMYYYY or DDMMMYY (17NOV75 or 17NOV1975).

    I use this function to validate the input:

    //check that date matches 17nov75 or 17nov1975 format. //if it does, returned as mysql format date yyyymmdd function date($input,$label,$format) { $retval = false;

    //defaults $month_array = array("jan"=>"01","feb"=>"02","mar"=>"03","apr"=>"04","may"=>"05","jun"=>"06 ","jul"=>"07","aug"=>"08","sep"=>"09","oct"=>"10","nov"=>"11","dec"=>"12"); $days_in_month = array(31,28,31,30,31,30,31,31,30,31,30,31);

    //verify date matches 17nov75 or 17nov1975 format

    if(eregi("^([0-9]{1,2})-?(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)-? ((19|20)?[0-9]{2})$",$input,$regs)) { //convert month to number $regs[2] = strtolower($regs[2]); $month = $month_array[$regs[2]];

    //make days two digits if it's not already $day = $regs[1]; if($day < 10 && strlen($day) == 1) { $day = "0" . $day; } if($regs[3] < 100) { //account for 2 digit year //< 30 = 20xx //> 30 = 19xx if($regs[3] < 30) { $year = "20" . $regs[3]; } else { $year = "19" . $regs[3]; } } else { $year = $regs[3]; }

    //verify day does not exceed days in month if(($day <= $days_in_month[$month-1] && $day > 0) || ($day==29 && $month==2 && $year%4==0)) { $retval = $year.$month.$day; } else { $this->error[] = $label . ": date has invalid day"; } } else { $this->error[] = $label . ": date does not match format of 17NOV75 or 17NOV1975"; }

    return $retval; }

    ---John Holmes...

    attached mail follows:


    I'm going to need it for a site I'm working on.... Any suggestions are much appreciated.

    ---
    René Fournier,
    renesmartslitters.com
    

    Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com

    SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada

    attached mail follows:


    Hurrican Electric does... here's a php -m from them:

    Running PHP 4.1.2 Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies

    [PHP Modules] xml standard session posix pcre mysql imap gd ftp db zlib

    [Zend Modules] Not Implemented

    I had to use pdflib once, and after talking to them for a bit they configured it so i could use dl()... They have no problems with security audits (as long as you give them a heads-up), servers are quick and dependable, they implemented privsep in OpenSSH in just a few hours back when there was that remote-root hole (chrooted jail w/ privsep)... Basically, I highly reccomend.

    On Thursday 31 October 2002 08:10 am, René Fournier wrote: > I'm going to need it for a site I'm working on.... > Any suggestions are much appreciated. > > > --- > René Fournier, > renesmartslitters.com > > Toll-free +1.888.886.2754 > Tel +1.403.291.3601 > Fax +1.403.250.5228 > www.smartslitters.com > > SmartSlitters International > #33, 1339 - 40th Ave NE > Calgary AB T2E 8N6 > Canada

    attached mail follows:


    Sorry... hurricane electric- www.he.net

    On Thursday 31 October 2002 08:37 am, Evan Nemerson wrote: > Hurrican Electric does... here's a php -m from them: > > Running PHP 4.1.2 > Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies > > [PHP Modules] > xml > standard > session > posix > pcre > mysql > imap > gd > ftp > db > zlib > > [Zend Modules] > Not Implemented > > > I had to use pdflib once, and after talking to them for a bit they > configured it so i could use dl()... They have no problems with security > audits (as long as you give them a heads-up), servers are quick and > dependable, they implemented privsep in OpenSSH in just a few hours back > when there was that remote-root hole (chrooted jail w/ privsep)... > Basically, I highly reccomend. > > On Thursday 31 October 2002 08:10 am, René Fournier wrote: > > I'm going to need it for a site I'm working on.... > > Any suggestions are much appreciated. > > > > > > --- > > René Fournier, > > renesmartslitters.com > > > > Toll-free +1.888.886.2754 > > Tel +1.403.291.3601 > > Fax +1.403.250.5228 > > www.smartslitters.com > > > > SmartSlitters International > > #33, 1339 - 40th Ave NE > > Calgary AB T2E 8N6 > > Canada

    -- 
    

    -

    attached mail follows:


    Hi,

    I'm wanting to change a character string from text into ascii code.

    I tried using the function:

    ebcdic2ascii()

    only to find out that it isn't supported with the latest versions of php, only version 3.

    I would appreciate any help from anyone with this topic.

    --
    

    Many Regards, Ben Chivers Super Sites Pro

    Get reliable and affordable web hosting from only $2.91pm at Super Hosts Pro - www.superhostspro.com

    attached mail follows:


    "ebcdic2ascii() is an Apache-specific function which is available only on EBCDIC based operating systems (OS/390, BS2000)." -php.net/ebcdic

    What kind of text??? Usually, the text is in ASCII? Do you want to convert to the actual numerical representation (ie A == 0x41)? If so, you can try bin2hex(). if you want it in decimal, prolly hexdec() in a foreach on a explode("\r\n", chunk_split($whatever, 2))'d bin2hex() string... I say that because I think bindec will convert the whole string at once, not char by char...

    On Thursday 31 October 2002 04:26 pm, Ben Chivers wrote: > Hi, > > I'm wanting to change a character string from text into ascii code. > > I tried using the function: > > ebcdic2ascii() > > only to find out that it isn't supported with the latest versions of php, > only version 3. > > I would appreciate any help from anyone with this topic.

    -- 
    Often a non-Christian knows something about the earth, the heavens, and the 
    other parts of the world, about the motions and orbits of the stars and even 
    their sizes and distances,... and this knowledge he holds with certainty from 
    reason and experience. It is thus offensive and disgraceful for an unbeliever 
    to hear a Christian talk nonsense about such things, claiming that what he is 
    saying is based in Scripture. We should do all that we can to avoid such an 
    embarrassing situation, which people see as ignorance in the Christian and 
    laugh to scorn.
    

    -Saint Augustine

    attached mail follows:


    Ops, of course. Sascha

    Am Donnerstag, 31. Oktober 2002 04:07 schrieb Chris Shiflett: > I think you mean turn on register_globals. :-) > > Sascha Cunz wrote: > >try > ><?php > > echo $_GET['tmp']; > >?> > > > >or turn off register_globals in your php.ini file. > > > >Am Mittwoch, 30. Oktober 2002 20:49 schrieb Manuel Jenne: > >>My Script: > >>Test.php > >> > >><? > >>echo $tmp; > >>?> > >> > >>My URL: > >>www.some.domain/test.php?tmp=5 > >> > >>My result: > >> > >>NOTHING !!!

    attached mail follows:


    I'm running PHP in console mode, on a script which uses:

    $f = fopen("php://stdin","r"); $data = fread($f,12); fclose($f);

    To get an IP address (a max of 12 characters), so the question is, how do I stop taking input when they hit return (ie, if there IP is less then the max 12 it will keep waiting for 12 characters of input) any ideas? (Other then to loop through taking what character at a time checking to see if it's the return key.)?

    Adam Voigt adam.voigtcryptocomm.com

    attached mail follows:


    Try fgets()... fread() is binary safe, so it doesn't terminate at \x0d\x0a. fges, on the other hand, does.

    On Thursday 31 October 2002 08:41 am, Adam Voigt wrote: > I'm running PHP in console mode, on a script which uses: > > $f = fopen("php://stdin","r"); > $data = fread($f,12); > fclose($f); > > To get an IP address (a max of 12 characters), so the question > is, how do I stop taking input when they hit return (ie, if > there IP is less then the max 12 it will keep waiting for 12 > characters of input) any ideas? (Other then to loop through > taking what character at a time checking to see if it's the > return key.)? > > Adam Voigt > adam.voigtcryptocomm.com

    -- 
    The world holds two classes of men -- intelligent men without religion, and 
    religious men without intelligence.
    

    -Abu'l-Ala-Al-Ma'arri

    attached mail follows:


    date("Y-m-d",strtotime("+1 month"))

    returns December 1st! This happens when you add 1 month to any day that doesn't exist in the next month. Quite annoying that you have to handle it like this:

    date("Y-m-d",strtotime("+1 month",strtotime(date("Y-m-1"))))

    -- 
    Jeff Bearer, RCHE
    Webmaster, PittsburghLIVE.com
    Winner 2002 Eppy Award, Best U.S. Newspaper Website
    

    attached mail follows:


    Not a very good solution, but +4 weeks works.

    Adam Voigt adam.voigtcryptocomm.com

    On Thu, 2002-10-31 at 11:33, Jeff Bearer wrote: > date("Y-m-d",strtotime("+1 month")) > > returns December 1st! This happens when you add 1 month to any day that > doesn't exist in the next month. Quite annoying that you have to handle > it like this: > > date("Y-m-d",strtotime("+1 month",strtotime(date("Y-m-1")))) > > > -- > Jeff Bearer, RCHE > Webmaster, PittsburghLIVE.com > Winner 2002 Eppy Award, Best U.S. Newspaper Website > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    > date("Y-m-d",strtotime("+1 month")) > > returns December 1st! This happens when you add 1 month to any day that > doesn't exist in the next month. Quite annoying that you have to handle > it like this: > > date("Y-m-d",strtotime("+1 month",strtotime(date("Y-m-1"))))

    How about

    echo date('y-m-d',strtotime('next month last day'));

    ---John Holmes...

    attached mail follows:


    How about - and a little more complex ...

    $mydate = date("d")!=1 && date("d",strtotime("+1 month"))==1 ? date("Y-m-d",strtotime("+1 month")-86400) : date("Y-m-d",strtotime("+1 month"));

    to summarise - if you perform your "+1 month" and it creates a day of 1, but the current day isn't 1 - do the same calculation, but a day less ... otherwise - do the month more. I haven't tested it - but it should give the results you want.

    -----Original Message----- From: 1LT John W. Holmes [mailto:holmes072000charter.net] Sent: 31 October 2002 17:10 To: Jeff Bearer; php-generallists.php.net Subject: Re: [PHP] strtotime bug? end of the month.

    > date("Y-m-d",strtotime("+1 month")) > > returns December 1st! This happens when you add 1 month to any day that > doesn't exist in the next month. Quite annoying that you have to handle > it like this: > > date("Y-m-d",strtotime("+1 month",strtotime(date("Y-m-1"))))

    How about

    echo date('y-m-d',strtotime('next month last day'));

    ---John Holmes...

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

    _____________________________________________________________________ This message has been checked for all known viruses by the MessageLabs Virus Control Centre.

    This message has been checked for all known viruses by the MessageLabs Virus Control Centre.

    *********************************************************************

    Notice: This email is confidential and may contain copyright material of Ocado Limited (the "Company"). Opinions and views expressed in this message may not necessarily reflect the opinions and views of the Company. If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses.

    Company reg. no. 3875000. Swallowdale Lane, Hemel Hempstead HP2 7PY

    *********************************************************************

    attached mail follows:


    Actually I only needed date("Y-m") so my solution works fine, and I didn't consider the problems with hard coding 1 into it. But thanks for the replies.

    On Thu, 2002-10-31 at 11:33, Jeff Bearer wrote: > date("Y-m-d",strtotime("+1 month")) > > returns December 1st! This happens when you add 1 month to any day that > doesn't exist in the next month. Quite annoying that you have to handle > it like this: > > date("Y-m-d",strtotime("+1 month",strtotime(date("Y-m-1")))) > > > -- > Jeff Bearer, RCHE > Webmaster, PittsburghLIVE.com > Winner 2002 Eppy Award, Best U.S. Newspaper Website > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -- 
    Jeff Bearer, RCHE
    Webmaster, PittsburghLIVE.com
    Winner 2002 Eppy Award, Best U.S. Newspaper Website
    

    attached mail follows:


    How do I change the key in an array without having a duplicate key=>$value?

    attached mail follows:


    > How do I change the key in an array without having a duplicate key=>$value?

    You could maybe use array_flip, change the value, then array_flip again.

    Or create your new key=>value and unset() the old one.

    $array[$new_key] = $array[$old_key]; unset($array[$old_key]);

    ---John Holmes...

    attached mail follows:


    I can set the page size with pdf_begin_page(), but if I set it to legal size I still have to change the printer setting to select the correct paper. Otherwise it just scales the page down to fit letter paper.

    Someone has insisted they've seen PDFs that automatically select the proper paper, but I can't find an option for it.

    Drew

    attached mail follows:


    Hello everyone,

    I upload some files on my server. If the number of lines of a file exceeds 159, I want to erase the file.

    Actually the unlink() function doesn't work, I have this error : Warning: Unlink failed (Permission denied) in D:\Data\WebSSL\tm\RFP\upload2.php on line 78.

    My code is :

    $num = 0; $fp = fopen ("temp/$i","r"); while ($data = fgetcsv ($fp, 1000, ",")) $num++; echo "number of lines : $num"; if ($num>150){ echo "you have too many hotels"; unlink("temp/$i"); } fclose ($fp);

    Do you have a clue ??

    Cyrille.

    attached mail follows:


    Unlink function isn't broken, you just don't have the correct rights set on the files, so PHP can't erase them, fix the permissions and that will take care of that error.

    Adam Voigt adam.voigtcryptocomm.com

    On Thu, 2002-10-31 at 12:46, Andres, Cyrille wrote: > Hello everyone, > > I upload some files on my server. If the number of lines of a file exceeds > 159, I want to erase the file. > > Actually the unlink() function doesn't work, I have this error : Warning: > Unlink failed (Permission denied) in D:\Data\WebSSL\tm\RFP\upload2.php on > line 78. > > My code is : > > $num = 0; > $fp = fopen ("temp/$i","r"); > while ($data = fgetcsv ($fp, 1000, ",")) > $num++; > > echo "number of lines : $num"; > > if ($num>150){ > echo "you have too many hotels"; > unlink("temp/$i"); > > } > fclose ($fp); > > > Do you have a clue ?? > > Cyrille. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    It probably isn't supported in windows. Unlink is (in C) in the unistd.h file. It provides a way to remove a file based on the unlink syscall (which i sincerly doubt is available from Win32). Looking at php.net/unlink... yep fourth comment: "unlink() function dosen't work with windows98, but it dose work on NT with apache server".

    If memory serves, there is an $OS variable... if not, check phpinfo(). You can do something like...

    if ( stristr($OS, "Win") ) exec("echo 'y' | del $file"); else unlink("$file");

    On Thursday 31 October 2002 09:46 am, Andres, Cyrille wrote: > Hello everyone, > > I upload some files on my server. If the number of lines of a file exceeds > 159, I want to erase the file. > > Actually the unlink() function doesn't work, I have this error : Warning: > Unlink failed (Permission denied) in D:\Data\WebSSL\tm\RFP\upload2.php on > line 78. > > My code is : > > $num = 0; > $fp = fopen ("temp/$i","r"); > while ($data = fgetcsv ($fp, 1000, ",")) > $num++; > > echo "number of lines : $num"; > > if ($num>150){ > echo "you have too many hotels"; > unlink("temp/$i"); > > } > fclose ($fp); > > > Do you have a clue ?? > > Cyrille.

    -- 
    I pledge allegiance to the flag, of the United States of America, and to the 
    republic for which it stands, one nation indivisible, with liberty, and 
    justice for all.
    

    -Pledge of Allegiance

    attached mail follows:


    Is

    stripslashes($_POST);

    the same as

    stripslashes($_POST['var1']); stripslashes($_POST['var2']); stripslashes($_POST['var3']);

    Thanks,

    Ed

    attached mail follows:


    Hello, Does anyone know a way around all the ^M at the end of each line that my php file writes to on a linux box?

    --------------------------------------------

    Brandon Orther

    WebIntellects Design/Development Manager

    <mailto:brandonwebintellects.com> brandonwebintellects.com 800-994-6364

    <http://www.webintellects.com/> www.webintellects.com

    --------------------------------------------

    attached mail follows:


    ahhhh.... what does your code look like??? What happens when you

    $fp = fopen("temp", a+); for ( $x=0 ; $x<10 ; $x++ ) fputs($fp, "$x\n"); fclose($fp);

    ???

    On Thursday 31 October 2002 09:44 am, Brandon Orther wrote: > Hello, > > Does anyone know a way around all the ^M at the end of each line that my > php file writes to on a linux box? > > > -------------------------------------------- > > Brandon Orther > > WebIntellects Design/Development Manager > > <mailto:brandonwebintellects.com> brandonwebintellects.com > 800-994-6364 > > <http://www.webintellects.com/> www.webintellects.com > > --------------------------------------------

    -- 
    I contend that we are both atheists. I just believe in one fewer god than you 
    do. When you understand why you dismiss all the other possible gods, you will 
    understand why I dismiss yours.
    

    -Stephen Roberts

    attached mail follows:


    is there a php command that could determine if the end of a page has been reached according to their print driver? I'm need to print out a report that could be multiple pages. I need to be able to put column headings & page numbers.

    thanks,

    Jeff

    attached mail follows:


    I tried to do what your talking about, never found a way, other then guessing where it would end with a lot of test runs. We ended up switching to writing out PDF's which is much more scientific where you can just check X,Y coordinates to see where you are on the page.

    Adam Voigt adam.voigtcryptocomm.com

    On Thu, 2002-10-31 at 13:08, Jeff Bluemel wrote: > is there a php command that could determine if the end of a page has been > reached according to their print driver? I'm need to print out a report > that could be multiple pages. I need to be able to put column headings & > page numbers. > > thanks, > > Jeff > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Might not be the best solution, but you _could_ create PDFs of your data, then print those...? Really clunky, but you could do nice formatting type stuff...

    On Thursday 31 October 2002 10:08 am, Jeff Bluemel wrote: > is there a php command that could determine if the end of a page has been > reached according to their print driver? I'm need to print out a report > that could be multiple pages. I need to be able to put column headings & > page numbers. > > thanks, > > Jeff

    -- 
    Prisons are built with stones of Law, Brothels with bricks of Religion.
    

    -William Blake

    attached mail follows:


    [snip] Might not be the best solution, but you _could_ create PDFs of your data, then print those...? Really clunky, but you could do nice formatting type stuff... [/snip]

    You may want to try the FPDF class ... http://www.fpdf.org

    HTH!

    Jay