OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Mon May 06 2002 - 13:37:21 CDT

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

    php-general Digest 6 May 2002 18:37:21 -0000 Issue 1329

    Topics (messages 96207 through 96301):

    Re: Newbie needs compile
            96207 by: Julian
            96210 by: Miguel Cruz
            96213 by: John Holmes
            96214 by: Sogno Kahlenberg
            96287 by: Miguel Cruz

    Who's having a good hosting experience these days?
            96208 by: The_RadiX

    Re: Secure user authentication
            96209 by: Pedro Pontes

    Zend - Studio, Encoder, Optimiser...
            96211 by: Brian McGarvie
            96216 by: Henrik Hansen

    Constructing a tree with recursion
            96212 by: Sasa Velickovic

    Question about fsockopen
            96215 by: Luc Saint-Elie
            96288 by: Miguel Cruz

    phpMyAdmin Question
            96217 by: Scott Reismanis
            96220 by: John Holmes

    Confirm Remote File exists !
            96218 by: John Fishworld

    Defining PHP varibles from URL
            96219 by: webmaster.tececo.com
            96221 by: Pedro Pontes
            96222 by: John Holmes
            96223 by: Jason Wong
            96227 by: David Freeman
            96229 by: Insomniac Admin

    Re: mail function
            96224 by: Matthew Ward
            96225 by: Jason Wong

    Re: PHP and SOAP
            96226 by: Udo Giacomozzi
            96275 by: Udo Giacomozzi

    No takers?
            96228 by: Anthony Rodriguez
            96246 by: Manuel Lemos

    Defining PHP varibles from URL Solved!
            96230 by: webmaster.tececo.com

    MYSQL ERROR CONNECT
            96231 by: Dani
            96234 by: The_RadiX
            96235 by: Dani
            96242 by: John Holmes

    mcrypt...
            96232 by: Brian McGarvie
            96239 by: Brian McGarvie
            96243 by: John Holmes

    Session Problem
            96233 by: Michael Luthe

    Access denied errors
            96236 by: Nick Wilson
            96238 by: Brian McGarvie

    highlighting Search Results
            96237 by: DC
            96240 by: Justin French

    Very Large MySQL Query String
            96241 by: David Bouw
            96249 by: Julio Nobrega Trabalhando
            96251 by: Kirk Babb

    SID is missing in 4.2.0
            96244 by: charlesk

    Formatting Information in header? Gridlines in Excel
            96245 by: Jay Blanchard
            96247 by: John Holmes
            96250 by: Jay Blanchard
            96252 by: John Holmes
            96254 by: Steve Bradwell
            96255 by: John Holmes
            96259 by: Jay Blanchard
            96264 by: Steve Bradwell

    Redirect after submit
            96248 by: Daniel Negron/KBE
            96253 by: John Holmes

    Re: Forum with PHP, without using mySQL..
            96256 by: Mizery De Aria
            96261 by: John Fishworld
            96262 by: Jeff Lewis
            96266 by: Jeff Lewis

    Capturing dynamic data and storing it into a variable
            96257 by: Mizery De Aria
            96265 by: Jason Wong

    Re: PHP compared to JSP
            96258 by: Robert Cummings

    Re: replace question
            96260 by: Josh & Valerie McCormack

    Re: Redirect after submit (solved)
            96263 by: Daniel Negron/KBE

    File upload problem
            96267 by: Linn Kubler
            96269 by: Francesc Leveque
            96271 by: Linn Kubler

    Install Question - Missing php.ini
            96268 by: David McInnis
            96270 by: Insomniac Admin

    PHP Training Course announcement
            96272 by: Michael Kimsal

    Re: Who's having a good hosting experience these days? {!?}
            96273 by: Liam MacKenzie

    function over loading?
            96274 by: Kris Vose
            96294 by: Kris Vose
            96299 by: Insomniac Admin

    pass. vars. betn. javascript and php
            96276 by: Pushkar Pradhan
            96279 by: Austin Marshall
            96289 by: John Holmes
            96295 by: Kevin Stone

    sum
            96277 by: Fifield, Mike
            96278 by: Analysis & Solutions
            96281 by: Austin Marshall

    Making a Client-side HTTPS Request
            96280 by: Jonathan Rosenberg
            96282 by: Austin Marshall
            96283 by: Jonathan Rosenberg
            96284 by: Austin Marshall
            96285 by: Jonathan Rosenberg
            96286 by: Austin Marshall

    Anyone use frames and PHP solution?
            96290 by: Jeff Lewis
            96292 by: Miguel Cruz
            96293 by: Greg Donald
            96300 by: Robert Cummings

    --enabel-pnctl / php sockets
            96291 by: Barry Smoke
            96297 by: Insomniac Admin

    Variables from XML Documents
            96296 by: Sebastian A.
            96298 by: Analysis & Solutions

    Grabbing ALL $_POST var at once.
            96301 by: David J Jackson

    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:


    > He did say he did /not/ want to invoke it from a browser :)
    I didn't think that PHP could run w/o one though, so my idea was to use a
    text browser, have it run the script, then exit out. As I said, I was
    probably wrong ;)
    Sabre

    attached mail follows:


    On Mon, 6 May 2002, Julian wrote:
    > I didn't think that PHP could run w/o one though, so my idea was to use a
    > text browser, have it run the script, then exit out. As I said, I was
    > probably wrong ;)

    Build the CGI version of PHP and you can run it from the command line like
    any other interpreter.

    miguel

    attached mail follows:


    > > He did say he did /not/ want to invoke it from a browser :)
    > I didn't think that PHP could run w/o one though, so my idea was to
    use a
    > text browser, have it run the script, then exit out. As I said, I was
    > probably wrong ;)

    Actually, that's exactly how it's typically done, using wget or lynx.
    Yes, you can compile a standalone version of PHP and use it directly,
    but most hosts do not have that. So, you add a line to your cron file
    that calls up your PHP script through lynx. Your script shouldn't return
    anything, just do what it has to do, or it should redirect output to a
    file or email. You can use the -dump switch for lynx to dump any output
    that does occur.

    I know he said he did not want to invoke it from a browser, but I think
    he meant that he didn't want to have to physically go to and load up the
    page himself.

    ---John Holmes...

    attached mail follows:


    Hi Miguel,

    It IS the CGI version. You mean I can

    ~~/php4/php /cgi-bin/cmanage/reindex.php

    to run it? Any other key points? Thanx.

    "Miguel Cruz" <mncstoic.net> wrote in message
    news:Pine.LNX.4.44.0205060300570.27218-100000stoic.net...
    > On Mon, 6 May 2002, Julian wrote:
    > > I didn't think that PHP could run w/o one though, so my idea was to use
    a
    > > text browser, have it run the script, then exit out. As I said, I was
    > > probably wrong ;)
    >
    > Build the CGI version of PHP and you can run it from the command line like
    > any other interpreter.
    >
    > miguel
    >

    attached mail follows:


    Yes, that works fine. Make it ~/php4/php -q if you don't
    want to get the Content-Type: header.

    miguel

    On Mon, 6 May 2002, Sogno Kahlenberg wrote:
    > It IS the CGI version. You mean I can
    >
    > ~~/php4/php /cgi-bin/cmanage/reindex.php
    >
    > to run it? Any other key points? Thanx.
    >
    >
    > "Miguel Cruz" <mncstoic.net> wrote in message
    > news:Pine.LNX.4.44.0205060300570.27218-100000stoic.net...
    > > On Mon, 6 May 2002, Julian wrote:
    > > > I didn't think that PHP could run w/o one though, so my idea was to use
    > a
    > > > text browser, have it run the script, then exit out. As I said, I was
    > > > probably wrong ;)
    > >
    > > Build the CGI version of PHP and you can run it from the command line like
    > > any other interpreter.
    > >
    > > miguel
    > >
    >
    >
    >
    >

    attached mail follows:


    Um Justin..

    Hi..

    or should I say.. Hi fellow Aussie mate .. :)

    Yeah I am in oz too and asked some hosting questions a while back..

    Your host has only 2GB downloads on the UNIX plan and also that's at US$15
    p/m.. isnt that a tad pricey?

    I was looking into powweb.com or aletia.com at much cheaper pricing and
    larger services (200mb storage, 10/12Gb p/m,etc)

    What do you think of these..

    Thanks...
    :::::::::::::::::::::::::::::::::::::::::::
    : Julien Bonastre [The-Spectrum.org CEO]
    : A.K.A. The_RadiX
    : the_radixhotkey.net.au
    : ABN: 64 235 749 494
    : QUT Student #: 04475739
    :::::::::::::::::::::::::::::::::::::::::::
    ----- Original Message -----
    From: "Justin French" <justinindent.com.au>
    To: <php-generallists.php.net>
    Sent: Monday, May 06, 2002 10:22 AM
    Subject: Re: [PHP] Who's having a good hosting experience these days?

    > Cheap?
    > I've been with experthost.com for around 8 months, with very little to
    > complain about... I've got a reseller account with about 12 domains, so
    i'm
    > paying around US$6each, and I think the standard is US$15each for one,
    $10ea
    > for two, and then a sliding scale up to 25 domains $5ea or something.
    >
    > It *shouldn't* be about the money, but I'm currently making a healthy
    profit
    > out of hosting some client domains under my account.
    >
    >
    > Reliable?
    > They have intelligent support staff on 24/7, and they've had one service
    > fallout in this time. It was a biggie, and I had to reload some data from
    > my local copy, but I'd like to believe this was a one-off.
    >
    >
    > Fast?
    > The service seems fast (although I'm in Australia, so pings times are
    > affected by sheer distance).
    >
    >
    > Feature Rich?
    > 50meg, 20POPs, redirects, groups, auto-responders, 2GB bandwidth, MySQL,
    > webmail, recent versions of Apache/MySQL/PHP, intelligent support staff,
    etc
    > etc.
    >
    >
    > I'm pretty happy. Better still, they offer a free 1 month test account,
    so
    > you can try them for yourself.
    >
    >
    > Justin French
    > --------------------
    > Creative Director
    > http://Indent.com.au
    > --------------------
    >
    >
    >
    >
    >
    > on 06/05/02 9:19 AM, David Freeman (dfreemanoutbackqld.net.au) wrote:
    >
    > >
    > >> My hosting service which WAS cool about 2 years ago has
    > >> grown into a bloated mess of zero logic.
    > >
    > > Fast, Reliable, Cheap, Feature-Rich
    > >
    > > Now pick any three.
    > >
    > > In the end I guess you get what you pay for. If you can only afford a
    > > lower price host then you only get lower value.
    > >
    > > CYA, Dave
    > >
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >

    attached mail follows:


    I wasn't in fact aware of that domain test thingie. So my main worry is no
    more.

    Thank you guys.

    --
    

    Pedro Alberto Pontes

    "The_radix" <the_radixhotkey.net.au> wrote in message news:004c01c1f348$2db81c40$3200a8c0oracle... > Pedro Pontes wrote: > > with a SIMPLE "equals" test. So if a user happens to get that crypted > value > > of the password (from a temporary file on the server, for example), then > all > > the little devil has to do is to create a dummy session user object, or in > > your case, array, set its password value to the stolen crypted hash and > then > > link freely to any of your pages. > > > well.... simply put? no.. > > If a user can get the crypted value off your server, AND also figure how to > trick the PHP engine into accepting a session cookie that wasn't created on > your domain, then that would be either: > a) you have dangerous and volatile PHP scripts that allow users to perform > such nasty tricks > b) your server security should be greatly improved.. > > > Jon Haworth wrote: > > Why are you passing the password around, hashed or not, in the first > place? > > Just have a yes/no flag for whether the session is an authenticated user > or > > not. > > > Is there any particular reason why you'd need to reauthenticate on every > > page? > > yes.. too true.. and simply put.. I could just pass the key or something > around instead and then in my PHP header that runs on each and every page > just reload a array with all the details anyway.. instead of passing around > the array.. > > oh and as for "reauthenticating" well that's done because.. well stupid > really when you think of it.. Unless they breach PHP as mentioned above, and > trick the session system, then there is little need to keep auth'ing them.. > > > Haha.. Actually I just looked at my code.. Sorry I was mistaken.. due to the > complexity of my site. it doesn't actually "reauth" as such.. instead it > checks to see the "status" of the user and does some log updates.. (to keep > track of user's still online etc..) ... when I say status.. I mean if I > ban/block users while logged in.. the changes happen AS SOON as they view > another page on the site and they get a lovely page telling them of their > predicament :) > > > > Anywayz.. very interesting topic.. I will keep an eye on this.. > > > Miguel says: > > This would only work if some other user is able to create files that the > > web server thinks are part of your domain (since the session cookies are > > domain-specific). Sounds to me like your problem here is severe server > > misconfiguration. If your server environment is that insecure, then > > worrying about anything else is sort of a waste of time. > > Yes.. Too true.. > > > Michael Kismal says: > > What I can't figure out is why you're allowing people to just randomly > > put pages on your server. If someone was to randomly register a similar > > user object, etc - why bother? If I can put pages on your server and > > execute them, I'd do some something far more malicious than just pretend > > I'm "user X". > > > Precisely what I am getting at too.. > > > Yes the general opinion seems to be: "If someone can get the session handler > of the PHP engine tricked so easily, or gain access so easily to your > site... Then you'd better look into that WAY before you start picking on > authentication schemes".. > > > No harm intended ok.. Just pointing out some facts.. > > > Hope I can help.. Would love to demonstate some ideas/etc.. about how I do > security stuff.. > > > > Bye > ::::::::::::::::::::::::::::::::::::::::::: > : Julien Bonastre [The-Spectrum.org CEO] > : A.K.A. The_RadiX > : the_radixhotkey.net.au > : ABN: 64 235 749 494 > : QUT Student :: 04475739 > ::::::::::::::::::::::::::::::::::::::::::: > ----- Original Message ----- > From: "Pedro Pontes" <ppontesmyrealbox.com> > To: <php-generallists.php.net> > Sent: Saturday, May 04, 2002 12:33 AM > Subject: Re: [PHP] Secure user authentication > > > > First of all, thank you for your devote answer. > > > > The method I was thinking about before was to pass the md5 hash of the > > password around, as the passwords are already md5'ed in the DB. Your > method > > seems more secure as you use a totally spiced-up and personalized > encryption > > engine. > > > > But, the main question remains, I think. If you pass your crypted password > > around, then, in each page, you must check it agains't the database entry > > with a SIMPLE "equals" test. So if a user happens to get that crypted > value > > of the password (from a temporary file on the server, for example), then > all > > the little devil has to do is to create a dummy session user object, or in > > your case, array, set its password value to the stolen crypted hash and > then > > link freely to any of your pages. > > > > Am I right? Thanks again. > > > > -- > > > > > > Pedro Alberto Pontes > > > > "The_radix" <the_radixhotkey.net.au> wrote in message > > news:003601c1f2aa$6120dbb0$f86086cboracle... > > > Hmm yes good question.. > > > > > > Security was (still is) a major for my organisation's site and I did > > > something a little unique and robust.. > > > > > > > > > I love programming and I hate "stealing" (some call it borrowing) other > > > programmer's scripts/code from the web.. therefore I write it _all_ > > myself.. > > > > > > > > > Trust me.. Sometimes this is a dumb attitude to take such as when I > > created > > > my first Perl discussion forum.. still running I think > > > (http://the-radix.hypermart.net i think) and that consisted of this huge > > > perl system to maintain the files etc.. for members and the forum.. > > > > > > > > > Anyway! off the sub now.. > > > > > > > > > I used sessions and pass around the array of columns for that > member/user > > .. > > > but the password is put through my own fairly unbreakable (yes.. I am > > > serious) password key system.. > > > > > > > > > An idea to make your own safe keys to pass them around or use for > > > authenticating is simple maths and a crypt() or my preferred: md5() > > > function.. > > > > > > > > > I simply do some lovely maths like for each char of pword I loop through > > > them and append them onto the entire pword string plus the length, get > the > > > md5 of that.. then md5 that md5 with the md5 of the previous result and > > then > > > do some maths, pick some specified characters (like every 3rd or > whatever > > > you wish) .. strrev( reverse the string) md5 that again, all md5'ed > > again.. > > > > > > > > > :) haha, you get the idea.. > > > > > > > > > SO basically you'll end up with a nice 32 char string which is QUITE > safe > > to > > > pass around and the chance anyone's gonna decrypt it IMHO is about > zilch, > > > buckley's, zut, nil, null, zero.. > > > > > > > > > And all you have to do, is when they login once, just run the password > > they > > > entered through this "algorithm" and check it against the stored algo'd > > > password.. > > > > > > Ah yes that's the next thing.. the DB passwords will also have to be > proc. > > > using your algorithm.. > > > > > > So it's kinda like a key security idea.. you are not meant to decrypt > md5 > > > hashes.. instead recreate it using what you are supplied and then > compare > > > both hashes.. > > > > > > > > > Simple :P > > > > > > > > > > > > > > > Ok hope that helps > > > > > > ::::::::::::::::::::::::::::::::::::::::::: > > > : Julien Bonastre [The-Spectrum.org CEO] > > > : A.K.A. The_RadiX > > > : the_radixhotkey.net.au > > > : ABN: 64 235 749 494 > > > : QUT Student :: 04475739 > > > ::::::::::::::::::::::::::::::::::::::::::: > > > ----- Original Message ----- > > > From: "Pedro Pontes" <ppontesmyrealbox.com> > > > To: <php-generallists.php.net> > > > Sent: Friday, May 03, 2002 10:19 PM > > > Subject: [PHP] Secure user authentication > > > > > > > > > > Hello, > > > > > > > > I'm using the regular user authentication method, that is, check the > > > > specified login/pass agains't the entries in the DB, if it is valid, > > > create > > > > the user object and register it with the section. > > > > > > > > How can we prevent any user from creating a simple PHP page that > creates > > a > > > > simmilar user object, registers it with the session and then links to > my > > > > pages? One way would be to check, in each page, for the password in > the > > > > session user object and match it with the DB entry, but storing the > > > password > > > > in the session is not advisable, as other users in the host system may > > > have > > > > access to that information. > > > > > > > > Please advise. > > > > > > > > Thank you ver much for your time. > > > > > > > > -- > > > > > > > > > > > > Pedro Alberto Pontes > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    I am writing several php applications wich demand speed & security.

    I'm just looking for some reassurances from some ppl that might be using the ZEND products to deliver this.

    Is the speed increase using the optimiser noticable?

    How well does the Encoder work?

    I will be trying them out today (the encoder neway), and Studio.

    Any comments would be appreciated by ppl who use it on any medium to large-scale deployment...

    Cheers,

    Brian...

    =============================================== Brian M McGarvie, Web Appications Co-ordinator/Consultant =============================================== [ www.mcgarvie.net | www.lennox-mckinlay.co.uk] ===============================================

    attached mail follows:


    bmcgarvielennox-mckinlay.co.uk (Brian McGarvie) wrote:

    > I am writing several php applications wich demand speed & security. > > I'm just looking for some reassurances from some ppl that might be using > the ZEND products to deliver this. > > Is the speed increase using the optimiser noticable? > > How well does the Encoder work?

    for this part I can say it works very well, you just encode your code with the command line encoder, upload it to wherever and it runs (if the zend optimizer is running) and the code is very unreadable.

    -- 
    Henrik Hansen
    

    attached mail follows:


    Hi all,

    ok, here is my problem.

    I have a table in my db which is like this:

    id name parent_id 1 menu1 0 2 menu2 0 3 menu3 0 4 menu4 0 5 sub1 1 6 sub2 2 7 sub3 3 8 sub4 6 9 sub5 7 10 sub6 9

    which would be a tree like this (well, not actually a tree, more like a couple of linear linear lists starting from a point where parent_id == 0):

    menu1 -> sub1 menu2 -> sub2 -> sub4 menu3 -> sub3 -> sub5 -> sub6 menu4

    or something like this :)

    The table always has less than 200 rows, so I just go right ahead an read all values into my array $categories. So now everything is let's say in: $categories['id'] $categories['name'] and $categories['parent_id']

    I now make my $tree array and push every array from categories on it if it meets $categories['parent_id'] == 0 to start with

    for ($i=0; $i < count($categories); $i++) { if ($categories['parent_id'] == 0) $tree[] = $categories[$i]; }

    Now comes the hard part where help would be appreciated. How do I recursively run through $categories and add all the subs to the right $tree?

    If you have any ideas I would be very glad.

    Sasa Velickovic http://www.hexatex.de

    PS: I don't look for a nested sets algo to recursively select the right datasets from the database ...

    attached mail follows:


    Hello

    I use a class to parse a RSS feed, my problem is that when the distant site is down my own site is stuck (because my class waits for an answer that doesn't come..) The logical answer is to use a fsockopen before to control the connection. Reading the doc I see : int fsockopen ( string hostname, int port [, int errno [, string errstr [, float timeout]]])

    fsockopen allows to control if the hostname is up and running

    My problem is that hostname returns the home page that is in HTML, the page that I want is a php page.

    HTML page are not often down (only when all the server is down) php pages are often down (because mySQL problem or PHP problems)

    So I'd like to be able to control if a specific url is OK and not only the hostname.

    How can I do that ?

    Thanks in advance

    Luc

    attached mail follows:


    On Mon, 6 May 2002, Luc Saint-Elie wrote: > I use a class to parse a RSS feed, my problem is that when the distant > site is down my own site is stuck (because my class waits for an answer > that doesn't come..) The logical answer is to use a fsockopen before to > control the connection. Reading the doc I see : int fsockopen ( string > hostname, int port [, int errno [, string errstr [, float timeout]]]) > > fsockopen allows to control if the hostname is up and running > > My problem is that hostname returns the home page that is in HTML, the page > that I want is a php page. > > HTML page are not often down (only when all the server is down) php pages > are often down (because mySQL problem or PHP problems) > > So I'd like to be able to control if a specific url is OK and not only the > hostname. > > How can I do that ?

    Does the class already use fsockopen() to make the connection? If not, then throwing in a call to that function won't do anything. It's a fundamentally different way of having PHP get the data, and the class would have to be rewritte.

    I'm also not clear on what you're really asking. You want to set a timeout but you only want it to apply to pages that you are guessing were generated by PHP, because you don't think that pages you guess are static will need it? Why would it hurt to use the timeout there too?

    miguel

    attached mail follows:


    Hey all, This question is mainly mySQL related however I believe the problem maybe caused by phpMyAdmin which is why I am posting it here. Anyhow does mySQL tables allow for a mix of char / varchar columns? Because if I try to create a table in phpMyAdmin for example: CREATE TABLE generic ( title char(20) NOT NULL, title_alternate varchar(40) NOT NULL ) TYPE=MyISAM; it will always be stored as: CREATE TABLE generic ( title varchar(20) NOT NULL, title_alternate varchar(40) NOT NULL ) TYPE=MyISAM; and I am unable to force it to char. The only reason why this is a problem is char columns are quicker to process thus it would be ideal to mix such columns rather than be forced to create another table for example, Thanks for your time, Scott Reismanis

    attached mail follows:


    http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Sil ent_column_changes

    ---John Holmes...

    ----- Original Message ----- From: "Scott Reismanis" <areismanbigpond.net.au> To: <php-generallists.php.net> Sent: Monday, May 06, 2002 4:58 AM Subject: [PHP] phpMyAdmin Question

    > Hey all, > > This question is mainly mySQL related however I believe the problem > maybe caused by phpMyAdmin which is why I am posting it here. Anyhow > does mySQL tables allow for a mix of char / varchar columns? Because if > I try to create a table in phpMyAdmin for example: > > CREATE TABLE generic ( > title char(20) NOT NULL, > title_alternate varchar(40) NOT NULL > ) TYPE=MyISAM; > > it will always be stored as: > > CREATE TABLE generic ( > title varchar(20) NOT NULL, > title_alternate varchar(40) NOT NULL > ) TYPE=MyISAM; > > and I am unable to force it to char. The only reason why this is a > problem is char columns are quicker to process thus it would be ideal to > mix such columns rather than be forced to create another table for > example, > > Thanks for your time, > > Scott Reismanis > > > >

    attached mail follows:


    I've got a form where people can enter a link into !

    What's the best and quickest way of confirming if the link exists ! Just use fpassthru and see if you get an error ? Or has anyone got any better suggestions ??

    Regards John

    attached mail follows:


    I don't mean to be a pain but could someone send me a working example?

    I am what you would probably call a 'newbie'

    For those who don't know here is my previous message

    can't seem to define a varible from the url entered into a browser.

    I wish to use the following code or something like it. <script language="php">

    $file = ""; //the above is defined from the url

    include "$file";

    </script>

    It could be what I was typing in the url bar.

    file.php?file=foobar.inc

    Thanks,

    JJ Harrison webmastertececo.com www.tececo.com

    attached mail follows:


    The way you're doing it now, you're first ERASING whatever value passed from the URL, with

    $file="";

    and then trying to use it...

    If this ' $file="" ' is some declaration attempt, just drop it, you don't need to declare variables in PHP. Just check if $file has a value and then use it.

    For example,

    if ($file != "") include($file);

    Hope it helps.

    --
    

    Pedro Alberto Pontes <webmastertececo.com> wrote in message news:009501c1f4e0$636d3e80$0100a8c0JohnH... I don't mean to be a pain but could someone send me a working example?

    I am what you would probably call a 'newbie'

    For those who don't know here is my previous message

    can't seem to define a varible from the url entered into a browser.

    I wish to use the following code or something like it. <script language="php"> $file = ""; //the above is defined from the url include "$file"; </script> It could be what I was typing in the url bar. file.php?fileobar.inc

    Thanks, JJ Harrison webmastertececo.com www.tececo.com

    attached mail follows:


    I would advise against doing that unless you really know what your doing. Doing it that way will allow anyone to type in any file on your server that PHP has access to and load it, or possibly load a file off of another server.

    That said, if you have a url like page.php?file=foo.inc

    Then that value will be present in $_GET["file"] (PHP 4.1+) or $HTTP_GET_VARS["file"] (PHP <4.1)

    include($_GET["file"]); include($HTTP_GET_VARS["file"]);

    ---John Holmes... ----- Original Message ----- From: webmastertececo.com To: php-general-uc.1020556536.jjfnbcbjfcmealicppog-webmaster=tececo.comlists.php.net Sent: Monday, May 06, 2002 5:28 AM Subject: [PHP] Defining PHP varibles from URL

    I don't mean to be a pain but could someone send me a working example?

    I am what you would probably call a 'newbie'

    For those who don't know here is my previous message

    can't seem to define a varible from the url entered into a browser.

    I wish to use the following code or something like it. <script language="php">

    $file = ""; //the above is defined from the url

    include "$file";

    </script>

    It could be what I was typing in the url bar.

    file.php?file=foobar.inc

    Thanks,

    JJ Harrison webmastertececo.com www.tececo.com

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

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

    attached mail follows:


    On Monday 06 May 2002 17:28, webmastertececo.com wrote: > I don't mean to be a pain but could someone send me a working example? > > I am what you would probably call a 'newbie' > > For those who don't know here is my previous message

    Didn't you read the numerous replies to your first posting?

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Paranoid Club meeting this Friday. Now ... just try to find out where! */

    attached mail follows:


    -----Original Message----- I don't mean to be a pain but could someone send me a working example? -----Original Message-----

    This was replied to already by me and others. Didn't you read the replies?

    In any event, here's what I wrote last time...

    -----Original Message----- <script language="php"> $file = ""; //the above is defined from the url include "$file"; </script> It could be what I was typing in the url bar. file.php?file=foobar.inc -----Original Message-----

    Hmm, so you define $file in your url as "foobar.inc" and then, in the page itself you take change $file to be "".

    At least, that's how I'd read it. I'd suggest, it's not an overly good idea to include a file like this as someone else has already mentioned.

    In any event, your fix would have to be something like this:

    <script language="php">

    If (!isset($file) || empty($file)) { $file = "some file"; } Include "$file" ;

    </script>

    That way you're only going to over-write the contents of $file if it's already either unset or empty.

    CYA, Dave

    attached mail follows:


    A simple example might be (unoptimised for clarity):

    http://www.myserver.com/someurl/page.php?file=home

    <?php

    // Get the file from the url - assuming PHP > v4.1.x $file = $_GET("file");

    // Remove case sensitivity $file = strtolower($file);

    // To stop people including just ANY old file, we are going to use a switch // to validate the page they are after. All include files have been appended // with .page in order to stop /etc/passwd being outputed (for instance). switch ($file) { case "main" : case "home" : case "elephant" : case "..." : { include "pages/".$file.".page"; } default : { // "unknown.page" could be an error message giving out a 404. include "unknown.page"; } } exit;

    ?>

    Switch is one way of doing it, you could also do it through array's (using in_array) if you wish all to have the same action. Switch's allow you to specify different actions for different pages (when you move onto session validated pages you'll find that ability invaluble) ... Also comes in useful when your variable parsing script is in the same php file as your display script. [Id give examples but Im too tired to be bothered heh]

    - Dan

    attached mail follows:


    You can add further variables to the end of your current mail() function to specify the name of who its from, and the email address that they will send the message to when they use the reply function on their email program, like this:

    mail("joecoolexample.com", "My Subject", "Line 1\nLine 2\nLine 3", "From:Your Name\nReply-To: sendersemail.address");

    "Diana Castillo" <diana.castillonvtechnologies.com> wrote in message news:20020505220213.16877.qmailpb1.pair.com... > Hi, if I use the mail function, as in : > mail("joecoolexample.com", "My Subject", "Line 1\nLine 2\nLine 3"); > The mail comes from "Webserver" How can I change the from ? > > > >

    attached mail follows:


    On Monday 06 May 2002 06:31, Matthew Ward wrote: > You can add further variables to the end of your current mail() function to > specify the name of who its from, and the email address that they will send > the message to when they use the reply function on their email program, > like this: > > mail("joecoolexample.com", "My Subject", "Line 1\nLine 2\nLine 3", > "From:Your Name\nReply-To: sendersemail.address");

    Mail headers should be separated by "\r\n".

    http://cr.yp.to/immhf/header.html

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* How many "coming men" has one known! Where on earth do they all go to? -- Sir Arthur Wing Pinero */

    attached mail follows:


    cedricneopeak.com (Cédric veilleux) wrote in news:200205031323.30793.cedricneopeak.com:

    > Udo, > > Could you point us to the SOAP classes you've come accross? I > am in the same > situation as you are but haven't found much yet. There is indeed a > SOAP server class from Manuel available at phpclasses.org, this is the > first one I've seen. I haven't found a SOAP client class yet.

    Some links I've found:

    http://dietrich.ganx4.com/nusoap/ http://www.phpclasses.org/browse.html/package/251 http://sourceforge.net/projects/phpxmlp/ http://pear.php.net/ http://aspn.activestate.com/ASPN/WebServices/SWSAPI/phptut

    http://www.gigaideas.com.cn/phpsoap/ or, since the server is currently down, try: http://web.archive.org/http://www.gigaideas.com.cn/phpsoap/

    It's a bit difficult for me choosing the right one to start with. In Delphi it's easy to create a SOAP server but with PHP it seems a lot of hand work. What I need is like declaring the published functions and the SOAP implementation creates the WSDL and everything for me or vice-vers: create the needed PHP code from a WSDL.

    > > The lack of SOAP implementations in PHP made me think that I'd > better > use > XMLRPC instead, which is a similar protocol that has been around > longer. There is a PHP extension available for XMLRPC > > http://www.php.net/manual/en/ref.xmlrpc.php What are the differences to SOAP?

    -- 
    Udo Giacomozzi - udonewsnova-sys.net
    www.nova-sys.net - www.guweb.com
    The disadvantage of intelligence is that one 
    is constantly obliged to go on learning.
    

    Posted by ELKNews 1.0.4-B Empower your News Reader! http://www.atozedsoftware.com

    attached mail follows:


    Hello Cedric,

    I've played around a bit with SOAP and PHP now and i can suggest you the following SOAP implementation:

    http://dietrich.ganx4.com/nusoap/index.php

    This work is being developed further for PEAR but they have no stabe version yet:

    http://pear.php.net/

    With very few code lines (applies to PHP and Delphi) I was able to - create a tiny web service that responses with a greeting to a given name and that contains some functions that return the current average server load, memory usage etc. - made a tiny application in delphi (had about 10 lines to write) that can call each of these functions and display them in a dialog box.

    it worked from scratch! :-)) I'll have a more in-depth look when I have time but the current implementation seems quite good and is easy to use. (need a way to create the WSDL file however).

    Cheers, Udo

    Posted by ELKNews 1.0.4-B Empower your News Reader! http://www.atozedsoftware.com

    attached mail follows:


    Please HELP!

    PROBLEM

    When a php script uses mail() and sendmail, if the e-mail address is not right, the e-mail is returned to the envelope sender (the hosting provider), NOT to the "From", "Reply-To", "Return-Path", or any other additional headers included in mail().

    Apparently, this problem is faced by any user who utilizes a hosting provider.

    SOLUTION

    I've found 2 php classes (developed by Manuel Lemo) that address this problem.

    The first, email_message.php was built to send MIME-encoded messages.

    The second, sendmail_message.php extends the first by addressing the return-path problem.

    Unfortunately, the first parses the message to allow sending MIME-encoded messages. For many who are only sending plain text messages, this is unnecessary processing.

    HELP NEEDED

    I would like to consolidate these 2 classes and eliminate the parsing. Unfortunately, I'm a newbie and need help from the pros.

    If anyone is interested in participating in this project, please e-mail me directly at afrodriguezatt.net.

    After completion this "new" class would be submitted to www.phpclasses.org for everyone to use.

    Thanks!

    Anthony F. Rodriguez (afrodriguezatt.net)

    attached mail follows:


    Hello,

    Anthony Rodriguez wrote: > > Please HELP! > > PROBLEM > > When a php script uses mail() and sendmail, if the e-mail address is not > right, the e-mail is returned to the envelope sender (the hosting > provider), NOT to the "From", "Reply-To", "Return-Path", or any other > additional headers included in mail(). > > Apparently, this problem is faced by any user who utilizes a hosting > provider. > > SOLUTION > > I've found 2 php classes (developed by Manuel Lemo) that address this > problem. > > The first, email_message.php was built to send MIME-encoded messages. > > The second, sendmail_message.php extends the first by addressing the > return-path problem. > > Unfortunately, the first parses the message to allow sending > MIME-encoded messages. For many who are only sending plain text > messages, this is unnecessary processing.

    I am not sure what you mean, but the class does not parse the message, but rather encodes it in a way that it will not be refused by some mail servers.

    > HELP NEEDED > > I would like to consolidate these 2 classes and eliminate the parsing. > Unfortunately, I'm a newbie and need help from the pros. > > If anyone is interested in participating in this project, please e-mail > me directly at afrodriguezatt.net. > > After completion this "new" class would be submitted to > www.phpclasses.org for everyone to use.

    Encoding in MIME is generally a requirement for sending messages, but even if it were not usually required, what would be the importance of not doing it?

    You can always send your messages directly to the recipients SMTP server with this class:

    http://www.phpclasses.org/browse.html/package/14.html

    But if you do not format the message according to the MIME standards, chances are that your message is refused, bounced or even discarded by some SPAM filter.

    Regards, Manuel Lemos

    attached mail follows:


    Sorry I did read all your replies etc. They were helpful.

    I have now solved the 'problem' and thank you all.

    I have less than week of experiance in PHP and am still learning.

    JJ Harrison webmastertececo.com www.tececo.com

    attached mail follows:


    Hi, I have been using this code for while:

    //1. CONNECT TO DATABASE mysql_connect("localhost");

    //2. SELECT A DATABASE mysql_select_db("smpk2");

    to connect to MYSQL database.

    but I get this error:

    Warning: Access denied for user: 'nobodylocalhost' (Using password: NO) in /www/host/doms/com/smpk2/create_tables.php on line 15

    Warning: MySQL Connection Failed: Access denied for user: 'nobodylocalhost' (Using password: NO) in /www/host/doms/com/smpk2/create_tables.php on line 15

    could someone help me, please???

    thanks

    attached mail follows:


    Ha.. Aussie person too eh?

    Ok.. Have you recently updated your php system?

    Reason I ask is the way you are using the functions mysql_connect and mysql_select_db are quite ... "bad" to say the least

    You should have permissions setup for a root account or something in your mysql.user table and then you can do this:

    $DB=mysql_connect("localhost","root","password");

    notice I now have a user/pass arg and also I am assigning the handle of the connection to a var ($DB)

    then use:

    mysql_select_db("smpk2",$DB);

    and that should work fine as long as user and pass are right and db exists.. (and server has mysql running of course :P )

    if not.. let us know..

    If you want to know how to setup users and permissions for MySQL.. give us a yell.. be glad to help out..

    ::::::::::::::::::::::::::::::::::::::::::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : the_radixhotkey.net.au : ABN: 64 235 749 494 : QUT Student #: 04475739 ::::::::::::::::::::::::::::::::::::::::::: ----- Original Message ----- From: "Dani" <universal2001iprimus.com.au> To: <php-generallists.php.net> Sent: Monday, May 06, 2002 11:49 PM Subject: [PHP] MYSQL ERROR CONNECT

    > Hi, > I have been using this code for while: > > //1. CONNECT TO DATABASE > mysql_connect("localhost"); > > //2. SELECT A DATABASE > mysql_select_db("smpk2"); > > to connect to MYSQL database. > > but I get this error: > > Warning: Access denied for user: 'nobodylocalhost' (Using password: NO) > in /www/host/doms/com/smpk2/create_tables.php on line 15 > > Warning: MySQL Connection Failed: Access denied for user: > 'nobodylocalhost' (Using password: NO) in > /www/host/doms/com/smpk2/create_tables.php on line 15 > > could someone help me, please??? > > thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Thanks radix!

    I'm new to PHP that's why..

    so, what should I do to fix this?

    please advise..

    thanks again.

    Dani

    The_RadiX wrote:

    > Ha.. Aussie person too eh? > > Ok.. Have you recently updated your php system? > > Reason I ask is the way you are using the functions mysql_connect and > mysql_select_db are quite ... "bad" to say the least > > You should have permissions setup for a root account or something in your > mysql.user table and then you can do this: > > $DB=mysql_connect("localhost","root","password"); > > notice I now have a user/pass arg and also I am assigning the handle of the > connection to a var ($DB) > > then use: > > mysql_select_db("smpk2",$DB); > > and that should work fine as long as user and pass are right and db exists.. > (and server has mysql running of course :P ) > > if not.. let us know.. > > If you want to know how to setup users and permissions for MySQL.. give us a > yell.. be glad to help out.. > > ::::::::::::::::::::::::::::::::::::::::::: > : Julien Bonastre [The-Spectrum.org CEO] > : A.K.A. The_RadiX > : the_radixhotkey.net.au > : ABN: 64 235 749 494 > : QUT Student #: 04475739 > ::::::::::::::::::::::::::::::::::::::::::: > ----- Original Message ----- > From: "Dani" <universal2001iprimus.com.au> > To: <php-generallists.php.net> > Sent: Monday, May 06, 2002 11:49 PM > Subject: [PHP] MYSQL ERROR CONNECT > > > Hi, > > I have been using this code for while: > > > > //1. CONNECT TO DATABASE > > mysql_connect("localhost"); > > > > //2. SELECT A DATABASE > > mysql_select_db("smpk2"); > > > > to connect to MYSQL database. > > > > but I get this error: > > > > Warning: Access denied for user: 'nobodylocalhost' (Using password: NO) > > in /www/host/doms/com/smpk2/create_tables.php on line 15 > > > > Warning: MySQL Connection Failed: Access denied for user: > > 'nobodylocalhost' (Using password: NO) in > > /www/host/doms/com/smpk2/create_tables.php on line 15 > > > > could someone help me, please??? > > > > thanks > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    > Warning: Access denied for user: 'nobodylocalhost' (Using password: NO) > in /www/host/doms/com/smpk2/create_tables.php on line 15

    Hmm...let me see if I can decrypt that message. Apparently you were denied access with user nobody and you were not using a password.

    Read the manual page on mysql_connect(), you're missing some arguments.

    ---John Holmes...

    attached mail follows:


    I have uncommented the .dll extension in my php.ini however the functions are still unavailable? What am I doing wrong?

    attached mail follows:


    has ne1 got php_mcrypt.dll or the source code for it? the website for it seems to be unavailable.

    attached mail follows:


    Did you restart your server and read the manual pages on mcrypt to see if you need any other files? Some extensions can only be enabled at compile time.

    ---John Holmes...

    > -----Original Message----- > From: Brian McGarvie [mailto:bmcgarvielennox-mckinlay.co.uk] > Sent: Monday, May 06, 2002 3:57 AM > To: php-generallists.php.net > Subject: [PHP] mcrypt... > > I have uncommented the .dll extension in my php.ini however the > functions are still unavailable? What am I doing wrong? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi

    I ve a Problem when i try to use sessions. I can do destroy_session() and at the next time there is session without starting session_start(). I closed the browser and startet a site which only does: <?php echo $PHPSESSID; ?> and he shows me a session id without having a anything in my session.save_path :(

    when i upload the sites to tripod everything workes fine. Seem's so that there is a misconfiguration at my php.ini but i don't know what the failure is. I hope someone of you has an idea.

    tnx

    mySTYX

    attached mail follows:


    -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

    Hi everyone, not sure if this is a php or mysql problem: I seem to be able to connect in my script to mysql at the beginning but by the time I make the third or fourth call I get 'Access denied' errors?

    Here is the function I use to connect: *Any* insight would be welcome :-)

    function _db_connect() { if(!$this->link_id) { $this->link_id=mysql_connect($this->host, $this->user, $this->pass); } if(!$this->link_id) { return FALSE; } $db=mysql_select_db($this->db) or die ("can't select db"); return TRUE; }

    Many thanks....

    - -- Nick Wilson // www.explodingnet.com

    -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux)

    iD8DBQE81mmWHpvrrTa6L5oRAm9pAJ9aV2giDsyj4VZzK5fOWBHjfg1BpQCgn0g/ Xc8fs+7jFDMxJO3lbfoz7e4= =+xJc -----END PGP SIGNATURE-----

    attached mail follows:


    sounds like the username/password are not being accepted...

    -----Original Message----- From: Nick Wilson [mailto:nickexplodingnet.com] Sent: 06 May 2002 12:32 To: php-general Subject: [PHP] Access denied errors

    -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

    Hi everyone, not sure if this is a php or mysql problem: I seem to be able to connect in my script to mysql at the beginning but by the time I make the third or fourth call I get 'Access denied' errors?

    Here is the function I use to connect: *Any* insight would be welcome :-)

    function _db_connect() { if(!$this->link_id) { $this->link_id=mysql_connect($this->host, $this->user, $this->pass); } if(!$this->link_id) { return FALSE; } $db=mysql_select_db($this->db) or die ("can't select db"); return TRUE; }

    Many thanks....

    - -- Nick Wilson // www.explodingnet.com

    -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux)

    iD8DBQE81mmWHpvrrTa6L5oRAm9pAJ9aV2giDsyj4VZzK5fOWBHjfg1BpQCgn0g/ Xc8fs+7jFDMxJO3lbfoz7e4= =+xJc -----END PGP SIGNATURE-----

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

    attached mail follows:


    Hi all,

    I have a mySQL database running with PHP4. I have constructed a search form ($searchSite) which returns results in a results page & now I want to have the word that was entered in the search form highlight in the results page.

    eg User enters a search for products using the word " gardening"

    Results page might return:

    "this shovel is a great gardening tool" and "to be a expert in gardening, you will need"...............I want the word gardening to be bold wherever it is displayed.

    My results page has the following code to display search results: BTW it works like a dream...I just want to jazz it up a bit.

    <?

    $result = mysql_query("SELECT * FROM products WHERE Description LIKE '%$searchSite%' OR Keywords LIKE '%$searchSite%' OR CatName LIKE '%$searchSite%' ");

    blah blah blah

    while ( $row = mysql_fetch_array($result) ) { echo("<tr bgcolor='#FFFFFF'>"); echo("<td width='93'><div align='center'><font size= '2' face = 'Arial,Helvetica,Sans serif'>" . $row["Description"] . "</td>"); echo("<td width='93'><div align='center'><font size= '2' face = 'Arial,Helvetica,Sans serif'>" . $row["ProductName"] . "</td>"); echo("<td width='93'><div align='center'><font size= '2' face = 'Arial,Helvetica,Sans serif'>\$" . $row["RetailPrice"] . "</td>");

    ?>

    How do I do this to highlight my search words?

    Thanks, any ideas much appreciated by this PHP newbie.

    DC

    attached mail follows:


    If you want to highlight the EXACT search string, do a str_replace() on $row["Description"], $row["ProductName"], etc etc, replacing the search phrase with <B>$searchSite</B>. Pretty simple.

    <?

    $description = str_replace($siteSearch, "<B>$siteSearch</B>", $row["Description"]);

    $productName = str_replace($siteSearch, "<B>$siteSearch</B>", $row["ProductName"]);

    ?>

    But, I'm guessing the search word is possibly more than one word??? If that's the case, you may wish to highlight each word individually:

    If that's the case, split the words in $searchSite into an array, and loop through through the array, replacing each word with <B>word</B>.

    Something like (untested):

    <? $searchWords = explode(" ", $searchSite);

    foreach($searchWords as $key => $word) { $row["Description"] = str_replace($word, "<B>$word</B>", $row["Description"]); $row["ProductTitle"] = str_replace($word, "<B>$word</B>", $row["ProductTitle"]); } echo $row["ProductTitle"]."<BR>"; echo $row["Description"]."<BR>"; ?>

    Although this will need further tweaking, because it's case sensitive (searching for "dog" and "Dog" will produce different results, it doesn't account for dog* (doggies, dogs, etc), and is perhaps a little limited in other ways, but should get you started).

    A well constructed reg exp instead of the str_replace will cover most of this, but i'm no good at them, and str_replace is quicker, IF it's all you need.

    Justin French -------------------- Creative Director http://Indent.com.au --------------------

    on 06/05/02 9:26 PM, DC (dcurranpowerup.com.au) wrote:

    > Hi all, > > I have a mySQL database running with PHP4. I have constructed a search form > ($searchSite) which returns results in a results page & now I want to have > the word that was entered in the search form highlight in the results page. > > eg User enters a search for products using the word " gardening" > > Results page might return: > > "this shovel is a great gardening tool" and "to be a expert in gardening, > you will need"...............I want the word gardening to be bold wherever > it is displayed. > > My results page has the following code to display search results: BTW it > works like a dream...I just want to jazz it up a bit. > > <? > > $result = mysql_query("SELECT * FROM products WHERE Description LIKE > '%$searchSite%' OR Keywords LIKE '%$searchSite%' OR CatName LIKE > '%$searchSite%' "); > > blah blah blah > > while ( $row = mysql_fetch_array($result) ) { > echo("<tr bgcolor='#FFFFFF'>"); > echo("<td width='93'><div align='center'><font size= '2' face = > 'Arial,Helvetica,Sans serif'>" . $row["Description"] . "</td>"); > echo("<td width='93'><div align='center'><font size= '2' face = > 'Arial,Helvetica,Sans serif'>" . $row["ProductName"] . "</td>"); > echo("<td width='93'><div align='center'><font size= '2' face = > 'Arial,Helvetica,Sans serif'>\$" . $row["RetailPrice"] . "</td>"); > > ?> > > How do I do this to highlight my search words? > > Thanks, any ideas much appreciated by this PHP newbie. > > DC > >

    attached mail follows:


    I can't seem to figure out the following.

    I use the http upload functions a lot, works great!!.. For some months now I have been using a small PHP program which I use to upload PDF files of scanned documents and insert them into a Mysql table..

    Normally these files are small (<250 kb), but I now have a PDF of 1 MB... When uploading files I run the function: chunk_split(base64_encode($binaryfile)); to encode it, this to transform the binary file to text.. (Works great!!!)

    When the query was called to insert the data, nothing happens, also no error from mysql... Only think I can think of is that the mysql query string is to long.. ?? (The data when encoded is about 1.3 MB of text)..

    This is the source code..

    if (!($userfile_size == 0)) {$fd = fopen ($userfile, "r"); $contents = fread ($fd, filesize ($userfile)); fclose ($fd); unlink ($userfile); echo "Eerste RAW: ".strlen($contents); $encodes_data = chunk_split(base64_encode($contents)); $userfile_name = str_replace(" ", "", "$userfile_name"); echo strlen($encodes_data)." - Displays text size <BR>"; //Works right! mysql ($databasename_boekhoud, "insert mubo_boekhoud_images (data, originalname, groep, type) values '$encodes_data', '$userfile_name', '$groep', '$userfile_type')"); // mysql_error(); //No error given..? }

    Any suggestions are very much appreciated...

    With kind regards, David Bouw

    attached mail follows:


    Instead of uploading to Mysql, why don't you store the file at a directory and on Mysql only the path to it?

    Retrieving files from the hard drive is much faster than doing the same on Mysql, and also access to manipulation (insert, update, delete, etc...)

    --
    

    Julio Nobrega.

    Um dia eu chego lá: http://sourceforge.net/projects/toca

    Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884

    "David Bouw" <maillistmubo.nl> wrote in message news:63458.213.73.175.215.1020687730.squirrellogin.mubo.nl... > I can't seem to figure out the following. > > I use the http upload functions a lot, works great!!.. > For some months now I have been using a small PHP program > which I use to upload PDF files of scanned documents and > insert them into a Mysql table.. > > Normally these files are small (<250 kb), but I now have a > PDF of 1 MB... When uploading files I run the > function: chunk_split(base64_encode($binaryfile)); > to encode it, this to transform the binary file to text.. (Works great!!!) > > When the query was called to insert the data, nothing happens, > also no error from mysql... Only think I can think of is that the mysql > query string is to long.. ?? (The data when encoded is about 1.3 MB of > text).. > > This is the source code.. > > if (!($userfile_size == 0)) > {$fd = fopen ($userfile, "r"); > $contents = fread ($fd, filesize ($userfile)); > fclose ($fd); > unlink ($userfile); > echo "Eerste RAW: ".strlen($contents); > $encodes_data = chunk_split(base64_encode($contents)); > $userfile_name = str_replace(" ", "", "$userfile_name"); > echo strlen($encodes_data)." - Displays text size <BR>"; //Works right! > mysql ($databasename_boekhoud, "insert mubo_boekhoud_images (data, > originalname, groep, type) > values '$encodes_data', '$userfile_name', '$groep', '$userfile_type')"); // > mysql_error(); //No error given..? > } > > Any suggestions are very much appreciated... > > With kind regards, > David Bouw > >

    attached mail follows:


    If I use the link to the file, i.e.

    file//C:\filedir\file.pdf or .txt or whatever

    how do I insert/update/delete the file since MySQL is holding only the link?

    BTW David, what are the properties of the field you are inserting to? Could that be the problem?

    -Kirk

    "Julio Nobrega Trabalhando" <inertehotmail.com> wrote in message news:20020506134353.56093.qmailpb1.pair.com... > Instead of uploading to Mysql, why don't you store the file at a directory > and on Mysql only the path to it? > > Retrieving files from the hard drive is much faster than doing the same on > Mysql, and also access to manipulation (insert, update, delete, etc...) > > -- > > Julio Nobrega. > > Um dia eu chego lá: > http://sourceforge.net/projects/toca > > Ajudei? Salvei? Que tal um presentinho? > http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 > > > "David Bouw" <maillistmubo.nl> wrote in message > news:63458.213.73.175.215.1020687730.squirrellogin.mubo.nl... > > I can't seem to figure out the following. > > > > I use the http upload functions a lot, works great!!.. > > For some months now I have been using a small PHP program > > which I use to upload PDF files of scanned documents and > > insert them into a Mysql table.. > > > > Normally these files are small (<250 kb), but I now have a > > PDF of 1 MB... When uploading files I run the > > function: chunk_split(base64_encode($binaryfile)); > > to encode it, this to transform the binary file to text.. (Works great!!!) > > > > When the query was called to insert the data, nothing happens, > > also no error from mysql... Only think I can think of is that the mysql > > query string is to long.. ?? (The data when encoded is about 1.3 MB of > > text).. > > > > This is the source code.. > > > > if (!($userfile_size == 0)) > > {$fd = fopen ($userfile, "r"); > > $contents = fread ($fd, filesize ($userfile)); > > fclose ($fd); > > unlink ($userfile); > > echo "Eerste RAW: ".strlen($contents); > > $encodes_data = chunk_split(base64_encode($contents)); > > $userfile_name = str_replace(" ", "", "$userfile_name"); > > echo strlen($encodes_data)." - Displays text size <BR>"; //Works > right! > > mysql ($databasename_boekhoud, "insert mubo_boekhoud_images (data, > > originalname, groep, type) > > values '$encodes_data', '$userfile_name', '$groep', '$userfile_type')"); > // > > mysql_error(); //No error given..? > > } > > > > Any suggestions are very much appreciated... > > > > With kind regards, > > David Bouw > > > > > >

    attached mail follows:


    I am so far unable to use the var SID. I have determined the the script thinks it is defing but empty.

    <? session_start(); echo "'".SID."'"; echo "<br>"; echo defind("SID"); echo "<br>"; echo session_id(); ?>

    Try this script. SID is empty but defined. I can alternately call session_id but I have many sites that use SID.

    Charles Killmer Windows 2000 Server IIS 5.0 upgrading PHP 4.1.2 -> 4.2.0

    attached mail follows:


    G' morning!

    Can someone tell me where to find the various options for the Header function as it relates to M$ Excel? Last week, thanks to this list, we found a way to open a worksheet in the browser and display data retrieved from a database. The worksheet opens with no gridlines, I would like to see gridlines. Are there options that can be placed in the header function. I have looked at MSDN and did a Google search that did not reveal much of anything.

    Here is the header info being used...

    header("Content-Type: application/x-excel"); header("Content-Disposition: inline; filename=\"excel.xls\""); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

    Thanks!

    Jay Blanchard

    attached mail follows:


    Are you actually sending an excell file, or just data that you expect excell to format? If your sending a file, then you have to create the grid lines there. These are HTTP headers that you are talking about, they wouldn't have any control over excell data.

    ---John Holmes...

    ----- Original Message ----- From: "Jay Blanchard" <jay.blanchardniicommunications.com> To: <php-generallists.php.net> Sent: Monday, May 06, 2002 9:16 AM Subject: [PHP] Formatting Information in header? Gridlines in Excel

    > G' morning! > > Can someone tell me where to find the various options for the Header > function as it relates to M$ Excel? Last week, thanks to this list, we found > a way to open a worksheet in the browser and display data retrieved from a > database. The worksheet opens with no gridlines, I would like to see > gridlines. Are there options that can be placed in the header function. I > have looked at MSDN and did a Google search that did not reveal much of > anything. > > Here is the header info being used... > > header("Content-Type: application/x-excel"); > header("Content-Disposition: inline; filename=\"excel.xls\""); > header("Expires: 0"); > header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); > > Thanks! > > Jay Blanchard > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    [snip] Are you actually sending an excell file, or just data that you expect excell to format? If your sending a file, then you have to create the grid lines there. These are HTTP headers that you are talking about, they wouldn't have any control over excell data. [/snip]

    Nope, it's not an Excel file. It is a PHP file imitating an Excel file, calling data from the DB and generating the worksheet on-the-fly. I want the gridlines to display and was hoping that there was something I could put in the PHP page to make sure that this happens. I am delivering HTML table(s) to Excel for parsing, which it does just fine....uh oh...I feel an idea coming on....let me try adding a border="1" to the table tag....that works!

    Thanks for wording it differently, I saw it in a different light and the answer cam upon me like a Monday morning lightning strike.

    Jay Blanchard

    attached mail follows:


    > coming on....let me try adding a border="1" to the table tag....that works!

    Yeah, I was going to say that. How ever you format the HTML is how it's going to show up in Excel. Excel is just going to translate the HTML tables into it's own. Same goes for colors, bold, underline, center, etc.

    ---John Holmes...

    attached mail follows:


    This is intriguing me, are you opening up excel in a browser window or just printing out html tables?? I am confused.

    Thanks, Steve.

    -----Original Message----- From: Jay Blanchard [mailto:jay.blanchardniicommunications.com] Sent: Monday, May 06, 2002 9:54 AM To: php-generallists.php.net Subject: RE: [PHP] Formatting Information in header? Gridlines in Excel

    [snip] Are you actually sending an excell file, or just data that you expect excell to format? If your sending a file, then you have to create the grid lines there. These are HTTP headers that you are talking about, they wouldn't have any control over excell data. [/snip]

    Nope, it's not an Excel file. It is a PHP file imitating an Excel file, calling data from the DB and generating the worksheet on-the-fly. I want the gridlines to display and was hoping that there was something I could put in the PHP page to make sure that this happens. I am delivering HTML table(s) to Excel for parsing, which it does just fine....uh oh...I feel an idea coming on....let me try adding a border="1" to the table tag....that works!

    Thanks for wording it differently, I saw it in a different light and the answer cam upon me like a Monday morning lightning strike.

    Jay Blanchard

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

    attached mail follows:


    Both...If you send an HTML file with Excel headers, Excel will open up and "translate" the HTML tables into the grid of the Excel spreadsheet.

    ---John Holmes...

    ----- Original Message ----- From: "Steve Bradwell" <SteveBcompxnet.com> To: "'Jay Blanchard'" <jay.blanchardniicommunications.com>; <php-generallists.php.net> Sent: Monday, May 06, 2002 10:05 AM Subject: RE: [PHP] Formatting Information in header? Gridlines in Excel

    > This is intriguing me, are you opening up excel in a browser window or just > printing out html tables?? I am confused. > > Thanks, > Steve. > > -----Original Message----- > From: Jay Blanchard [mailto:jay.blanchardniicommunications.com] > Sent: Monday, May 06, 2002 9:54 AM > To: php-generallists.php.net > Subject: RE: [PHP] Formatting Information in header? Gridlines in Excel > > > [snip] > Are you actually sending an excell file, or just data that you expect excell > to format? If your sending a file, then you have to create the grid lines > there. These are HTTP headers that you are talking about, they wouldn't have > any control over excell data. > [/snip] > > Nope, it's not an Excel file. It is a PHP file imitating an Excel file, > calling data from the DB and generating the worksheet on-the-fly. I want the > gridlines to display and was hoping that there was something I could put in > the PHP page to make sure that this happens. I am delivering HTML table(s) > to Excel for parsing, which it does just fine....uh oh...I feel an idea > coming on....let me try adding a border="1" to the table tag....that works! > > Thanks for wording it differently, I saw it in a different light and the > answer cam upon me like a Monday morning lightning strike. > > Jay Blanchard > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    [snip] This is intriguing me, are you opening up excel in a browser window or just printing out html tables?? I am confused. [/snip]

    I am using PHP to query a database and create an HTML table based on the information in the database (in this case it it a large crosstab query). This is set up to open Excel in a broswer window (inline) and display the data in a worksheet. All normal Excel functions can be performed on the worksheet without changing the data in the database. These worksheets then can be saved to the user's local disk. They can always run the original query again by requesting the worksheet/page again.

    Link pointed to php page that will send to browser <a href="test.php/test.xls"> Stupid IE trick, the .xls file does not 'exist', but will fake out Excel to open the .php 'page' in a worksheet. Also, make sure to include header information listed in previous e-mail at the top of the PHP page.

    The steps are; 1. Create a PHP file with the header info 2. Do a PHP request to the database. 3. Use the results to create an HTML table within the PHP 4. Open this table in a spreadsheet

    HTH!

    Jay Blanchard

    attached mail follows:


    Wow! I am impressed, thats too cool. And man is that ever going to be helpful.

    Thanks, Steve

    -----Original Message----- From: Jay Blanchard [mailto:jay.blanchardniicommunications.com] Sent: Monday, May 06, 2002 10:25 AM To: php-generallists.php.net Subject: RE: [PHP] Formatting Information in header? Gridlines in Excel

    [snip] This is intriguing me, are you opening up excel in a browser window or just printing out html tables?? I am confused. [/snip]

    I am using PHP to query a database and create an HTML table based on the information in the database (in this case it it a large crosstab query). This is set up to open Excel in a broswer window (inline) and display the data in a worksheet. All normal Excel functions can be performed on the worksheet without changing the data in the database. These worksheets then can be saved to the user's local disk. They can always run the original query again by requesting the worksheet/page again.

    Link pointed to php page that will send to browser <a href="test.php/test.xls"> Stupid IE trick, the .xls file does not 'exist', but will fake out Excel to open the .php 'page' in a worksheet. Also, make sure to include header information listed in previous e-mail at the top of the PHP page.

    The steps are; 1. Create a PHP file with the header info 2. Do a PHP request to the database. 3. Use the results to create an HTML table within the PHP 4. Open this table in a spreadsheet

    HTH!

    Jay Blanchard

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

    attached mail follows:


    Hi,

    I have a page that contains multi If ElseIf statements. I want to redirect right after a user submits gets a message (echo "Entry Added to Database. \n"; ) would you like to add another. then prompts for an alert. Would you like another ??? and redirects to a page based on selection.

    <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Would you like to create another ??"); if (where_to== true) { window.location="body.htm"; } else { window.location="update.php"; } } //--> </SCRIPT>

    I have this jscript but not sure how to implement after the (echo entry added to database) line ?

    any suggestions. would be greately appreciated.

    Thank You

    <><><><><><><><><><><><><><><><>

    Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com

    <><><><><><><><><><><><><><><><>

    attached mail follows:


    Where exactly do you see PHP fitting into this. It looks like it's all Javascript, and that's client-side nonsense...

    ---John Holmes...

    ----- Original Message ----- From: "Daniel Negron/KBE" <danegronkbelectronics.net> To: <php-generallists.php.net> Sent: Monday, May 06, 2002 9:27 AM Subject: [PHP] Redirect after submit

    Hi,

    I have a page that contains multi If ElseIf statements. I want to redirect right after a user submits gets a message (echo "Entry Added to Database. \n"; ) would you like to add another. then prompts for an alert. Would you like another ??? and redirects to a page based on selection.

    <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Would you like to create another ??"); if (where_to== true) { window.location="body.htm"; } else { window.location="update.php"; } } //--> </SCRIPT>

    I have this jscript but not sure how to implement after the (echo entry added to database) line ?

    any suggestions. would be greately appreciated.

    Thank You

    <><><><><><><><><><><><><><><><>

    Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com

    <><><><><><><><><><><><><><><><>

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

    attached mail follows:


    www.yabbforum.com

    attached mail follows:


    Why bother posting a perl forum here !

    YaBB is a leading FREE, downloadable Perl forum that allows you to provide a real-time chat and support system for your visitors. While chat programs allow people to talk directly, you have to be on them 24/7 to please everyone. With forum software like YaBB, you can talk any time, and everyone can join or read the conversation. So get visitors coming back, for interesting discussions, fun chit chat, or needed support without having to spend thousands of dollars.

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

    attached mail follows:


    Actually... the version of YaBB at yabbforum.com is strictly a Perl based board. It doesn't use mySQL either. The PHP version of YaBB is at http://www.yabb.info but it relies on mySQL.

    There is Easy Forum http://www.hotscripts.com/Detailed/15435.html There is Eboard http://www.hotscripts.com/Detailed/14778.html

    And more, check out: http://www.hotscripts.com/PHP/Scripts_and_Programs/Discussion_Boards/

    Jeff

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

    attached mail follows:


    he MAY have been thinking of the PHP version which is at www.yabb.info and also in use over at http://www.phptalk.com

    Jeff ----- Original Message ----- From: "John Fishworld" <johnwebital.de> To: "Mizery De Aria" <mizerydeariayahoo.com>; <php-generallists.php.net> Sent: Monday, May 06, 2002 10:29 AM Subject: Re: [PHP] Re: Forum with PHP, without using mySQL..

    > Why bother posting a perl forum here ! > > YaBB is a leading FREE, downloadable Perl forum that allows you to provide a > real-time chat and support system for your visitors. While chat programs > allow people to talk directly, you have to be on them 24/7 to please > everyone. With forum software like YaBB, you can talk any time, and everyone > can join or read the conversation. So get visitors coming back, for > interesting discussions, fun chit chat, or needed support without having to > spend thousands of dollars. > > > > > www.yabbforum.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    I have stored the contents of a web page using:

    $src = implode("", file($url));

    In the source contains:

    <title>Random title here</title>

    What method can I use to store the title of the page into a variable? Keep in mind that the above string is part of an entire html document.

    attached mail follows:


    On Monday 06 May 2002 08:34, Mizery De Aria wrote: > I have stored the contents of a web page using: > > $src = implode("", file($url)); > > In the source contains: > > <title>Random title here</title> > > What method can I use to store the title of the page into a variable? > Keep in mind that the above string is part of an entire html document.

    Write a regular expression to extract it. See manual -> Regular Expression Functions (Perl-Compatible) for an example which you can use as a starting point.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* The rose of yore is but a name, mere names are left to us. */

    attached mail follows:


    I find caching to be extremely helpful. I have a complex property layer for my php based web engine/library. These properies have several levels of dependency and inheritance which can take as many as 15 queries to build. Then I cache the tree and it is reduced to a single query on subsequent page requests. Also I found a 30% load time improvement when I installed the PHPAccelerator compile cache which is excellent considering the amount of optimizations I have in my code. Thus to close I must say there are different types of caching to suit different needs and whether one or the other is suitable depends on what you want whether it makes sense to cache the data.

    Cheers, Rob.

    Manuel Lemos wrote: > > Hello, > > Sp wrote: > > Does anyone think caching should be built into php for it to edge out the competition? > > (like what smarty is doing) > > > > I mean a static page will always serve up faster then a dynamic one. Also even if you are > > getting 100 pages/sec on your database, you could cache it for 5 seconds and you save 500 > > accesses to your database. Yeah the page would be at most 5 seconds old but no one would > > know. > > I have been doing that for quite some time and I can tell that it is not > worthy to cache just database query results but rather the pages that > are generated with the data that is returned with such queries. > > For that I have developed of a robust class that caches pages in files > while it prevents that concurrent accesses update the cache files > simultaneously to prevent corrupting the cached data. > > You may want to try getting it here: > > http://www.phpclasses.org/browse.html/package/313.html > > Regards, > Manuel Lemos > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    .-----------------.
    | Robert Cummings |
    :-----------------`----------------------------.
    | Webdeployer - Chief PHP and Java Programmer  |
    :----------------------------------------------:
    | Mail  : mailto:robert.cummingswebmotion.com |
    | Phone : (613) 731-4046 x.109                 |
    :----------------------------------------------:
    | Website : http://www.webmotion.com           |
    | Fax     : (613) 260-9545                     |
    `----------------------------------------------'
    

    attached mail follows:


    (This is more info on the question I asked before)

    Here's the text file (text.txt): This is a test of the templating program. Here's hoping it's working! John Smith

    Here's one line from the CSV file (new_data.csv): John,Smith,"4770 Rosepetal Ct., Richmond, VA 22032 USA",(703) 978-4472,0/0/00,

    And here's the code I have (merge.php):

    1 <? 2 $row = 1; 3 4 $text = fopen("text.txt", "r"); 5 $merged = fopen("merged_text.html", "w"); 6 $fp = fopen("new_data.csv", "r"); 7 8 $filecontents = fread($text,filesize("text.txt")); 9 10 while ($data = fgetcsv ($fp, 1000, ",")) { 11 $num = count ($data); 12 $row++; 13 for ($c=0; $c < $num; $c++) { 14 $fullname = $data[0] . " " . $data[1]; 15 $newfullname = "<a href=".$fullname.">".$fullname."</a>"; 16 $newfilecontents = str_replace($fullname,$newfullname,$filecontents); 17 18 fwrite($merged,$newfilecontents); 19 } 20 } 21 echo nl2br($newfilecontents); 22 // fwrite($merged,$newfilecontents); 23 fclose ($fp); 24 fclose ($merged); 25 fclose ($text); 26 ?>

    Josh

    Miguel Cruz wrote:

    >On Sun, 5 May 2002, Josh & Valerie McCormack wrote: > >>I'm iterating through a CSV file pulling in rows as arrays with fgetcsv >>and I'd like to search for patterns made up of the first two array items >>of each row with a space between them in a text file, and make them into >>links. I can't figure out how to do this, could someone help? >> > >How about posting a sample row or two along with how you want the data to >appear after the transformation? > >miguel >

    attached mail follows:


    I see a PHP page that adds an entry to the database then goes to a page that says Your entry has been entered from the PHP page. what I am looking for is how to redirect after that page has been submitted and the entry is added to the database and the page tells me that I have entered the information into the database IF I would like to add another entry in to the database, again using php. I dont think I submitted this to the wrong group. I thought for a moment that I might get hammered for asking a mixed javascript, php, mysql question, but I thought that someone would actually see what I was trying to do. But just to let you know I just worked around the problem by closing out that php tags entering some jscript and and html and then re-opening the php tags. So thank you any hoo.

    Thank You

    <><><><><><><><><><><><><><><><>

    Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com

    <><><><><><><><><><><><><><><><>

    |--------+--------------------------> | | "1LT John W. | | | Holmes" | | | <holmes072000ch| | | arter.net> | | | | | | 05/06/02 10:08 | | | AM | | | Please respond | | | to "1LT John W. | | | Holmes" | | | | |--------+--------------------------> >---------------------------------------------------------------------------------------------------------------------------------------------| | | | To: <php-generallists.php.net>, "Daniel Negron/KBE" <danegronkbelectronics.net> | | cc: | | Subject: Re: [PHP] Redirect after submit | >---------------------------------------------------------------------------------------------------------------------------------------------|

    Where exactly do you see PHP fitting into this. It looks like it's all Javascript, and that's client-side nonsense...

    ---John Holmes...

    ----- Original Message ----- From: "Daniel Negron/KBE" <danegronkbelectronics.net> To: <php-generallists.php.net> Sent: Monday, May 06, 2002 9:27 AM Subject: [PHP] Redirect after submit

    Hi,

    I have a page that contains multi If ElseIf statements. I want to redirect right after a user submits gets a message (echo "Entry Added to Database. \n"; ) would you like to add another. then prompts for an alert. Would you like another ??? and redirects to a page based on selection.

    <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Would you like to create another ??"); if (where_to== true) { window.location="body.htm"; } else { window.location="update.php"; } } //--> </SCRIPT>

    I have this jscript but not sure how to implement after the (echo entry added to database) line ?

    any suggestions. would be greately appreciated.

    Thank You

    <><><><><><><><><><><><><><><><>

    Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com

    <><><><><><><><><><><><><><><><>

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

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

    attached mail follows:


    Hi All,

    I have a script that uploads files via my browser. Works fine under RedHat 7.0 but on a RH 7.2 server it crashes on files over at least 10MB. Files under 3MB work fine.

    Any suggestions? I've looked around for a php config file that might specify the max file size but so far have found nothing. Could this be an imcompatibility on RH 7.2?

    Thanks in advance, Linn

    --
    Please remove the number two from domain name for email.
    

    attached mail follows:


    I can remember there is an option on the php config file to set the max file size when uploading...

    I think you can also limit the size with a hidden input on the form... like this:

    <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="2048000"> the value corresponds to the number of bytes. so this would be for 2 MB..

    -------------------------- Francesc Leveque Lavinia TC Passatge Permanyer, 12 08009 Barcelona Tel: 93 272 34 10 flevequelavinia.tc ----- Original Message ----- From: Linn Kubler To: php-generallists.php.net Sent: Monday, May 06, 2002 5:29 PM Subject: [PHP] File upload problem

    Hi All,

    I have a script that uploads files via my browser. Works fine under RedHat 7.0 but on a RH 7.2 server it crashes on files over at least 10MB. Files under 3MB work fine.

    Any suggestions? I've looked around for a php config file that might specify the max file size but so far have found nothing. Could this be an imcompatibility on RH 7.2?

    Thanks in advance, Linn

    -- Please remove the number two from domain name for email.

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

    attached mail follows:


    D'oh! You're right, I went back and checked php.ini and found upload_max_filesize but it's already set to 200M, I'm assuming that means 200 MegaBytes. So I don't think that's the problem. I don't have the hidden tag set in the page code so that shouldn't be a factor either, right? I'm a real rooky at php programming.

    Thanks for your tip, can you think of anything else to look at? Linn

    "Francesc Leveque" <flevequelavinia.tc> wrote in message news:00dd01c1f513$e20fbaf0$3b00a8c0fleveque... I can remember there is an option on the php config file to set the max file size when uploading...

    I think you can also limit the size with a hidden input on the form... like this:

    <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="2048000"> the value corresponds to the number of bytes. so this would be for 2 MB..

    -------------------------- Francesc Leveque Lavinia TC Passatge Permanyer, 12 08009 Barcelona Tel: 93 272 34 10 flevequelavinia.tc ----- Original Message ----- From: Linn Kubler To: php-generallists.php.net Sent: Monday, May 06, 2002 5:29 PM Subject: [PHP] File upload problem

    Hi All,

    I have a script that uploads files via my browser. Works fine under RedHat 7.0 but on a RH 7.2 server it crashes on files over at least 10MB. Files under 3MB work fine.

    Any suggestions? I've looked around for a php config file that might specify the max file size but so far have found nothing. Could this be an imcompatibility on RH 7.2?

    Thanks in advance, Linn

    -- Please remove the number two from domain name for email.

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

    attached mail follows:


    I compiled php 4.2 with the following command (Linux Server)

    ./configure --with-mysql --with-apxs --enable-dbase --with-xml --enable-ftp --with-curl --enable-cli

    Where is my php.ini file? I cannot find it on my system.

    David McInnis

    attached mail follows:


    Try doing "locate php.ini". Your likely to have to copy php.ini.dist to php.ini if this is your first installation.

    Usually you'll find it in /usr/local/etc/ or /usr/local/lib/ depending on your distro.

    - Dan

    -----Original Message----- From: David McInnis [mailto:daviddataovation.com] Sent: 06 May 2002 16:28 To: php-generallists.php.net Subject: [PHP] Install Question - Missing php.ini

    I compiled php 4.2 with the following command (Linux Server)

    ./configure --with-mysql --with-apxs --enable-dbase --with-xml --enable-ftp --with-curl --enable-cli

    Where is my php.ini file? I cannot find it on my system.

    David McInnis

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

    attached mail follows:


    Good afternoon,

    We are currently taking sign-ups for our June 17th-21st 2002 week long PHP training course. If you feel you can make this course or if you would like to register for this session please register on our web site at:

    http://tapinternet.com/index.php/html/main/php-training-register.html

    The course is held in Ypsilanti, Michigan at the Eagle Crest Resort (http://www.eaglecrestresort.com). Pricing for the course is $2500 (discounts available to non-profit, government and educational institutions). Currently this is the only place we offer training but we do offer corporate on-site training for companies wishing to train more than one employee. More about our corporate training can be found here:

    http://tapinternet.com/index.php/html/main/php-training-corporate.html

    Thank you and I look forward to hearing from you if you can attend this session or require further information.

    ------ Michael Kimsal Tap Internet, Inc. (734) 482-1371 Toll Free 1-866-745-3660 http://www.logicreate.com/

    attached mail follows:


    Free web hoting for PHP developers

    MySQL database (more if you need more) Subdomain, or I can host your domain Apache /w all the bits and pieces Slackware Linux OS 512/512 Cable connection in Brisbane, Australia

    Only catch is, I've got a 3 GIG monthly transfer limit, so no big uploads/downloads please (such as MP3s)

    Email me if you're interested.

    ----- Original Message ----- From: "The_RadiX" <the_radixhotkey.net.au> To: <php-generallists.php.net>; "Justin French" <justinindent.com.au> Sent: Monday, May 06, 2002 5:31 PM Subject: [PHP] Who's having a good hosting experience these days?

    Um Justin..

    Hi..

    or should I say.. Hi fellow Aussie mate .. :)

    Yeah I am in oz too and asked some hosting questions a while back..

    Your host has only 2GB downloads on the UNIX plan and also that's at US$15 p/m.. isnt that a tad pricey?

    I was looking into powweb.com or aletia.com at much cheaper pricing and larger services (200mb storage, 10/12Gb p/m,etc)

    What do you think of these..

    Thanks... ::::::::::::::::::::::::::::::::::::::::::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : the_radixhotkey.net.au : ABN: 64 235 749 494 : QUT Student #: 04475739 ::::::::::::::::::::::::::::::::::::::::::: ----- Original Message ----- From: "Justin French" <justinindent.com.au> To: <php-generallists.php.net> Sent: Monday, May 06, 2002 10:22 AM Subject: Re: [PHP] Who's having a good hosting experience these days?

    > Cheap? > I've been with experthost.com for around 8 months, with very little to > complain about... I've got a reseller account with about 12 domains, so i'm > paying around US$6each, and I think the standard is US$15each for one, $10ea > for two, and then a sliding scale up to 25 domains $5ea or something. > > It *shouldn't* be about the money, but I'm currently making a healthy profit > out of hosting some client domains under my account. > > > Reliable? > They have intelligent support staff on 24/7, and they've had one service > fallout in this time. It was a biggie, and I had to reload some data from > my local copy, but I'd like to believe this was a one-off. > > > Fast? > The service seems fast (although I'm in Australia, so pings times are > affected by sheer distance). > > > Feature Rich? > 50meg, 20POPs, redirects, groups, auto-responders, 2GB bandwidth, MySQL, > webmail, recent versions of Apache/MySQL/PHP, intelligent support staff, etc > etc. > > > I'm pretty happy. Better still, they offer a free 1 month test account, so > you can try them for yourself. > > > Justin French > -------------------- > Creative Director > http://Indent.com.au > -------------------- > > > > > > on 06/05/02 9:19 AM, David Freeman (dfreemanoutbackqld.net.au) wrote: > > > > >> My hosting service which WAS cool about 2 years ago has > >> grown into a bloated mess of zero logic. > > > > Fast, Reliable, Cheap, Feature-Rich > > > > Now pick any three. > > > > In the end I guess you get what you pay for. If you can only afford a > > lower price host then you only get lower value. > > > > CYA, Dave > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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

    attached mail follows:


    Can you practice function over-loading in php? Kris

    attached mail follows:


    Can you practice function over-loading in php? Kris

    attached mail follows:


    We did actually hear you the first time, but I'll just assume your not all that bright.

    As far as Im aware you cannot over load functions in php - although there may be some new functions available ... I suggest you check the manual.

    -----Original Message----- From: Kris Vose [mailto:KVosealidaconnection.com] Sent: 06 May 2002 19:10 To: php-generallists.php.net Subject: [PHP] function over loading?

    Can you practice function over-loading in php? Kris

    attached mail follows:


    Is it possible to pass variables from a php page to a page using javascript, and vice versa, I've the variable - an array passed in the url of the page.

    -Pushkar S. Pradhan

    attached mail follows:


    Pushkar Pradhan wrote: > Is it possible to pass variables from a php page to a page using > javascript, and vice versa, > I've the variable - an array passed in the url of the page. > > -Pushkar S. Pradhan >

    Yes and no. You can pass variables to a php script with the normal HTTP POST ang GET methods, however it's done with javascript.

    attached mail follows:


    > Is it possible to pass variables from a php page to a page using > javascript, and vice versa, > I've the variable - an array passed in the url of the page.

    You can use PHP to write HTML or Javascript. You can submit data to PHP through GET, POST, COOKIE, values. Those are your options.

    So, if you have a PHP variable, that you want to pass to Javascript, then you do this.

    <? $my_php_var = "foo"; ?> <script language='javascript'> my_js_var = '<?=$my_php_var?>'; </script>

    Now, to get your JS variable back to PHP, you have to include it in a form, or tack it on to a URL. You can put it in a form as a hidden element.

    Hope that helps,

    ---John Holmes...

    attached mail follows:


    Unless you're doing HTML as a halfway between Javascript and PHP, you cannot do a POST method (obviously). But you can always pass values in the URL string.

    Access the URL string in Javascript with "document.location.search". Access the URL string in PHP with "$HTTP_GET_VARS" or "$_GET". You can generate a URL with variables then do a Header redirect to automate the switch. Use "document.location.href" in Javascript and "header('Location:') in PHP".

    Read up on these methods and you should be all set.

    -Kevin

    ----- Original Message ----- From: "Pushkar Pradhan" <pushkarERC.MsState.Edu> To: <php-generallists.php.net> Sent: Monday, May 06, 2002 11:01 AM Subject: [PHP] pass. vars. betn. javascript and php

    > Is it possible to pass variables from a php page to a page using > javascript, and vice versa, > I've the variable - an array passed in the url of the page. > > -Pushkar S. Pradhan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    I am using the mysql sum() function to return the "sum" of a bunch of dolor amounts stored "float" values. But what I get back it something like this "98.199998855591" it is to precise. All I want is the dolor amounts added up and rounded up to the closest penny. Is there a better value type to use or a function that will return the information properly formatted. Mike Fifield Charles Schwab & Co, Inc. WARNING: All e-mail sent to or from this address will be received by the Charles Schwab corporate e-mail system and is subject to archival and review by someone other than the recipient.

    attached mail follows:


    On Mon, May 06, 2002 at 10:01:00AM -0700, Fifield, Mike wrote: > amounts stored "float" values. But what I get back it something like this > "98.199998855591" it is to precise. All I want is the dolor amounts added up > and rounded up to the closest penny. Is there a better value type to use or

    http://www.mysql.com/doc/M/a/Mathematical_functions.html or http://www.php.net/manual/en/function.round.php

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Mike Fifield wrote: > I am using the mysql sum() function to return the "sum" of a bunch of dolor > amounts stored "float" values. But what I get back it something like this > "98.199998855591" it is to precise. All I want is the dolor amounts added up > and rounded up to the closest penny. Is there a better value type to use or > a function that will return the information properly formatted. > > Mike Fifield > Charles Schwab & Co, Inc. > WARNING: All e-mail sent to or from this address will be received by the > Charles Schwab corporate e-mail system and is subject to archival and review > by someone other than the recipient. > >

    MySQL has a decimal column type which allows you to specify to how many decimal points the number is stored. http://www.mysql.com/doc/C/o/Column_types.html

    If you want to do it via PHP, you can format the number via number_format() and that will give you the 2 decimal points as well as the commas where needed.

    Also, both PHP and MySLQ have round() functions to format the numbers.

    attached mail follows:


    I would like to be able to make a client side HTTPS request from one of my pages. From searching around, I see that I can do everything I want using the CURL library. But the ISP I am using does not have the CURL library installed.

    I'll ask them if they'll install this library. But, assuming they don't, do I have any other options for doing what I want?

    --
    JR
    

    attached mail follows:


    Jonathan Rosenberg wrote: > I would like to be able to make a client side HTTPS request from > one of my pages. From searching around, I see that I can do > everything I want using the CURL library. But the ISP I am using > does not have the CURL library installed. > > I'll ask them if they'll install this library. But, assuming > they don't, do I have any other options for doing what I want? > > -- > JR >

    Even if they don't have it compiled into PHP, they might have curl installed and available from the comman