|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Thu Jul 11 2002 - 01:12:56 CDT
php-general Digest 11 Jul 2002 06:12:56 -0000 Issue 1457
Topics (messages 106906 through 107029):
Re: Question about PHP
106906 by: Lazor, Ed
Re: Development Tools
106907 by: Lazor, Ed
106909 by: Martin Clifford
106916 by: Nick Oostveen
106918 by: Peter J. Schoenster
106921 by: Rasmus Lerdorf
106935 by: jsegovia.mindspring.com
106938 by: Martin Clifford
106939 by: Matthew K. Gold
106944 by: Mark McCulligh
106946 by: Kevin Stone
106948 by: Mark McCulligh
106955 by: Lazor, Ed
106956 by: Lazor, Ed
106962 by: Chris Kay
106971 by: Bret L Conard
106975 by: Nick Oostveen
107012 by: Chris Earle
Re: reports and reporting options?
106908 by: Mark McCulligh
106986 by: Anas Mughal
Forms not passing variables
106910 by: Hopp3r
106914 by: Derick Rethans
106920 by: Martin Clifford
106924 by: Hopp3r
106925 by: Hopp3r
106927 by: Derick Rethans
106929 by: jepadilla.bh-corp.com
106931 by: Hopp3r
Re: SQL field problem
106911 by: Rick Emery
106923 by: Alberto Serra
106933 by: Chris Hewitt
Re: Cannot Insert into Paradox Tables...
106912 by: Kondwani Spike Mkandawire
getdate
106913 by: Brian V Bonini
106967 by: Brian V Bonini
106968 by: Rasmus Lerdorf
106970 by: Brian V Bonini
Re: if syntax
106915 by: Derick Rethans
Page not found problem
106917 by: Chen
106941 by: Chris Hewitt
106949 by: Chen
106958 by: Lazor, Ed
Can't get the example to work
106919 by: Eugene.McQuade
106922 by: Jay Blanchard
106928 by: Eugene.McQuade
106932 by: Jay Blanchard
106945 by: Eugene.McQuade
Re: How do I import tables into MySQL from web page ...
106926 by: Fargo Lee
106930 by: Fargo Lee
106976 by: Analysis & Solutions
106977 by: Analysis & Solutions
106989 by: Fargo Lee
106991 by: Fargo Lee
106993 by: Peter
107004 by: Analysis & Solutions
107006 by: Fargo Lee
Crash Course on PHP WORKS :: Registering Globals
106934 by: vins
106936 by: Derick Rethans
106950 by: Philip Olson
Re: sort problem
106937 by: Chris Hewitt
107018 by: Analysis & Solutions
Dumb session / cookie / password questions
106940 by: Chad Day
106942 by: Richard Baskett
106943 by: Martin Clifford
106966 by: Alberto Serra
HTTP authentication
106947 by: Varsha Agarwal
106951 by: Matt Schroebel
106952 by: Varsha Agarwal
question varibles and url
106953 by: .cid
106954 by: Richard Baskett
106973 by: Danny Shepherd
varible in url question
106957 by: .cid
106959 by: Richard Baskett
106960 by: Chris Kay
106974 by: Philip Olson
PHP & gd-2.0
106961 by: Mike
106972 by: Derick Rethans
106990 by: Ricky Dhatt
another splice?
106963 by: David Duong
Discard the previous message.
106964 by: David Duong
excel COM code example won't work....
106965 by: Jeff D. Hamann
Re: newbie regex question..
106969 by: David Duong
setcookie then redirect
106978 by: David Busby
106988 by: Chris Shiflett
Re: (OT) Erik Hegreberg - need headers for abuse
online.no
106979 by: Justin French
106981 by: Nookie
Re: setcookie then redirect + Answer
106980 by: David Busby
File Uploading Question
106982 by: Nick Oostveen
106984 by: David Duong
106987 by: Justin French
Re: strange stuff in a class
106983 by: Analysis & Solutions
caching dynamic thumbnail
106985 by: Roger Thomas
HTTP_USER_AGENT?
106992 by: George Hester
106994 by: Andrew Brampton
106995 by: Balaji Ankem
106996 by: Justin French
106999 by: George Hester
107001 by: Chris Kay
107002 by: Tyler Longren
107003 by: Balaji Ankem
107005 by: George Hester
107007 by: Martin Towell
107023 by: Philip Olson
Re: Script File Permissions
106997 by: Chris Earle
Re: sigh... forms
106998 by: Chris Earle
sendmail_path help
107000 by: Ricky Dhatt
107020 by: Chris Earle
Editing files by line
107008 by: Chris Earle
107010 by: Martin Towell
107014 by: Chris Earle
107026 by: Analysis & Solutions
Re: Appending to a file
107009 by: Analysis & Solutions
107011 by: Martin Towell
107015 by: Chris Earle
Re: Automatic Form creation
107013 by: Analysis & Solutions
Re: Date formatting
107016 by: Analysis & Solutions
need help about this
107017 by: aromania.aromania.com
107019 by: Peter
107021 by: Tyler Longren
107024 by: Sachin Keshavan
107025 by: Anas Mughal
Breaking Dynamic Content into Pages...
107022 by: Monty
Re: rh 7.3
107027 by: Yamin Prabudy
Table Making
107028 by: Jason Soza
107029 by: Analysis & Solutions
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
It's the first option in the installation instructions. Follow the part
about installing PHP as an Apache module and you'll be set.
-----Original Message-----
I am reading a book about php, in its security section, it says " it is more
secure, as well as more efficient when installing PHP, to install PHP as a
SAPI module for your Web server that to run it via the CGI interface"
do you know how can I do that? what is SAPI?
****************************************************************************
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message. Thank you very
much.
attached mail follows:
I like WYSIWYG integration. It allows me to code the page and then focus
separately on web page content. That debugger in PHPEd looks pretty cool...
too bad they don't have WYSIWYG.
-----Original Message-----
I agree about WYSIWYG. I use UltraDev a lot, but don't use the WYSIWYG very
much again more. UltraDev is great at managing your site and syntax
highlighting. I love the update feature (change a file/image name and it
updates all pages that use them to the new name)
Also about plain programming editors, I like PFE too. Didn't know it was
unsupported now(see Jay Blanchard comment above)
****************************************************************************
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message. Thank you very
much.
attached mail follows:
WYSIWYG does nothing more for me than screw up my code. I'm very anal about how my code looks, firstly. Secondly, most WYSIWYG editors add superfluous markup into code which not only inflates the file size of your documents, but also slows down processing of them.
I'm not saying that WYSIWYG isn't right for you, because obviously it is. I'm just saying that, to me, it might as well be fingernails running down a chalkboard for all the good it *doesn't* do me, personally.
Martin
>>> "Lazor, Ed" <ELazor
providence.org> 07/10/02 02:10PM >>>
I like WYSIWYG integration. It allows me to code the page and then focus
separately on web page content. That debugger in PHPEd looks pretty cool...
too bad they don't have WYSIWYG.
attached mail follows:
A good, well designed, development tool can provide a huge productivity
boost over an editor if it's used properly. And I don't mean
auto-generated code by this either.
Right off the bat, any good development tool will have code completion
abilities, which are basically the programmers version of nix consoles tab
completion. This little feature alone helps save time by reducing the
amount of typing required, not to mention can virtually eliminate type-o's
in function or variable names.
Another basic feature any good IDE will have is a built in library of all
php functions so that you can view the function along with all its
arguments while your typing. Need to use a rare function and can't
remember the order of the arguments it requires? Having this feature
eliminates the need for you to go look up the function to check this
trivial item. Additionally a good IDE will automatically read in the
definitions for functions and classes you have defined in the current
project and automatically add them to the above mentioned items.
These first two things are immediately obvious to even first time users and
will speed things up, but the real benefits come from other items such as a
integrated debugging tools, performance analyzers, a good class browser,
and built in database connectivity. If you're working in a team
environment having an IDE which has built-in support for a content
verification system can also be a huge advantage. Again, these features
will only benefit someone who knows how to use them.
Unfortunately I have yet to find a truly good PHP IDE. The two best I've
found to date are NuSphere's PHPEd 3.0.0 (which unfortunately has dozens of
minor, but annoying bugs) and the Zend IDE (which is very nice, but it
crawls on anything but the fastest systems). If either of these fix the
for-mentioned issues I'd be the first in line to purchase them.
At 06:07 PM 7/10/2002 +0200, Uwe Birkenhain wrote:
>I think that - on windows - nothing is better than textpad
>(www.textpad.com).
>Simply the best editor the world has seen so far!
>
>What makes development tools better than a good editor? (serious question)
>
>Uwe
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On 10 Jul 2002 at 18:07, Uwe Birkenhain wrote:
> I think that - on windows - nothing is better than textpad
> (www.textpad.com).
> Simply the best editor the world has seen so far!
>
> What makes development tools better than a good editor? (serious
> question)
Well let me get my 2 cents in. It's a religious question. But oh
well. I recently had a lot of trouble with someone at work about
this, so I'm gonna rant.
I too use TextPad and have been since I'm too lazy to get really good
at vi or emacs. I also know and use Perl extensively as a code
generator. Someone talked about the work in creating a form, just
give me the keys and boom form is done and read to be handed to the
designers to ruin in their special way. You could use Ruby or Rebol
or even Python I guess or PHP on the command line but I can't imagine
anyting being faster than a Perl script (to write).
I keep trying these IDE tools. I type about 70+ wpm, so you can
imagine I'm not a fan of my hand speding half it's time in the air
between keyboard and mouse. I also try never to repeat the same code
twice so I don't cut and paste ... I put common functions in modules
and use them but few IDEs that I've used easily allow me to use those
or I haven't seen how. If anyone wants to create a great IDE for Perl
I'd love to help. It should work for PHP as well.
I also separate my programming from my view and since I'm a
programmer and not a designer the visual view is not paramount to me
and can always be done later or at the same time by me or someone
else. I have a feeling that most PHP programmers also do their own
design and that's a reason for so much PHP stuff to have html strewn
all over the place. In any case I always think in terms of a theme
and since I've got most of my html code abstracted into "boxes" it's
just a question of my program to manipulate and supply the proper
data to the template.
So for me, the best development tools are:
1. Imagination
2. Knowledge of your tools (language, PHP, HTML, CSS, etc. in this
case)
3. Knowledge of the computer and it's potential (I use NT as desktop
but have cygwin and use unix command tools and lots and lots of perl
scripts to aid
in development)
4. A good text editor (there are lots, they all have macros, revision
control, keyboard commands for as much as possible).
Personally, I've never worked with a programmer who taught me
anything who used Dreamweaver or FrontPage etc ... all the good ones
I know use vi, emacs, textpad, etc. I'd suggest using a text editor
and then moving to an IDE or more advanced GUI and knowing that it is
faster for you as opposed to starting with an IDE or GUI because
you'll probably end up like most people and begin to think
possiblities are what your tool allows you.
Peter
-- http://www.readbrazil.com/
Answering Your Questions About Brazil
attached mail follows:
> Right off the bat, any good development tool will have code completion
> abilities, which are basically the programmers version of nix consoles tab
> completion. This little feature alone helps save time by reducing the
> amount of typing required, not to mention can virtually eliminate type-o's
> in function or variable names.
^n in vim completes function names, variable names, via dictionary
completion (trivial configuration required)
-Rasmus
attached mail follows:
For those of you using HomeSite, is it worthwhile for me to install it if I
already have DreamWeaver 4 on my PC? Someone said HomeSite is basically
DreamWeaver without the UI interface so I'm wondering if it's possible to use
DreamWeaver the same way I would Homesite.
Jesse
attached mail follows:
Homesite (at least version 5.0) has support for more languages than DW4. Though I believe in DW4 you can customize the syntax highlighting to match any languages that *aren't* supported. I love Homesite 5. Not to mention that it runs a lot faster than DW because it doesn't have to load as many libraries.
Martin
>>> <jsegovia
mindspring.com> 07/10/02 03:39PM >>>
For those of you using HomeSite, is it worthwhile for me to install it if I
already have DreamWeaver 4 on my PC? Someone said HomeSite is basically
DreamWeaver without the UI interface so I'm wondering if it's possible to use
DreamWeaver the same way I would Homesite.
Jesse
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
The difference between Dreamweaver and Homesite is that Homesite is easier to customize, and it doesn't mess with your code the way that Dreamweaver does. If you're happy with Dreamweaver, you should stick with it. But if you want more control over your code, you should consider switching.
Of course, Macromedia recently bought Allaire, so who knows what the next version of Homesite will look like...
Matt
----- Original Message -----
From: <jsegovia
mindspring.com>
To: <php-general
lists.php.net>
Sent: Wednesday, July 10, 2002 3:39 PM
Subject: [PHP] Re: Development Tools
> For those of you using HomeSite, is it worthwhile for me to install it if I > already have DreamWeaver 4 on my PC? Someone said HomeSite is basically > DreamWeaver without the UI interface so I'm wondering if it's possible to use > DreamWeaver the same way I would Homesite. > > Jesse > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
From my understanding the new Dreamweaver MX has Homesite in it. Dreamweaver, UltraDev and Homesite are one. I know in the install program you can pick your interface to look like Dreamweaver, Homesite or go with the NEW MX look. Not sure if this means you can jump back and forth between HomeSite and Dreamweaver or not. They might have taken the best from both and made one, Don't Know?
-- _________________________________________ Mark McCulligh, Application Developer / Analyst Sykes Canada Corporation www.SykesCanada.com (888)225-6824 ex. 3262 mmcculliSykesCanada.com "Matthew K. Gold" <mgold1
gc.cuny.edu> wrote in message news:006d01c2284b$33327c00$7b423b41
oemcomputer... > The difference between Dreamweaver and Homesite is that Homesite is easier > to > customize, and it doesn't mess with your code the way that Dreamweaver does. > If you're happy with Dreamweaver, you should stick with it. But if you want > more control over your code, you > should consider switching. > > Of course, Macromedia recently bought Allaire, so who knows what the next > version of Homesite will look like... > > Matt > > > ----- Original Message ----- > From: <jsegovia
mindspring.com> > To: <php-general
lists.php.net> > Sent: Wednesday, July 10, 2002 3:39 PM > Subject: [PHP] Re: Development Tools > > > > For those of you using HomeSite, is it worthwhile for me to install it if > I > > already have DreamWeaver 4 on my PC? Someone said HomeSite is basically > > DreamWeaver without the UI interface so I'm wondering if it's possible to > use > > DreamWeaver the same way I would Homesite. > > > > Jesse > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > >
attached mail follows:
Matt, you're little behind on the times. Most of the Homesite 5.0 editor has already been integrated into DreamweaverMX. They even have a Homesite "mode" which is what I use. :)
There are many benefits to DreamweaverMX. The FTP functionality in is completely seamless and works very well. DWMX's "site" feature is similar to Homesite "projects" feature except that it actually works right. The coolest feature of DWMX is it's properties bar which makes updating HTML tags a breeze.
That being said DWMX is not without problems. It's slower than Homesite5.. which its self was a dog. The code coloring doesn't work as well as in Homesite. There is no instant way to browse an HTML file. There seems to be a bug in the Find/Replace. Then there are little user interface issues uch as TAB which doesn't work intuitively (tab a selected line and you expect to replace the line with a tab but no it tabs the line to the right.. it doesn't make sense). You can't triple click a line to select it. Line indentation is a three key shortcut.. hardly a short cut. Little things like that.
Anyway there are more things I like about DWMX than dislike. I suggest you d'l the 30 day demo and check it out. http://www.macromedia.com
-Kevin
----- Original Message -----
From: "Matthew K. Gold" <mgold1
gc.cuny.edu>
To: <jsegovia
mindspring.com>
Cc: <php-general
lists.php.net>
Sent: Wednesday, July 10, 2002 1:51 PM
Subject: Re: [PHP] Re: Development Tools
> The difference between Dreamweaver and Homesite is that Homesite is easier
> to
> customize, and it doesn't mess with your code the way that Dreamweaver
does.
> If you're happy with Dreamweaver, you should stick with it. But if you
want
> more control over your code, you
> should consider switching.
>
> Of course, Macromedia recently bought Allaire, so who knows what the next
> version of Homesite will look like...
>
> Matt
>
>
> ----- Original Message -----
> From: <jsegovia
mindspring.com>
> To: <php-general
lists.php.net>
> Sent: Wednesday, July 10, 2002 3:39 PM
> Subject: [PHP] Re: Development Tools
>
>
> > For those of you using HomeSite, is it worthwhile for me to install it
if
> I
> > already have DreamWeaver 4 on my PC? Someone said HomeSite is basically
> > DreamWeaver without the UI interface so I'm wondering if it's possible
to
> use
> > DreamWeaver the same way I would Homesite.
> >
> > Jesse
> >
> > --
> > 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:
Just wanted to let you know the tab things is for indenting your code. You can highlight a couple rows hit tab to indent them together. Cool feature for moving blocks of code around and making the code look nice. Bad feature if you wanted the normal tab function.
Mark.
_________________________________________
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
mmcculli
SykesCanada.com
----- Original Message -----
From: "Kevin Stone" <kevin
helpelf.com>
Newsgroups: php.general
To: "PHP-general" <php-general
lists.php.net>
Sent: Wednesday, July 10, 2002 4:30 PM
Subject: Re: [PHP] Re: Development Tools
> Matt, you're little behind on the times. Most of the Homesite 5.0 editor
> has already been integrated into DreamweaverMX. They even have a Homesite
> "mode" which is what I use. :)
>
> There are many benefits to DreamweaverMX. The FTP functionality in is
> completely seamless and works very well. DWMX's "site" feature is similar
> to Homesite "projects" feature except that it actually works right. The
> coolest feature of DWMX is it's properties bar which makes updating HTML
> tags a breeze.
>
> That being said DWMX is not without problems. It's slower than
Homesite5..
> which its self was a dog. The code coloring doesn't work as well as in
> Homesite. There is no instant way to browse an HTML file. There seems to
> be a bug in the Find/Replace. Then there are little user interface issues
> uch as TAB which doesn't work intuitively (tab a selected line and you
> expect to replace the line with a tab but no it tabs the line to the
right..
> it doesn't make sense). You can't triple click a line to select it. Line
> indentation is a three key shortcut.. hardly a short cut. Little things
> like that.
>
> Anyway there are more things I like about DWMX than dislike. I suggest
you
> d'l the 30 day demo and check it out. http://www.macromedia.com
>
> -Kevin
>
>
> ----- Original Message -----
> From: "Matthew K. Gold" <mgold1
gc.cuny.edu>
> To: <jsegovia
mindspring.com>
> Cc: <php-general
lists.php.net>
> Sent: Wednesday, July 10, 2002 1:51 PM
> Subject: Re: [PHP] Re: Development Tools
>
>
> > The difference between Dreamweaver and Homesite is that Homesite is
easier
> > to
> > customize, and it doesn't mess with your code the way that Dreamweaver
> does.
> > If you're happy with Dreamweaver, you should stick with it. But if you
> want
> > more control over your code, you
> > should consider switching.
> >
> > Of course, Macromedia recently bought Allaire, so who knows what the
next
> > version of Homesite will look like...
> >
> > Matt
> >
> >
> > ----- Original Message -----
> > From: <jsegovia
mindspring.com>
> > To: <php-general
lists.php.net>
> > Sent: Wednesday, July 10, 2002 3:39 PM
> > Subject: [PHP] Re: Development Tools
> >
> >
> > > For those of you using HomeSite, is it worthwhile for me to install it
> if
> > I
> > > already have DreamWeaver 4 on my PC? Someone said HomeSite is
basically
> > > DreamWeaver without the UI interface so I'm wondering if it's possible
> to
> > use
> > > DreamWeaver the same way I would Homesite.
> > >
> > > Jesse
> > >
> > > --
> > > 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 too. I've developed an approach to coding with Dreamweaver that allows me to take advantage of WYSIWYG and my own style of coding at the same time. The MX version of Dreamweaver is supposed to add support for code snipets, and a few other things. I'm looking forward to checking them out.
Oh, and Dreamweaver has provided the most efficient WYSIWYG created code that I've seen so far.
So... what do you do when it comes to creating actual content that's separate from the coding?
My personal approach has been doing the coding necessary to create templates and then opening templates in Dreamweaver and filling in the blanks.
-Ed
-----Original Message----- WYSIWYG does nothing more for me than screw up my code. I'm very anal about how my code looks, firstly. Secondly, most WYSIWYG editors add superfluous markup into code which not only inflates the file size of your documents, but also slows down processing of them.
I'm not saying that WYSIWYG isn't right for you, because obviously it is. I'm just saying that, to me, it might as well be fingernails running down a chalkboard for all the good it *doesn't* do me, personally. **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.
attached mail follows:
I'm definitely curious and want to check out the debugging tools, performance analyzer, and database connectivity tools provided by PHPEd.
I get the impression most developers do not integrate coding and content. Is this correct?
-Ed
-----Original Message----- These first two things are immediately obvious to even first time users and will speed things up, but the real benefits come from other items such as a integrated debugging tools, performance analyzers, a good class browser, and built in database connectivity. If you're working in a team environment having an IDE which has built-in support for a content verification system can also be a huge advantage. Again, these features will only benefit someone who knows how to use them.
Unfortunately I have yet to find a truly good PHP IDE. The two best I've found to date are NuSphere's PHPEd 3.0.0 (which unfortunately has dozens of minor, but annoying bugs) and the Zend IDE (which is very nice, but it crawls on anything but the fastest systems). If either of these fix the for-mentioned issues I'd be the first in line to purchase them. **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.
attached mail follows:
I don't know about anyone else, But in linux I use vi and as of yesterday I downloaded Vi for windows, it has great colours for coding...
---------------------------------------------------------------------------
Chris Kay
Technical Support - Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102
Platinum Channel Partner of the Year - Request DSL - Broadband for Business
---------------------------------------------------------------------------
> -----Original Message-----
> From: Peter J. Schoenster [mailto:peter
schoenster.com]
> Sent: Thursday, 11 July 2002 5:13 AM
> To: php-general
lists.php.net
> Subject: Re: [PHP] Development Tools
>
>
> On 10 Jul 2002 at 18:07, Uwe Birkenhain wrote:
>
> > I think that - on windows - nothing is better than textpad
> > (www.textpad.com). Simply the best editor the world has seen so far!
> >
> > What makes development tools better than a good editor? (serious
> > question)
>
> Well let me get my 2 cents in. It's a religious question. But oh
> well. I recently had a lot of trouble with someone at work about
> this, so I'm gonna rant.
>
> I too use TextPad and have been since I'm too lazy to get really good
> at vi or emacs. I also know and use Perl extensively as a code
> generator. Someone talked about the work in creating a form, just
> give me the keys and boom form is done and read to be handed to the
> designers to ruin in their special way. You could use Ruby or Rebol
> or even Python I guess or PHP on the command line but I can't imagine
> anyting being faster than a Perl script (to write).
>
> I keep trying these IDE tools. I type about 70+ wpm, so you can
> imagine I'm not a fan of my hand speding half it's time in the air
> between keyboard and mouse. I also try never to repeat the same code
> twice so I don't cut and paste ... I put common functions in modules
> and use them but few IDEs that I've used easily allow me to use those
> or I haven't seen how. If anyone wants to create a great IDE for Perl
> I'd love to help. It should work for PHP as well.
>
> I also separate my programming from my view and since I'm a
> programmer and not a designer the visual view is not paramount to me
> and can always be done later or at the same time by me or someone
> else. I have a feeling that most PHP programmers also do their own
> design and that's a reason for so much PHP stuff to have html strewn
> all over the place. In any case I always think in terms of a theme
> and since I've got most of my html code abstracted into "boxes" it's
> just a question of my program to manipulate and supply the proper
> data to the template.
>
> So for me, the best development tools are:
>
> 1. Imagination
> 2. Knowledge of your tools (language, PHP, HTML, CSS, etc. in this
> case)
> 3. Knowledge of the computer and it's potential (I use NT as desktop
> but have cygwin and use unix command tools and lots and lots of perl
> scripts to aid
> in development)
>
> 4. A good text editor (there are lots, they all have macros, revision
> control, keyboard commands for as much as possible).
>
> Personally, I've never worked with a programmer who taught me
> anything who used Dreamweaver or FrontPage etc ... all the good ones
> I know use vi, emacs, textpad, etc. I'd suggest using a text editor
> and then moving to an IDE or more advanced GUI and knowing that it is
> faster for you as opposed to starting with an IDE or GUI because
> you'll probably end up like most people and begin to think
> possiblities are what your tool allows you.
>
> Peter
> -- http://www.readbrazil.com/
> Answering Your Questions About Brazil
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I have found dreamweaver intolerable due to it's writing the code. I usually write 8 lines to do something that DW takes 24 to do. (I'm all about slim code:) ). Also, the naming conventions that DW uses for functions and variables is too long and for me makes no sense. (Always <MM_*********> with no rhyme or reason.) I like variable and function names that are short and refer to what they do/represent for readability.
I have also spent a great deal of time 'fixing' DW JavaScript that does not work. Not a confidence builder......
Bret
----- Original Message -----
From: <jsegovia
mindspring.com>
To: <php-general
lists.php.net>
Sent: Wednesday, July 10, 2002 3:39 PM
Subject: [PHP] Re: Development Tools
> For those of you using HomeSite, is it worthwhile for me to install it if I > already have DreamWeaver 4 on my PC? Someone said HomeSite is basically > DreamWeaver without the UI interface so I'm wondering if it's possible to use > DreamWeaver the same way I would Homesite. > > Jesse > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
While I can't speak for others, in our office we use template files which contain all HTML and then parse content generated from php scripts into them about 90% of the time. Not only does separating your code from your HTML make it easier to change the look of a site, but it also makes the code much easier to maintain. If you're interested I would recommend checking out the FastTemplate class for an example of how this works.
At 02:42 PM 7/10/2002 -0700, you wrote: >I'm definitely curious and want to check out the debugging tools, >performance analyzer, and database connectivity tools provided by PHPEd. > >I get the impression most developers do not integrate coding and content. >Is this correct? > >-Ed > > >-----Original Message----- >These first two things are immediately obvious to even first time users and >will speed things up, but the real benefits come from other items such as a >integrated debugging tools, performance analyzers, a good class browser, >and built in database connectivity. If you're working in a team >environment having an IDE which has built-in support for a content >verification system can also be a huge advantage. Again, these features >will only benefit someone who knows how to use them. > >Unfortunately I have yet to find a truly good PHP IDE. The two best I've >found to date are NuSphere's PHPEd 3.0.0 (which unfortunately has dozens of >minor, but annoying bugs) and the Zend IDE (which is very nice, but it >crawls on anything but the fastest systems). If either of these fix the >for-mentioned issues I'd be the first in line to purchase them. > >**************************************************************************** >This message is intended for the sole use of the individual and entity to >whom it is addressed, and may contain information that is privileged, >confidential and exempt from disclosure under applicable law. If you are >not the intended addressee, nor authorized to receive for the intended >addressee, you are hereby notified that you may not use, copy, disclose or >distribute to anyone the message or any information contained in the >message. If you have received this message in error, please immediately >advise the sender by reply email and delete the message. Thank you very >much. > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I too am using a plain old text editor for PHP (Notepad), but I did enjoy the environment of Interdev for ASP...
I think by far the best feature most development tools have to offer is the syntax highlighting, I like seeing comments in green/grey, with the plain text and vars in black, and a lot of the other syntax in red (with other colors for some things obviously). All in all, it's just the way it makes my code look that makes me like them a little bit more than normal text editors. I don't use the tools in any of those to create my pages, I code everything myself (I like to code things, including the forms ... even if they do get annoying sometimes).
Oh ya, in most development toolsets when you start typing functions and stuff it will bring up a little drop down box (without stopping you from going on typing) with functions and variables starting with what you're typing. It's just nice.
"Uwe Birkenhain" <uwe.birkenhain
berlin.de> wrote in message
news:20020710160903.72371.qmail
pb1.pair.com...
> I think that - on windows - nothing is better than textpad
> (www.textpad.com).
> Simply the best editor the world has seen so far!
>
> What makes development tools better than a good editor? (serious question)
>
> Uwe
>
>
attached mail follows:
I have written a COM object about a year ago that worked with Crystal 8 to build real-time Reports online. I passed all the parameters to the COM object, the COM object then worked with Crystal's RDC to setup the report. Then the COM returned the Report Object to me, then I displayed the report object using Crystal's Viewer.(They have web Viewer for all browse type. ActiveX, Java and HTML) The web Client was in ASP at the time, but could be written in PHP just as easily. (In fact I am thinking of doing it, if I ever get free time) The only problem with it was that it had to be on a Window's Platform. Crystal now has something call Crystal Enterprise that can work with LINUX/UNIX now, but it is pricey and may have a lot of bugs, being it is new too *NIX.
If you are on a Window Server, Crystal works well for a window's app. From my understanding the Client I wrote it for has only had two crashes in the last year, both do the Windows Server not Crystal.
Crystal has some big bugs, but I have not found any other Reporting program that comes close.
Mark.
_________________________________________
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
mmcculli
SykesCanada.com
----- Original Message -----
From: "Jeff D. Hamann" <jeff_hamann
hamanndonald.com>
Newsgroups: php.general
To: <php-general
lists.php.net>
Sent: Wednesday, July 10, 2002 1:32 PM
Subject: reports and reporting options?
> I've got a project that requires lots of "goofy" reports. These reports
are
> more than a simple html table (which would be nice) that the client wants
to
> print out on standard 8.5x11 paper. Crystal Reports type of reports. I
need
> to be able to produce these from PHP scripts and I'm looking for a
solution.
> What are people using to accomplish this?
>
>
> --
> Jeff D. Hamann
> Hamann, Donald & Associates, Inc.
> PO Box 1421
> Corvallis, Oregon USA 97339-1421
> Bus. 541-753-7333
> Cell. 541-740-5988
> jeff_hamann
hamanndonald.com
> www.hamanndonald.com
>
>
>
attached mail follows:
also, check out:
http://www.yourlegacy.org/annualReports/readme.pdf
Rasmus Lerdorf <rasmus
php.net> wrote: php.net/pdf
On Wed, 10 Jul 2002, Jeff D. Hamann wrote:
> I've got a project that requires lots of "goofy" reports. These reports are
> more than a simple html table (which would be nice) that the client wants to
> print out on standard 8.5x11 paper. Crystal Reports type of reports. I need
> to be able to produce these from PHP scripts and I'm looking for a solution.
> What are people using to accomplish this?
>
>
> --
> Jeff D. Hamann
> Hamann, Donald & Associates, Inc.
> PO Box 1421
> Corvallis, Oregon USA 97339-1421
> Bus. 541-753-7333
> Cell. 541-740-5988
> jeff_hamann
hamanndonald.com
> www.hamanndonald.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--------------------------------- Do You Yahoo!? New! SBC Yahoo! Dial - 1st Month Free & unlimited access
attached mail follows:
Hello all.
I have a site that was backed up, before the box was reformatted and rebuilt. Apache and PHP were upgraded. I have since resored all of the files and DB's that make up my site. Now, in doing some testing, the html forms are not passing variables to the next page. Specifically, these variables are the databse name, and the infor to be insereted into that database. My site uses frames, and it trying to pass the information from a form on one static page (menu) to the main window to display results. This used to work before I got the bright idea to upgrade.
I have tried setting "register_globals=on" to see if that might help, but it had no effect. Has anyone else had, or is currently having issues like these? If you think you have any answer, please let me know. I will just about try anything to make this work again.
Thanks, RC
attached mail follows:
Hai,
did you check the setting of register_globals really changed? See the phpinfo(); output if it's really set to on. If not, place your php.ini file in the correct location.
Derick
Hopp3r wrote: > Hello all. > > I have a site that was backed up, before the box was reformatted and > rebuilt. Apache and PHP were upgraded. I have since resored all of the > files and DB's that make up my site. Now, in doing some testing, the html > forms are not passing variables to the next page. Specifically, these > variables are the databse name, and the infor to be insereted into that > database. My site uses frames, and it trying to pass the information from a > form on one static page (menu) to the main window to display results. This > used to work before I got the bright idea to upgrade. > > I have tried setting "register_globals=on" to see if that might help, but > it had no effect. Has anyone else had, or is currently having issues like > these? If you think you have any answer, please let me know. I will just > about try anything to make this work again. > > Thanks, > RC > >
attached mail follows:
Did you restart your server after changing register_globals? Try that.
>>> Derick Rethans <derick
php.net> 07/10/02 02:30PM >>>
Hai,
did you check the setting of register_globals really changed? See the phpinfo(); output if it's really set to on. If not, place your php.ini file in the correct location.
Derick
Hopp3r wrote: > Hello all. > > I have a site that was backed up, before the box was reformatted and > rebuilt. Apache and PHP were upgraded. I have since resored all of the > files and DB's that make up my site. Now, in doing some testing, the html > forms are not passing variables to the next page. Specifically, these > variables are the databse name, and the infor to be insereted into that > database. My site uses frames, and it trying to pass the information from a > form on one static page (menu) to the main window to display results. This > used to work before I got the bright idea to upgrade. > > I have tried setting "register_globals=on" to see if that might help, but > it had no effect. Has anyone else had, or is currently having issues like > these? If you think you have any answer, please let me know. I will just > about try anything to make this work again. > > Thanks, > RC > >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thanks Derick,
You were right. globals is still off in phpinfo(). How does one make it reread the ini file, or where is "correct location" to copy my existing php.ini file?
RC
"Derick Rethans" <derick
php.net> wrote in message
news:3D2C7D5D.8070602
php.net...
> Hai,
>
> did you check the setting of register_globals really changed? See the
> phpinfo(); output if it's really set to on. If not, place your php.ini
> file in the correct location.
>
> Derick
>
> Hopp3r wrote:
> > Hello all.
> >
> > I have a site that was backed up, before the box was reformatted and
> > rebuilt. Apache and PHP were upgraded. I have since resored all of the
> > files and DB's that make up my site. Now, in doing some testing, the
html
> > forms are not passing variables to the next page. Specifically, these
> > variables are the databse name, and the infor to be insereted into that
> > database. My site uses frames, and it trying to pass the information
from a
> > form on one static page (menu) to the main window to display results.
This
> > used to work before I got the bright idea to upgrade.
> >
> > I have tried setting "register_globals=on" to see if that might help,
but
> > it had no effect. Has anyone else had, or is currently having issues
like
> > these? If you think you have any answer, please let me know. I will just
> > about try anything to make this work again.
> >
> > Thanks,
> > RC
> >
> >
>
>
attached mail follows:
Martin,
I just rebooted, and it still show them to be off?
RC
"Martin Clifford" <MLC1
nrc.gov> wrote in message
news:sd2c49d4.086
nrcgwia.nrc.gov...
Did you restart your server after changing register_globals? Try that.
>>> Derick Rethans <derick
php.net> 07/10/02 02:30PM >>>
Hai,
did you check the setting of register_globals really changed? See the phpinfo(); output if it's really set to on. If not, place your php.ini file in the correct location.
Derick
Hopp3r wrote: > Hello all. > > I have a site that was backed up, before the box was reformatted and > rebuilt. Apache and PHP were upgraded. I have since resored all of the > files and DB's that make up my site. Now, in doing some testing, the html > forms are not passing variables to the next page. Specifically, these > variables are the databse name, and the infor to be insereted into that > database. My site uses frames, and it trying to pass the information from a > form on one static page (menu) to the main window to display results. This > used to work before I got the bright idea to upgrade. > > I have tried setting "register_globals=on" to see if that might help, but > it had no effect. Has anyone else had, or is currently having issues like > these? If you think you have any answer, please let me know. I will just > about try anything to make this work again. > > Thanks, > RC > >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hello,
You reload the php.ini file by restarting your webserver, the correct
location of php.ini can be found
http://www.php.net/manual/en/faq.installation.php#faq.installation.phpini
Derick
Hopp3r wrote:
> Thanks Derick,
>
> You were right. globals is still off in phpinfo(). How does one make it
> reread the ini file, or where is "correct location" to copy my existing
> php.ini file?
>
> RC
>
>
>
> "Derick Rethans" <derick
php.net> wrote in message
> news:3D2C7D5D.8070602
php.net...
>
>>Hai,
>>
>>did you check the setting of register_globals really changed? See the
>>phpinfo(); output if it's really set to on. If not, place your php.ini
>>file in the correct location.
>>
>>Derick
>>
>>Hopp3r wrote:
>>
>>>Hello all.
>>>
>>> I have a site that was backed up, before the box was reformatted and
>>>rebuilt. Apache and PHP were upgraded. I have since resored all of the
>>>files and DB's that make up my site. Now, in doing some testing, the
>>
> html
>
>>>forms are not passing variables to the next page. Specifically, these
>>>variables are the databse name, and the infor to be insereted into that
>>>database. My site uses frames, and it trying to pass the information
>>
> from a
>
>>>form on one static page (menu) to the main window to display results.
>>
> This
>
>>>used to work before I got the bright idea to upgrade.
>>>
>>> I have tried setting "register_globals=on" to see if that might help,
>>
> but
>
>>>it had no effect. Has anyone else had, or is currently having issues
>>
> like
>
>>>these? If you think you have any answer, please let me know. I will just
>>>about try anything to make this work again.
>>>
>>>Thanks,
>>>RC
>>>
>>>
>>
>>
>
>
attached mail follows:
I am sure this is the n00b thing think, but you do have it as $_POST["var"] for the variables right, assuming you had the other style before. also I had problems without POST being capitalized in the form section.
J
"Hopp3r" <rclark
swbanktx.com>
07/10/2002 12:23 PM
To: php-general
lists.php.net
cc:
Subject: [PHP] Forms not passing variables
Hello all.
I have a site that was backed up, before the box was reformatted and rebuilt. Apache and PHP were upgraded. I have since resored all of the files and DB's that make up my site. Now, in doing some testing, the html forms are not passing variables to the next page. Specifically, these variables are the databse name, and the infor to be insereted into that database. My site uses frames, and it trying to pass the information from a form on one static page (menu) to the main window to display results. This used to work before I got the bright idea to upgrade.
I have tried setting "register_globals=on" to see if that might help, but it had no effect. Has anyone else had, or is currently having issues like these? If you think you have any answer, please let me know. I will just about try anything to make this work again.
Thanks, RC
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
FIXED !!! Thank you all. I had to find out the path that PHP was looking in to find php.ini file.
Thanks you all again!!! RC
"Hopp3r" <rclark
swbanktx.com> wrote in message
news:20020710182313.72815.qmail
pb1.pair.com...
> Hello all.
>
> I have a site that was backed up, before the box was reformatted and
> rebuilt. Apache and PHP were upgraded. I have since resored all of the
> files and DB's that make up my site. Now, in doing some testing, the html
> forms are not passing variables to the next page. Specifically, these
> variables are the databse name, and the infor to be insereted into that
> database. My site uses frames, and it trying to pass the information from
a
> form on one static page (menu) to the main window to display results. This
> used to work before I got the bright idea to upgrade.
>
> I have tried setting "register_globals=on" to see if that might help, but
> it had no effect. Has anyone else had, or is currently having issues like
> these? If you think you have any answer, please let me know. I will just
> about try anything to make this work again.
>
> Thanks,
> RC
>
>
attached mail follows:
SELECT DISTINCT kat FROM mytable;
---- Original Message -----
From: <mail
struempf.com>
To: <php-general
lists.php.net>
Sent: Wednesday, July 10, 2002 12:40 PM
Subject: [PHP] SQL field problem
Hello
I have a problem with mysql.I create a table with a field "kat".In this field are entries like this :
Light
Dark
Dark
Light
Robot
Find
Dark
Light
You see that all entries are not unique.So i want to list as output all entries but only once.If the word "Dark" is in the table 6 times php should output dark only 1 time.
How should i solve this problem ?
Thanks!
chris
attached mail follows:
Привет!
mail
struempf.com wrote:
> You see that all entries are not unique.So i want to list as output all entries but only once.If the word "Dark" is in the table 6 times php should output dark only 1 time.
> How should i solve this problem ?
select distinct
and RTFM
:)
пока Альберто Киев
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
Chris,
select distinct kat from tablename;
Its in the mysql manual, 6.4.1 SELECT Syntax.
HTH Chris
mail
struempf.com wrote:
>Hello > >I have a problem with mysql.I create a table with a field "kat".In this field are entries like this : > >Light >Dark >Dark >Light >Robot >Find >Dark >Light > >You see that all entries are not unique.So i want to list as output all entries but only once.If the word "Dark" is in the table 6 times php should output dark only 1 time. >How should i solve this problem ? > >Thanks! >chris >
attached mail follows:
I am using Database Desk Top to create the tables...
I am a first timer to Databases, please tell me how
I can set these permissions... I am working under
WinNT... (I have not done much on any MS platforms
coz I have been using UNIX for the past 3 years...)...
I would be using chmod and tripple 6's to acquire
this under UNIX but I have no idea on how to go
about this under WinNT...
"Alex Piaz" <webmaster
globalmap.com> wrote in message
news:5.1.0.14.0.20020710151551.00ac7dd0
pop.globalmap.com...
>
> >"Kondwani Spike Mkandawire" <kondwani
cs.mun.ca> wrote in message
> >news:20020710173800.9174.qmail
pb1.pair.com...
> > > I am trying to insert info. into a paradox table but receive the
following
> > > message after inputting the data into the approriate fields...
> > >
> > > Warning: SQL error: [Microsoft][ODBC Paradox Driver] Operation
> > > must use an updateable query., SQL state S1000 in SQLExecDirect
> > > in c:\program files\apache group\apache\htdocs\coopstudent.php
> > > on line 47
>
> Your problem should be about file permissions. Try to give full
permissions
> to the IIS_USR for the Paradox tabel you want to extract data from.
>
> Let me know if you have any other questions
>
> Regards
>
> Alex
>
>
>
>
> > > I am able to retrieve info. from the table but when I write some
Insertion
> > > Code I receive the above message...
> > >
> > > This is what the code looks like... Please help...
> > >
> > > $db = odbc_connect("MyDNS", "who", "null");
> > > $dreq = "INSERT INTO myTablet.db (field1, field2, field3...) VALUES
> > > ('$field1', '$field2', '$field3'...)";
> > > odbc_exec($db, $dreq);
> > >
> > > Thanks in advance...
> > >
> > > Kondwani
> > >
> > >
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Any idea why this is off by 4 hours?
Server time zone is set correctly, %date Wed Jul 10 14:26:18 EDT 2002 but the script below returns the time as being 4 hours later then that.
<? $date = getdate(); $minutes = $date['minutes']; $hours = $date['hours']; $tz="EDT"; $today = getdate(); $month = $today['month']; $mday = $today['mday']; $year = $today['year']; $ampm="AM"; if ($hours > 12) { $hours=$hours-12; $ampm="PM"; } elseif ($hours == 12) { $ampm="PM"; } if ( $minutes < 10) { $minutes="0$minutes"; } print "$hours:$minutes $ampm $tz $month $mday, $year"; ?>
attached mail follows:
Any idea why this is off by 4 hours?
Server time zone is set correctly, %date Wed Jul 10 14:26:18 EDT 2002 but the script below returns the time as being 4 hours later then that.
<? $date = getdate(); $minutes = $date['minutes']; $hours = $date['hours']; $tz="EDT"; $today = getdate(); $month = $today['month']; $mday = $today['mday']; $year = $today['year']; $ampm="AM"; if ($hours > 12) { $hours=$hours-12; $ampm="PM"; } elseif ($hours == 12) { $ampm="PM"; } if ( $minutes < 10) { $minutes="0$minutes"; } print "$hours:$minutes $ampm $tz $month $mday, $year"; ?>
attached mail follows:
Works fine here. Are you actually in EDT?
On Wed, 10 Jul 2002, Brian V Bonini wrote:
> Any idea why this is off by 4 hours? > > Server time zone is set correctly, > %date > Wed Jul 10 14:26:18 EDT 2002 > but the script below returns the time as being 4 hours later then that. > > > <? > $date = getdate(); > $minutes = $date['minutes']; > $hours = $date['hours']; > $tz="EDT"; > $today = getdate(); > $month = $today['month']; > $mday = $today['mday']; > $year = $today['year']; > $ampm="AM"; > if ($hours > 12) { > $hours=$hours-12; > $ampm="PM"; > } elseif ($hours == 12) { > $ampm="PM"; > } > if ( $minutes < 10) { > $minutes="0$minutes"; > } > print "$hours:$minutes $ampm $tz $month $mday, $year"; > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hmmm, wierd!! The server is physically in PDT I am in EDT but I have the servers time zone set to EDT and as I said "date" verifies the correct time but yet the script returns a time that is 4 hours ahead. Wierd.... :(
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: Wednesday, July 10, 2002 6:24 PM
> To: Brian V Bonini
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] getdate
>
>
> Works fine here. Are you actually in EDT?
>
> On Wed, 10 Jul 2002, Brian V Bonini wrote:
>
> > Any idea why this is off by 4 hours?
> >
> > Server time zone is set correctly,
> > %date
> > Wed Jul 10 14:26:18 EDT 2002
> > but the script below returns the time as being 4 hours later then that.
> >
> >
> > <?
> > $date = getdate();
> > $minutes = $date['minutes'];
> > $hours = $date['hours'];
> > $tz="EDT";
> > $today = getdate();
> > $month = $today['month'];
> > $mday = $today['mday'];
> > $year = $today['year'];
> > $ampm="AM";
> > if ($hours > 12) {
> > $hours=$hours-12;
> > $ampm="PM";
> > } elseif ($hours == 12) {
> > $ampm="PM";
> > }
> > if ( $minutes < 10) {
> > $minutes="0$minutes";
> > }
> > print "$hours:$minutes $ampm $tz $month $mday, $year";
> > ?>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
attached mail follows:
Martin Clifford wrote: > There are no brackets necessary if you only have one line of code to be executed in the case. For example: > > if($var == 1) > echo "Var equals 1"; > } else { > echo Var does not equal 1"; > }
This will certianly give a parse error, your sample should be:
if ($var == 1) echo "Var equals 1"; else echo "Var does not equal 1";
> > But this is not valid: > > if($var == 1) > echo "Var equals "; > echo "1"; > } else { > .... > }
Again, the sample should look like (but ofcourse this one does not work):
if ($var == 1) echo "Var equals "; echo "1"; else echo "Var does not equal 1";
>
> HTH
>
> Martin
>
>
>>>>"Alexander Ross" <alexross
bleen.net> 07/10/02 10:25AM >>>
>>>
> I know this is correct:
>
> if ($something)
> {
> ...
> }
> else
> {
> ...
> }
>
> But I recently saw someone use this instead:
>
> if($something):
> ...
> else:
> ...
>
> Is that also correct?? No brackets needed?
>
>
>
attached mail follows:
I use php3 with IIS 5.0. When user typed a no existing .html or php3 page, they will get a "No input file specified." page. How can I point this to a HTTP Error 400 page? Anything can be set up in the php.ini file or in IIS configuration?
Thanks for any help!!
attached mail follows:
Chen,
If the webserver cannot file a file then this is a webserver problem not php. You need to look at your IIS configuration/documentation. Sorry I can't help further, but I don't use IIS.
HTH Chris
Chen wrote:
>I use php3 with IIS 5.0. When user typed a no existing .html or php3 >page, they will get a "No input file specified." page. How can I point >this to a HTTP Error 400 page? Anything can be set up in the php.ini >file or in IIS configuration? > >Thanks for any help!! > >
attached mail follows:
Chris,
Thank you for the response. I think this is the php setting. If the user enter a page name 12345.pdf and there is no such page, the browse will show the page cannot be found and the HTTP 404 error. But if user enter 12345.php3 or 12345.html(IIS mapping these two kind of files to php.exe), the HTTP 404 error won't show up, only display "No input file specified." message.
Chris Hewitt wrote:
> Chen, > > If the webserver cannot file a file then this is a webserver problem not > php. You need to look at your IIS configuration/documentation. Sorry I > can't help further, but I don't use IIS. > > HTH > Chris > > Chen wrote: > > >I use php3 with IIS 5.0. When user typed a no existing .html or php3 > >page, they will get a "No input file specified." page. How can I point > >this to a HTTP Error 400 page? Anything can be set up in the php.ini > >file or in IIS configuration? > > > >Thanks for any help!! > > > >
attached mail follows:
Is it doing this for all php based files? Have you tried a php file that only has basic commands? Something like this:
<?php echo "Hello world!"; ?>
-----Original Message----- only display "No input file specified." message. **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.
attached mail follows:
I am running PHP, Win 2K (NT 5.0 build 2195), API Server CGI, in IIS 5. Just trying to get the basics to work prior to working with Mysql. Running <? phpinfo() ?> I get the appropriate results.
However, running the Tutorial scripts found in PHP and MySQL (SAMS), I get, for example, the following error message for all 3 fields: Notice: Undefined variable: tireqty in c:\inetpub\wwwroot\php_tutorial1\processorder2.php on line 11 tires Here is what is in line 11 is - echo $tireqty. "tires<br>";
Any suggestions? Gene
attached mail follows:
[snip] However, running the Tutorial scripts found in PHP and MySQL (SAMS), I get, for example, the following error message for all 3 fields: Notice: Undefined variable: tireqty in c:\inetpub\wwwroot\php_tutorial1\processorder2.php on line 11 tires Here is what is in line 11 is - echo $tireqty. "tires<br>"; [/snip]
$tireqty is not defined.
[snip] Any suggestions? [/snip]
Send more of the code, cannot tell why it is not defined or if you used the right variable
Jay
attached mail follows:
the following is the script requested: <html> <head> <title>Bob's Auto Parts - Order Results</title> </head> <body> <h1>Bob's Auto Parts</h1> <h2>Order Results</h2> <? $totalqty = 0; $totalqty += $tyreqty; $totalqty += $oilqty; $totalqty += $sparkqty; $totalamount = 0.00; define("TYREPRICE", 100); define("OILPRICE", 10); define("SPARKPRICE", 4);
if( $tyreqty < 10 ) $discount = 0; elseif( $tyreqty >= 10 && $tyreqty <= 49 ) $discount = 5; elseif( $tyreqty >= 50 && $tyreqty <= 99 ) $discount = 10; elseif( $tyreqty > 100 ) $discount = 15; echo "<p>Order processed at "; echo date("H:i, jS F"); echo "<br>"; echo "<p>Your order is as follows:"; echo "<br>";
if( $totalqty == 0 ) { echo "You did not order anything on the previous page!<br>"; } else { if ( $tyreqty>0 ) echo $tyreqty." tyres<br>"; if ( $oilqty>0 ) echo $oilqty." bottles of oil<br>"; if ( $sparkqty>0 ) echo $sparkqty." spark plugs<br>"; }
echo "<P>Discount on tyres = ".$discount."%"; // if version /* if($find == "a") echo "<P>Regular customer."; elseif($find == "b") echo "<P>Customer referred by TV advert."; elseif($find == "c") echo "<P>Customer referred by phone directory."; elseif($find == "d") echo "<P>Customer referred by word of mouth."; */
// switch version switch($find) { case "a" : echo "<P>Regular customer."; break; case "b" : echo "<P>Customer referred by TV advert."; break; case "c" : echo "<P>Customer referred by phone directory."; break; case "c" : echo "<P>Customer referred by word of mouth."; break; default : echo "<P>We do not know how this customer found us."; break; }
?> </body> </html>
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Sent: Wednesday, July 10, 2002 2:54 PM
To: eugene.mcquade
bconnectedonline.com; 'Php-General
Lists. Php. Net
(E-mail)'
Subject: RE: [PHP] Can't get the example to work
[snip] However, running the Tutorial scripts found in PHP and MySQL (SAMS), I get, for example, the following error message for all 3 fields: Notice: Undefined variable: tireqty in c:\inetpub\wwwroot\php_tutorial1\processorder2.php on line 11 tires Here is what is in line 11 is - echo $tireqty. "tires<br>"; [/snip]
$tireqty is not defined.
[snip] Any suggestions? [/snip]
Send more of the code, cannot tell why it is not defined or if you used the right variable
Jay
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
[snip] echo $tireqty. "tires<br> [/snip]
$tyreqty
looks like you have a typo
HTH!
Jay
-----Original Message-----
From: Eugene.McQuade [mailto:eugene.mcquade
bconnectedonline.com]
Sent: Wednesday, July 10, 2002 2:21 PM
To: 'Jay Blanchard'; 'Php-General
Lists. Php. Net (E-mail)'
Subject: RE: [PHP] Can't get the example to work
the following is the script requested: <html> <head> <title>Bob's Auto Parts - Order Results</title> </head> <body> <h1>Bob's Auto Parts</h1> <h2>Order Results</h2> <? $totalqty = 0; $totalqty += $tyreqty; $totalqty += $oilqty; $totalqty += $sparkqty; $totalamount = 0.00; define("TYREPRICE", 100); define("OILPRICE", 10); define("SPARKPRICE", 4);
if( $tyreqty < 10 ) $discount = 0; elseif( $tyreqty >= 10 && $tyreqty <= 49 ) $discount = 5; elseif( $tyreqty >= 50 && $tyreqty <= 99 ) $discount = 10; elseif( $tyreqty > 100 ) $discount = 15; echo "<p>Order processed at "; echo date("H:i, jS F"); echo "<br>"; echo "<p>Your order is as follows:"; echo "<br>";
if( $totalqty == 0 ) { echo "You did not order anything on the previous page!<br>"; } else { if ( $tyreqty>0 ) echo $tyreqty." tyres<br>"; if ( $oilqty>0 ) echo $oilqty." bottles of oil<br>"; if ( $sparkqty>0 ) echo $sparkqty." spark plugs<br>"; }
echo "<P>Discount on tyres = ".$discount."%"; // if version /* if($find == "a") echo "<P>Regular customer."; elseif($find == "b") echo "<P>Customer referred by TV advert."; elseif($find == "c") echo "<P>Customer referred by phone directory."; elseif($find == "d") echo "<P>Customer referred by word of mouth."; */
// switch version switch($find) { case "a" : echo "<P>Regular customer."; break; case "b" : echo "<P>Customer referred by TV advert."; break; case "c" : echo "<P>Customer referred by phone directory."; break; case "c" : echo "<P>Customer referred by word of mouth."; break; default : echo "<P>We do not know how this customer found us."; break; }
?> </body> </html>
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Sent: Wednesday, July 10, 2002 2:54 PM
To: eugene.mcquade
bconnectedonline.com; 'Php-General
Lists. Php. Net
(E-mail)'
Subject: RE: [PHP] Can't get the example to work
[snip] However, running the Tutorial scripts found in PHP and MySQL (SAMS), I get, for example, the following error message for all 3 fields: Notice: Undefined variable: tireqty in c:\inetpub\wwwroot\php_tutorial1\processorder2.php on line 11 tires Here is what is in line 11 is - echo $tireqty. "tires<br>"; [/snip]
$tireqty is not defined.
[snip] Any suggestions? [/snip]
Send more of the code, cannot tell why it is not defined or if you used the right variable
Jay
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
hmmm...re-did it from scratch and get the same message. I've included the html script from the form as well: <html> <head> <title>Bob's Auto Parts</title> </head> <body> <h1>Bob's Auto Parts</h1> <h2>Order Form</h2>
<form action="processorder2.php" method=post> <table border=0> <tr bgcolor=#cccccc> <td width=150>Item</td> <td width=15>Quantity</td> </tr> <tr> <td>Tyres</td> <td align=center><input type="text" name="tyreqty" size=3 maxlength=3></td> </tr> <tr> <td>Oil</td> <td align=center><input type="text" name="oilqty" size=3 maxlength=3></td> </tr> <tr> <td>Spark Plugs</td> <td align=center><input type="text" name="sparkqty" size=3 maxlength=3></td> </tr> <tr> <td>How did you find Bob's</td> <td><select name="find"> <option value = "a">I'm a regular customer <option value = "b">TV advertising <option value = "c">Phone directory <option value = "d">Word of mouth </select> </td> </tr> <tr> <td colspan=2 align=center><input type=submit value="Submit Order"></td> </tr> </table> </form>
</body> </html> AND THE RESULTS PAGE: <html> <head> <title>Bob's Auto Parts - Order Results</title> </head> <body> <h1>Bob's Auto Parts</h1> <h2>Order Results</h2> <? $totalqty = 0; $totalqty += $tyreqty; $totalqty += $oilqty; $totalqty += $sparkqty;
$totalamount = 0.00;
define("TYREPRICE", 100); define("OILPRICE", 10); define("SPARKPRICE", 4);
if( $tyreqty < 10 ) $discount = 0; elseif( $tyreqty >= 10 && $tyreqty <= 49 ) $discount = 5; elseif( $tyreqty >= 50 && $tyreqty <= 99 ) $discount = 10; elseif( $tyreqty > 100 ) $discount = 15;
echo "<p>Order processed at "; echo date("H:i, jS F"); echo "<br>"; echo "<p>Your order is as follows:"; echo "<br>";
if( $totalqty == 0 ) { echo "You did not order anything on the previous page!<br>"; } else { if ( $tyreqty>0 ) echo $tyreqty." tyres<br>"; if ( $oilqty>0 ) echo $oilqty." bottles of oil<br>"; if ( $sparkqty>0 ) echo $sparkqty." spark plugs<br>"; }
echo "<P>Discount on tyres = ".$discount."%";
// if version /* if($find == "a") echo "<P>Regular customer."; elseif($find == "b") echo "<P>Customer referred by TV advert."; elseif($find == "c") echo "<P>Customer referred by phone directory."; elseif($find == "d") echo "<P>Customer referred by word of mouth."; */
// switch version switch($find) { case "a" : echo "<P>Regular customer."; break; case "b" : echo "<P>Customer referred by TV advert."; break; case "c" : echo "<P>Customer referred by phone directory."; break; case "c" : echo "<P>Customer referred by word of mouth."; break; default : echo "<P>We do not know how this customer found us."; break; }
?> </body> </html>
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Sent: Wednesday, July 10, 2002 3:22 PM
To: eugene.mcquade
bconnectedonline.com; 'Php-General
Lists. Php. Net
(E-mail)'
Subject: RE: [PHP] Can't get the example to work
[snip] echo $tireqty. "tires<br> [/snip]
$tyreqty
looks like you have a typo
HTH!
Jay
-----Original Message-----
From: Eugene.McQuade [mailto:eugene.mcquade
bconnectedonline.com]
Sent: Wednesday, July 10, 2002 2:21 PM
To: 'Jay Blanchard'; 'Php-General
Lists. Php. Net (E-mail)'
Subject: RE: [PHP] Can't get the example to work
the following is the script requested: <html> <head> <title>Bob's Auto Parts - Order Results</title> </head> <body> <h1>Bob's Auto Parts</h1> <h2>Order Results</h2> <? $totalqty = 0; $totalqty += $tyreqty; $totalqty += $oilqty; $totalqty += $sparkqty;
$totalamount = 0.00;
define("TYREPRICE", 100); define("OILPRICE", 10); define("SPARKPRICE", 4);
if( $tyreqty < 10 ) $discount = 0; elseif( $tyreqty >= 10 && $tyreqty <= 49 ) $discount = 5; elseif( $tyreqty >= 50 && $tyreqty <= 99 ) $discount = 10; elseif( $tyreqty > 100 ) $discount = 15;
echo "<p>Order processed at "; echo date("H:i, jS F"); echo "<br>"; echo "<p>Your order is as follows:"; echo "<br>";
if( $totalqty == 0 ) { echo "You did not order anything on the previous page!<br>"; } else { if ( $tyreqty>0 ) echo $tyreqty." tyres<br>"; if ( $oilqty>0 ) echo $oilqty." bottles of oil<br>"; if ( $sparkqty>0 ) echo $sparkqty." spark plugs<br>"; }
echo "<P>Discount on tyres = ".$discount."%";
// if version /* if($find == "a") echo "<P>Regular customer."; elseif($find == "b") echo "<P>Customer referred by TV advert."; elseif($find == "c") echo "<P>Customer referred by phone directory."; elseif($find == "d") echo "<P>Customer referred by word of mouth."; */
// switch version switch($find) { case "a" : echo "<P>Regular customer."; break; case "b" : echo "<P>Customer referred by TV advert."; break; case "c" : echo "<P>Customer referred by phone directory."; break; case "c" : echo "<P>Customer referred by word of mouth."; break; default : echo "<P>We do not know how this customer found us."; break; }
?> </body> </html>
-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Sent: Wednesday, July 10, 2002 2:54 PM
To: eugene.mcquade
bconnectedonline.com; 'Php-General
Lists. Php. Net
(E-mail)'
Subject: RE: [PHP] Can't get the example to work
[snip] However, running the Tutorial scripts found in PHP and MySQL (SAMS), I get, for example, the following error message for all 3 fields: Notice: Undefined variable: tireqty in c:\inetpub\wwwroot\php_tutorial1\processorder2.php on line 11 tires Here is what is in line 11 is - echo $tireqty. "tires<br>"; [/snip]
$tireqty is not defined.
[snip] Any suggestions? [/snip]
Send more of the code, cannot tell why it is not defined or if you used the right variable
Jay
-- 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:
Yes, on success the command I am issuing does not produce any output on the command line and thus the $status variable should be blank on success. But when made to fail MySQL does return an error on the command line yet the variable does not hold FALSE as the manual suggests it should or anything else. This suggests, as do a few posts I just noticed in the manual, that one cannot assign the output of system() and perhaps passthru() and exec() to a variable. I think this is only possible using backticks, which I can't use as this needs to be run in safe mode. So I guess I just need to use the return_var as you suggested. Thanks!
"Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in message
news:20020710070725.GA20614
panix.com...
> On Tue, Jul 09, 2002 at 11:41:47PM -0700, Fargo Lee wrote:
>
> > got it to assign a 0 (success) or 1 (failure) to the return_var argument
as
> > you suggested so I am happy.
>
> Good!
>
>
> > What mixed me up and I still don't understand is the manual entry for
> > system() says ...
> >
> > "Returns the last line of the command output on success, and FALSE on
> > failure."
> >
> > When it says it "Returns", where does it return this information and how
can
> > it be captured for comparison?
>
> The thing that's tripping you up is, I believe, executing MySQL programs
> at a prompt doesn't produce any visible output. But, if you executed a
> command that returns some output to STDOUT, like "ls", you'd see the last
> line of output therefrom in the "Return."
>
> --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:
Thanks that explains why I did not initially have a space after the -u as I copied the code from another of my applications that used backticks without reviewing it. It appears that using backticks is also the only way to assign the output of a command to a variable as system(), passthru() and exec() don't appear to be able to do this. Unfortunately this snippet of code needs to be compatible with PHP installations running in safe mode so I can't use backticks.
"John Holmes" <holmes072000
charter.net> wrote in message
news:021501c22807$a91e42d0$b402a8c0
mango...
> Try using backticks, and you don't need spaces after -u and -p
>
> $result = `MySQL -uuser -ppassword databasename < filename.sql`
>
> Note that if it succeeds, nothing will be returned. Same as when you run
> the command on the command line.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Fargo Lee [mailto:fargolee
iname.com]
> > Sent: Wednesday, July 10, 2002 1:27 AM
> > To: php-general
lists.php.net
> > Subject: Re: [PHP] How do I import tables into MySQL from web page ...
> >
> > Thanks for pointing out the syntax error. I added the space after the
> -u
> > but
> > it did not make any difference. It still gives the same result, that
> is
> > "Success", when it actually fails. What I am trying to figure out is
> how I
> > can tell if it failed (did not create the tables)? The $status
> variable
> > does
> > not appear to hold the output of the system() function. Anyone know
> how to
> > get the output of system, passthru or exec into the $status variable
> to
> > check for success or failure?
> >
> > "Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in
> message
> > news:20020710030254.GA10805
panix.com...
> > > On Tue, Jul 09, 2002 at 06:09:36PM -0700, Fargo Lee wrote:
> > > >
> > > > $status = system("mysql -umyuserid -pmypassword mydbname <
> > >
> > > You need a space between "-u" and "myuserid"
> > >
> > > --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
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
On Wed, Jul 10, 2002 at 12:14:58PM -0700, Fargo Lee wrote: > > when made to fail MySQL does return an error on the command line yet the > variable does not hold FALSE as the manual suggests it should or anything > else.
The behaviour of returning FALSE upon failure has to do with the system() call not being able to be made due to things like the command itself not being able to execute, such as when the name of the program is wrong. But, since the program in this case actually executed, there's no failure.
--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:
On Wed, Jul 10, 2002 at 12:14:58PM -0700, Fargo Lee wrote: > > This suggests, as do a few posts I just noticed in the manual, that > one cannot assign the output of system() and perhaps passthru() and exec() > to a variable.
I forgot to mention, that's not accurate. I just ran a test to make sure. Got the results just fine.
Just for clarity, here's my test (PHP 4.2.1, NT 4.0):
# real directory. # result: output shows file list, false no, return 0 # $output = system('dir c:\books', $return_var);
# fake directory. # result: output shows nothing, false yes, return 1 $output = system('dir y:\fake', $return_var);
echo "output: $output"; echo '<hr />'; echo 'output false? ' . ( ($output == FALSE) ? 'yes' : 'no' ); echo '<hr />'; echo "return: $return_var";
--Dan
I think this is only possible using backticks, which I can't
> use as this needs to be run in safe mode. So I guess I just need to use the
> return_var as you suggested. Thanks!
>
> "Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in message
> news:20020710070725.GA20614
panix.com...
> > On Tue, Jul 09, 2002 at 11:41:47PM -0700, Fargo Lee wrote:
> >
> > > got it to assign a 0 (success) or 1 (failure) to the return_var argument
> as
> > > you suggested so I am happy.
> >
> > Good!
> >
> >
> > > What mixed me up and I still don't understand is the manual entry for
> > > system() says ...
> > >
> > > "Returns the last line of the command output on success, and FALSE on
> > > failure."
> > >
> > > When it says it "Returns", where does it return this information and how
> can
> > > it be captured for comparison?
> >
> > The thing that's tripping you up is, I believe, executing MySQL programs
> > at a prompt doesn't produce any visible output. But, if you executed a
> > command that returns some output to STDOUT, like "ls", you'd see the last
> > line of output therefrom in the "Return."
> >
> > --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
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
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:
I ran a few tests as well and the few system commands I tried only saved the *last* line of the output in a variable on success as the manual suggests it should - better than nothing - but not the entire output as you seem to suggest you were able to do and what I have been trying to do.
"Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in message
news:20020710233342.GB22872
panix.com...
> On Wed, Jul 10, 2002 at 12:14:58PM -0700, Fargo Lee wrote:
> >
> > This suggests, as do a few posts I just noticed in the manual, that
> > one cannot assign the output of system() and perhaps passthru() and
exec()
> > to a variable.
>
> I forgot to mention, that's not accurate. I just ran a test to make sure.
> Got the results just fine.
>
> Just for clarity, here's my test (PHP 4.2.1, NT 4.0):
>
> # real directory.
> # result: output shows file list, false no, return 0
> # $output = system('dir c:\books', $return_var);
>
> # fake directory.
> # result: output shows nothing, false yes, return 1
> $output = system('dir y:\fake', $return_var);
>
> echo "output: $output";
> echo '<hr />';
> echo 'output false? ' . ( ($output == FALSE) ? 'yes' : 'no' );
> echo '<hr />';
> echo "return: $return_var";
>
>
> --Dan
>
>
> I think this is only possible using backticks, which I can't
> > use as this needs to be run in safe mode. So I guess I just need to use
the
> > return_var as you suggested. Thanks!
> >
> > "Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in
message
> > news:20020710070725.GA20614
panix.com...
> > > On Tue, Jul 09, 2002 at 11:41:47PM -0700, Fargo Lee wrote:
> > >
> > > > got it to assign a 0 (success) or 1 (failure) to the return_var
argument
> > as
> > > > you suggested so I am happy.
> > >
> > > Good!
> > >
> > >
> > > > What mixed me up and I still don't understand is the manual entry
for
> > > > system() says ...
> > > >
> > > > "Returns the last line of the command output on success, and FALSE
on
> > > > failure."
> > > >
> > > > When it says it "Returns", where does it return this information and
how
> > can
> > > > it be captured for comparison?
> > >
> > > The thing that's tripping you up is, I believe, executing MySQL
programs
> > > at a prompt doesn't produce any visible output. But, if you executed
a
> > > command that returns some output to STDOUT, like "ls", you'd see the
last
> > > line of output therefrom in the "Return."
> > >
> > > --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
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> 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:
But if system() thinks it is a success because the command executed, even though MySQL returns an internal error on the command line, why is'nt the last line of the MySQL error message stored in the variable as the system() manual suggests it should be when system() thinks it is a success?
"Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in message
news:20020710232605.GA22872
panix.com...
> On Wed, Jul 10, 2002 at 12:14:58PM -0700, Fargo Lee wrote:
> >
> > when made to fail MySQL does return an error on the command line yet the
> > variable does not hold FALSE as the manual suggests it should or
anything
> > else.
>
> The behaviour of returning FALSE upon failure has to do with the system()
> call not being able to be made due to things like the command itself not
> being able to execute, such as when the name of the program is wrong.
> But, since the program in this case actually executed, there's no failure.
>
> --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:
using dan's test below if u add a '/s' like so
$output = system('dir /s c:\books', $return_var);
you will get all contents os subdir's as well....
how ever i suggest working on a format as this tree's out along the page
so maybe if u add a '/w' after the '/s'as well that will sort of solve that problem ..
though does create one massive block of filenames in ur browser...
Cheers
> -----Original Message-----
> From: Fargo Lee [mailto:fargolee
iname.com]
> Sent: Thursday, 11 July 2002 11:54 AM
> To: php-general
lists.php.net
> Subject: Re: [PHP] How do I import tables into MySQL from web page ...
>
>
> I ran a few tests as well and the few system commands I tried
> only saved the
> *last* line of the output in a variable on success as the manual
> suggests it
> should - better than nothing - but not the entire output as you seem to
> suggest you were able to do and what I have been trying to do.
>
> "Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in message
> news:20020710233342.GB22872
panix.com...
> > On Wed, Jul 10, 2002 at 12:14:58PM -0700, Fargo Lee wrote:
> > >
> > > This suggests, as do a few posts I just noticed in the manual, that
> > > one cannot assign the output of system() and perhaps passthru() and
> exec()
> > > to a variable.
> >
> > I forgot to mention, that's not accurate. I just ran a test to
> make sure.
> > Got the results just fine.
> >
> > Just for clarity, here's my test (PHP 4.2.1, NT 4.0):
> >
> > # real directory.
> > # result: output shows file list, false no, return 0
> > # $output = system('dir c:\books', $return_var);
> >
> > # fake directory.
> > # result: output shows nothing, false yes, return 1
> > $output = system('dir y:\fake', $return_var);
> >
> > echo "output: $output";
> > echo '<hr />';
> > echo 'output false? ' . ( ($output == FALSE) ? 'yes' : 'no' );
> > echo '<hr />';
> > echo "return: $return_var";
> >
> >
> > --Dan
> >
> >
> > I think this is only possible using backticks, which I can't
> > > use as this needs to be run in safe mode. So I guess I just
> need to use
> the
> > > return_var as you suggested. Thanks!
> > >
> > > "Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in
> message
> > > news:20020710070725.GA20614
panix.com...
> > > > On Tue, Jul 09, 2002 at 11:41:47PM -0700, Fargo Lee wrote:
> > > >
> > > > > got it to assign a 0 (success) or 1 (failure) to the return_var
> argument
> > > as
> > > > > you suggested so I am happy.
> > > >
> > > > Good!
> > > >
> > > >
> > > > > What mixed me up and I still don't understand is the manual entry
> for
> > > > > system() says ...
> > > > >
> > > > > "Returns the last line of the command output on success, and FALSE
> on
> > > > > failure."
> > > > >
> > > > > When it says it "Returns", where does it return this
> information and
> how
> > > can
> > > > > it be captured for comparison?
> > > >
> > > > The thing that's tripping you up is, I believe, executing MySQL
> programs
> > > > at a prompt doesn't produce any visible output. But, if
> you executed
> a
> > > > command that returns some output to STDOUT, like "ls", you'd see the
> last
> > > > line of output therefrom in the "Return."
> > > >
> > > > --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
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > 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
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Wed, Jul 10, 2002 at 07:04:58PM -0700, Fargo Lee wrote: > But if system() thinks it is a success because the command executed, even > though MySQL returns an internal error on the command line, why is'nt the > last line of the MySQL error message stored in the variable as the system() > manual suggests it should be when system() thinks it is a success?
Run the command manually at a shell prompt. What happens? Here's what happens for me on WinNT. In an error condition, say my password is invalid, it retuns the error message then a blank line and then I'm back at the prompt. So, if system() is true to the manual, that blank line is the last line, so it's the one that gets put into the variable.
Put the returned string through ord() and see what you get. I'll bet it's 10, the ordinal number for a line break. Hmm... Maybe not... Out of curiosity, I tested it on my system and it came back as 0 (a null string, but not a null variable).
--Dan
PS: Please be kind enough to make the effort to appropriately trim the messages you're replying to. Top posting is bad enough.
--
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:
> Run the command manually at a shell prompt. What happens? Here's what > happens for me on WinNT. In an error condition, say my password is > invalid, it retuns the error message then a blank line and then I'm back > at the prompt. So, if system() is true to the manual, that blank line is > the last line, so it's the one that gets put into the variable. >
My bad, it is a blank line after the error message on my system too. I missed the blank line last time, I need some glasses. Thanks.
attached mail follows:
OK.... if you are running php on apache and your form variables don't pass through.... fire up your editor and edit php.ini and turn "Register Globals ON"
Cheerz Until Next time.....
attached mail follows:
It's a much better idea to not do this, and change your code to use the $_GET and $_POST super globals for this.
Derick
Vins wrote: > OK.... if you are running php on apache and your form variables don't pass > through.... > fire up your editor and edit php.ini and turn "Register Globals ON" > > Cheerz > Until Next time..... > >
attached mail follows:
Please read:
http://www.php.net/manual/en/language.variables.predefined.php
Regards, Philip Olson
On Wed, 10 Jul 2002, vins wrote:
> OK.... if you are running php on apache and your form variables don't pass > through.... > fire up your editor and edit php.ini and turn "Register Globals ON" > > Cheerz > Until Next time..... > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Ed, Andy
Andy said that the points were in the users table. Table layouts would have been useful. It sounds to me as though the users table has not got its points up to date and needs updating from the scores table first. Then do the select on just the users table.
My 2p (pence, I'm in the UK so we're not in the Dollar or Euro zone, yet!)
Chris
Lazor, Ed wrote:
>I'm not sure if I completely understand what you're asking, but....
>
>It sounds like one table has user information. The second table has a
>record for each user and a field for the total number of points of each
>user. Something like this:
>
>Users (Table 1)
>-------------
>ID
>Name
>Address
>etc.
>
>Scores (Table 2)
>-------------
>ID
>UserID
>Points
>
>
>If this isn't the case, well, you'll probably want to adjust your database
>structure. This approach allows you to do a simple SQL query like this:
>
>select Users.*, Scores.* from Users, Scores where Users.ID = Scores.UserID
>ORDER BY Scores.Points limit 5
>
>
>
>
>-----Original Message-----
>From: andy [mailto:news.letters
gmx.de]
>Sent: Wednesday, July 10, 2002 10:52 AM
>To: php-general
lists.php.net; php-db
lists.php.net
>Subject: [PHP] sort problem
>
>
>Hi guys,
>
>I have a problem sorting values comming out of a db. It is not as easy.
>
>Here is the prob:
>One table containing user points.
>Other table containing reports with rankings
>For each top 10 report (the 10 reports with the most ranking) there are 20
>extra points granted
>
>Now I would like to get the top 5 members out of the db. If I only pull out
>the user table ordered by points desc limit 5 I might miss a user with a top
>10 report and 20 extra points.
>
>So I thought about sorting the array afterwards with asort, but then I loose
>the asoziation with the user_id.
>
>Maybe there is a way to sort the other arrays with the same sorting algo? Or
>a way to include a iff clause in the query?
>
>currently I am doing:
>SELECT
> u_name,
> id,
> points
>FROM user
>WHERE
> points > 0
>ORDER by points desc
>LIMIT 5
>
>and the top10 reports extra.
>
>Has anybody a good idea on that?
>
>Andy
>
>
>
attached mail follows:
Please post the relevant table and field names.
--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:
I am a little confused about storing stuff in cookies/sessions and how to prevent spoofing of them.
A user logs in, his e-mail address or user id and password(md5'ed) is checked against my database.
Assuming it matches, I then set a cookie with the users id + email.
What is to stop someone from spoofing that cookie? I obviously don't want to put the password in a cookie .. can someone point me in the direction of an article about this? I've searched around, but I'm not finding stuff about in a preventing spoofing / security aspect.
Thanks, Chad
attached mail follows:
What I have done in the past is create a session variable that tells me that the person using that session is valid. It's really really hard to spoof a session variable. I did it this way after awhile since the original way that I did it was by checking their username/password in the session on every page hit.. Which when I have over a million hits per day begins to wear on the database..
So far using a session variable is the best way that I have found.
Cheers!
Rick
"Too much caution is bad for you. By avoiding things you fear, you may let yourself in for unhappy consequences. It is usually wiser to stand up to a scary-seeming experience and walk right into it, risking the bruises as hard knocks. You are likely to find it is not as tough as you had thought. Or you may find it plenty tough, but also discover you have what it takes to handle it." - Norman Vincent Peale
> From: "Chad Day" <cday
atpco.com>
> Date: Wed, 10 Jul 2002 16:09:53 -0400
> To: <php-general
lists.php.net>
> Subject: [PHP] Dumb session / cookie / password questions
>
> I am a little confused about storing stuff in cookies/sessions and how to
> prevent spoofing of them.
>
> A user logs in, his e-mail address or user id and password(md5'ed) is
> checked against my database.
>
> Assuming it matches, I then set a cookie with the users id + email.
>
> What is to stop someone from spoofing that cookie? I obviously don't want
> to put the password in a cookie .. can someone point me in the direction of
> an article about this? I've searched around, but I'm not finding stuff
> about in a preventing spoofing / security aspect.
>
> Thanks,
> Chad
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Firstly, you should ALWAYS use an encryption algorithm for passwords. For my site, I used md5() and match with that. That way, even if someone does get a hold of the encrypted password, it's not in their best interest (or maybe it is, if they're bored) to crack it.
I haven't testing the following out, but it might work if someone wants to be a smartass and type out "index.php?user=admingod&pass=adminpass&email=blahblah
blah.blah" in which they know the info.
<?php if(!empty($_GET)) { header("Location: $PHP_SELF"); } ?>
Putting that at the top of the page would check to see if any information was sent to the page from the $_GET superglobal, and if it was, reload the page without any URL extensions. It sounds good in theory, though I haven't tested it, so it might not work as I think it should (it NEVER does!).
My $20.00 (big mouth)
Martin Clifford http://www.completesource.net (Now Open!)
>>> "Chad Day" <cday
atpco.com> 07/10/02 04:09PM >>>
I am a little confused about storing stuff in cookies/sessions and how to
prevent spoofing of them.
A user logs in, his e-mail address or user id and password(md5'ed) is checked against my database.
Assuming it matches, I then set a cookie with the users id + email.
What is to stop someone from spoofing that cookie? I obviously don't want to put the password in a cookie .. can someone point me in the direction of an article about this? I've searched around, but I'm not finding stuff about in a preventing spoofing / security aspect.
Thanks, Chad
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Привет!
Martin Clifford wrote: > Firstly, you should ALWAYS use an encryption algorithm for passwords. > For my site, I used md5() and match with that. > That way, even if someone does get a hold of the encrypted password, it's not in their best interest > (or maybe it is, if they're bored) to crack it.
NO need for decryption. I can just present it "as is" and your soft's gonna drink it (and may burp afterwards) :)
> Putting that at the top of the page would check to see if any > information was sent to the page from the $_GET superglobal, and if it > was, reload the page without any URL extensions.
Using Register globals off would do the same without any code add-on. And it *does* work, as many a user lately found out, in anguish for his/her vanished parameters/sessions/cookies/umbrellas and girlfriends :) Yet it cannot block your MD5 stuff from being presented back to you on the right channel (not so difficult to guess, it's three channels in all).
If you don't hold CC numbers, military stuff, bank transactions or mafia secrets I can hardly see any need for paranoia (in case you do MD5ing is a *poor* solution). Having your CC processed by a secure third party will cost you much less than implementing a 90% secure system from scratch. When you have nothing to hide you also have nothing to fear :)
Think about it. Most users exchange their user/passwords in emails. "Hey! Wanna see what discount prices I got from that site, dude? Look, user Mickey pass MOuse (capital O, mind you, I love security, ya know). And don't tell anyone, okay?"
Users do it all the time. And sites, too. How many automated mails containing right the passwords you are trying to protect you'll be forced to send along the net for the sake of "customer satisfaction"?
Most of those "forgot your password? Tell us what email you gave us, we'll do the rest!" will be received on public email servers, because nobody in his mind would send a commercial site his real email (I canceled my first yahoo account when I was already receiving some 50 commercials a day, mostly about penis enlargement and marijuana replacers). Those emails will remain on the account for ages, just in case the user forgot the pass again.
Would you rate yahoo as a "secure" site? Any time I walk into a computer club while I'm on vacation I end up into somebody else's yahoo/ICQ or whatever account... I am usually trying to log out from the session that was left open. Maybe because I am too stupid to understand yahoo's security policy LOL
That was just for the sake of throwing my 2 kopeki in before going to sleep (we are in no euro/dollar/sterling area either :)
Пока Альберто Киев
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
Hi, I am reading HTTP authentication in php manual. It does not explain it from the basics of it. Can anyone tell me what exactly will the output of the following code? I thought it will ask some user name and password thing but it just displays me the string "text to send if user hits cancel". This is the code
<?php header("WWW-Authenticate: Basic realm=\"My Realm\"");
if (!isset($_SERVER['PHP_AUTH_USER'])) { header("WWW-Authenticate: Basic realm=\"My Realm\""); header("HTTP/1.0 401 Unauthorized"); echo "Text to send if user hits Cancel button\n"; exit; } else { echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>"; echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>"; } ?>
__________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
attached mail follows:
> From: Varsha Agarwal [mailto:agarwal_varsha
yahoo.com]
> Sent: Wednesday, July 10, 2002 4:30 PM
>I thought it will ask some user name and > password thing but it just displays me the string > "text to send if user hits cancel". > This is the code: > > <?php > header("WWW-Authenticate: Basic realm=\"My Realm\"");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Get rid of the above statement
> > if (!isset($_SERVER['PHP_AUTH_USER'])) { > header("WWW-Authenticate: Basic realm=\"My > Realm\""); > header("HTTP/1.0 401 Unauthorized"); > echo "Text to send if user hits Cancel button\n"; > exit; > } else { > echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>"; > echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as > your password.</p>"; > } > ?>
<?php header("WWW-Authenticate: Basic realm=\"My Realm\""); header("HTTP/1.0 401 Unauthorized"); ?>
The above two statements will cause the browser to pop up the login window and pass any input (including none) back to the page. Any user input will be in the two $_SERVER vars. Typically you'd validate this with a db or something, and allow access if the user id and password validate. HTTP Auth in HTTP/1.0 isn't secure as the credentials are sent clear text to the server on every GET request, so on a page with images and such it's sent several times. Also, there's no way to sign out other then closing all of the browser windows. It's better to design a session based solution, with a login page, and set a session variable(s) indicating the authorized so the user id/password are only sent once, and you can control session timeout to require re-logging in after some interval of inactivity. You'd also have to consider session hijacking, which is covered in the archives.
attached mail follows:
Hi, Thanks for the explaination. But that code does not pop up any login window. Do I need to do any settings for that??
--- Matt Schroebel <MSchroebel
hsus.org> wrote:
> > From: Varsha Agarwal
> [mailto:agarwal_varsha
yahoo.com]
> > Sent: Wednesday, July 10, 2002 4:30 PM
>
> >I thought it will ask some user name and
> > password thing but it just displays me the string
> > "text to send if user hits cancel".
> > This is the code:
> >
> > <?php
> > header("WWW-Authenticate: Basic realm=\"My
> Realm\"");
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Get rid of the above statement
>
> >
> > if (!isset($_SERVER['PHP_AUTH_USER'])) {
> > header("WWW-Authenticate: Basic realm=\"My
> > Realm\"");
> > header("HTTP/1.0 401 Unauthorized");
> > echo "Text to send if user hits Cancel
> button\n";
> > exit;
> > } else {
> > echo "<p>Hello
> {$_SERVER['PHP_AUTH_USER']}.</p>";
> > echo "<p>You entered {$_SERVER['PHP_AUTH_PW']}
> as
> > your password.</p>";
> > }
> > ?>
>
> <?php
> header("WWW-Authenticate: Basic realm=\"My
> Realm\"");
> header("HTTP/1.0 401 Unauthorized");
> ?>
>
> The above two statements will cause the browser to
> pop up the login window and pass any input
> (including none) back to the page. Any user input
> will be in the two $_SERVER vars. Typically you'd
> validate this with a db or something, and allow
> access if the user id and password validate. HTTP
> Auth in HTTP/1.0 isn't secure as the credentials are
> sent clear text to the server on every GET request,
> so on a page with images and such it's sent several
> times. Also, there's no way to sign out other then
> closing all of the browser windows. It's better to
> design a session based solution, with a login page,
> and set a session variable(s) indicating the
> authorized so the user id/password are only sent
> once, and you can control session timeout to require
> re-logging in after some interval of inactivity.
> You'd also have to consider session hijacking, which
> is covered in the archives.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
attached mail follows:
on my page (lessen.php)
i have a variable $sort
if this varible is empty if enterd the page then it will be set on 'day'
i have 3 links in the page
lessen.php?sort=day lessen.php?sort=game lessen.php?sort=player
so these links refure to the same page (itself) on clicked it opens itself and should set the varible to day, game or player but that doesn't happen. can somebody help me please
see attachmend
greetz
cid
begin 666 uurrooster.html
M/$A434P^#0H\2$5!1#X-"CQ4251,13Y);G-C:')I:G9I;F<\+U1)5$Q%/
T*
M/$U%5$$
2%144"U%455)5CTB0V]N=&5N="U4>7!E(B!#3TY414Y4/2)T97AT
M+VAT;6P[(&-H87)S970]:7-O+3
X-3DM,2(^#0H\(2TM($EM86=E4F5A9'D
M4')E;&]A9"!38W)I<'0
*&QA>6]U=#,N<'-D*2 M+3X-"CQ30U))4%0
5%E0
M13TB=&5X="]J879A<V-R:7!T(CX-"CPA+2T-"
T*9G5N8W1I;VX
;F5W26UA
M9V4H87)G*2![#0H):68
*&1O8W5M96YT+FEM86=E<RD
>PT*"0ER<VQT(#T
M;F5W($EM86=E*"D[#0H)"7)S;'0N<W)C(#T
87)G.PT*"0ER971U<FX
<G-L
M=#L-"
E]#0I]#0H-"F9U;F-T:6]N(&-H86YG94EM86=E<R
I('L-"
EI9B H
M9&]C=6UE;G0N:6UA9V5S("8F("AP<F5L;V%D1FQA9R ]/2!T<G5E*2D
>PT*
M"0EF;W(
*'9A<B!I/3 [(&D\8VAA;F=E26UA9V5S+F%R9W5M96YT<RYL96YG
M=&
[(&DK/3(I('L-"
D)"61O8W5M96YT6V-H86YG94EM86=E<RYA<F=U;65N
M='-;:5U=+G-R8R ](&-H86YG94EM86=E<RYA<F=U;65N='-;:2LQ73L-"
D)
M?0T*"7T-"GT-"
T*=F%R('!R96QO861&;&%G(#T
9F%L<V4[#0IF=6YC=&EO
M;B!P<F5L;V%D26UA9V5S*"D
>PT*"6EF("AD;V-U;65N="YI;6%G97,I('L-
M"
D);6%I;E]S:71E7S X7V]V97(
/2!N97=);6%G92
B:6UA9V5S+VUA:6Y?
M<VET95\P."UO=F5R+F=I9B(I.PT*"0EP<F5L;V%D1FQA9R ]('1R=64[#0H)
M?0T*?0T*#0HO+R M+3X-"CPO4T-225!4/
T*/"$M+2!%;F0
4')E;&]A9"!3
M8W)I<'0
+2T^#0H\+TA%040^#0H\0D]$62!"1T-/3$]2/2-&1D9&1D8
3$5&
M5$U!4D=)3CTP(%1/4$U!4D=)3CTP($U!4D=)3E=)1%1(/3
34%21TE.2$5)
M1TA4/3
3TY,3T%$/2)P<F5L;V%D26UA9V5S*"D[(CX-"CPA+2T
26UA9V52
M96%D>2!3;&EC97,
*&QA>6]U=#,N<'-D*2 M+3X-"CQ404),12!724142#TV
M.#$
0D]21$52/3
0T5,3%!!1$1)3D<],"!#14Q,4U!!0TE.1STP(&%L:6=N
M/2)C96YT97(B/
T*"3Q44CX-"
D)/%1$(%)/5U-004X]-#X-"
D)"3Q)34<
M4U)#/2(N+B]I;6%G97,O;6%I;E]S:71E7S Q+F=I9B(
5TE$5$
],CD
2$5)
M1TA4/3,X-2!!3%0](B(^/"]41#X-"
D)/%1$/
T*"0D)/$E-1R!34D,](BXN
M+VEM86=E<R]M86EN7W-I=&5?,#(N9VEF(B!724142#TR-S8
2$5)1TA4/34V
M($%,5#TB(CX\+U1$/
T*"0D\5$0
0T],4U!!3CTR/
T*"0D)/$E-1R!34D,]
M(BXN+VEM86=E<R]M86EN7W-I=&5?,#,N9VEF(B!724142#TS-30
2$5)1TA4
M/34V($%,5#TB(CX\+U1$/
T*"0D\5$0
4D]74U!!3CTT/
T*"0D)/$E-1R!3
M4D,](BXN+VEM86=E<R]M86EN7W-I=&5?,#0N9VEF(B!724142#TR,B!(14E'
M2%0],S
U($%,5#TB(CX\+U1$/
T*"3PO5%(^#0H)/%12/
T*"0D\5$0^#0H)
M"0D\24U'(%-20STB+BXO:6UA9V5S+V]P8F]U=RYJ<&<B(%=)1%1(/3(W-B!(
M14E'2%0],CDX($%,5#TB(CX\+U1$/
T*"0D\5$0
0T],4U!!3CTR/CQ)1E)!
M344
<W)C/2)L97-S96XN<&AP/W-O<G0])V1A9R<B(&YA;64]8F]D>2!72414
M2#TS-30
2$5)1TA4/3(Y."!F<F%M96)O<F1E<CTP/CPO249204U%/CPO5$0^
M#0H)/"]44CX-"
D\5%(^#0H)"3Q41"!#3TQ34$%./3(
4D]74U!!3CTR/
T*
M"0D)/$E-1R!34D,](BXN+VEM86=E<R]M86EN7W-I=&5?,#<N9VEF(B!72414
M2#TU-C4
2$5)1TA4/3,Q($%,5#TB(CX\+U1$/
T*"0D\5$0^#0H)"0D\02!(
M4D5&/2(C(
T*"0D)"4].34]54T5/5D52/2)C:&%N9V5);6%G97,H)VUA:6Y?
M<VET95\P."<L("<N+B]I;6%G97,O;6%I;E]S:71E7S X+6]V97(N9VEF)RD[
M(')E='5R;B!T<G5E.R(-"
D)"0E/3DU/55-%3U54/2)C:&%N9V5);6%G97,H
M)VUA:6Y?<VET95\P."<L("<N+B]I;6%G97,O;6%I;E]S:71E7S X+F=I9B<I
M.R!R971U<FX
=')U93LB/
T*"0D)"3Q)34<
3D%-13TB;6%I;E]S:71E7S X
M(B!34D,](BXN+VEM86=E<R]M86EN7W-I=&5?,#
N9VEF(B!724142#TV-2!(
M14E'2%0],3
0D]21$52/3
04Q4/2(B/CPO03X\+U1$/
T*"3PO5%(^#0H)
M/%12/
T*"0D\5$0^#0H)"0D\24U'(%-20STB+BXO:6UA9V5S+VUA:6Y?<VET
M95\P.2YG:68B(%=)1%1(/38U($A%24=(5#TR,2!!3%0](B(^/"]41#X-"
D\
M+U12/
T*"3Q44CX-"
D)/%1$/
T*"0D)/$E-1R!34D,](BXN+VEM86=E<R]S
M<&%C97(N9VEF(B!724142#TR.2!(14E'2%0],2!!3%0](B(^/"]41#X-"
D)
M/%1$/
T*"0D)/$E-1R!34D,](BXN+VEM86=E<R]S<&%C97(N9VEF(B!72414
M2#TR-S8
2$5)1TA4/3$
04Q4/2(B/CPO5$0^#0H)"3Q41#X-"
D)"3Q)34<
M4U)#/2(N+B]I;6%G97,O<W!A8V5R+F=I9B(
5TE$5$
],C
Y($A%24=(5#TQ
M($%,5#TB(CX\+U1$/
T*"0D\5$0^#0H)"0D\24U'(%-20STB+BXO:6UA9V5S
M+W-P86-E<BYG:68B(%=)1%1(/38U($A%24=(5#TQ($%,5#TB(CX\+U1$/
T*
M"0D\5$0^#0H)"0D\24U'(%-20STB+BXO:6UA9V5S+W-P86-E<BYG:68B(%=)
M1%1(/3(R($A%24=(5#TQ($%,5#TB(CX\+U1$/
T*"3PO5%(^#0H\+U1!0DQ%
M/
T*/"$M+2!%;F0
26UA9V5296%D>2!3;&EC97,
+2T^#0H\+T)/1%D^#0H\
&+TA434P^
`
end
attached mail follows:
I think you sent the wrong file...
Rick
Until you have learned to be tolerant with those who do not always agree with you; until you have cultivated the habit of saying some kind word of those whom you do not admire; until you have formed the habit of looking for the good instead of the bad there is in others, you will be neither successful nor happy. - Napolean Hill
> From: "
cid" <sven.vandamme
pandora.be>
> Date: Wed, 10 Jul 2002 23:24:23 +0200
> To: php-general
lists.php.net
> Subject: [PHP] question varibles and url
>
> on my page (lessen.php)
>
> i have a variable $sort
>
> if this varible is empty if enterd the page then it will be set on 'day'
>
> i have 3 links in the page
>
> lessen.php?sort=day
> lessen.php?sort=game
> lessen.php?sort=player
>
> so these links refure to the same page (itself)
> on clicked it opens itself and should set the varible to day, game or player
> but that doesn't happen.
> can somebody help me please
>
>
> see attachmend
>
> greetz
cid
>
>
>
attached mail follows:
What version of PHP are you using? Have you got register_globals on? If they're off you'll need to get the $sort variable by using $HTTP_GET_VARS['sort'] (or $_GET['sort'] if you're using PHP4.1.0 or later)
You attachched the wrong file (html output instead of PHP source)
You really could do with a spell checker btw :-)
HTH
Danny.
----- Original Message -----
From:
cid
To: php-general
lists.php.net
Sent: Wednesday, July 10, 2002 10:24 PM
Subject: [PHP] question varibles and url
on my page (lessen.php)
i have a variable $sort
if this varible is empty if enterd the page then it will be set on 'day'
i have 3 links in the page
lessen.php?sort=day lessen.php?sort=game lessen.php?sort=player
so these links refure to the same page (itself) on clicked it opens itself and should set the varible to day, game or player but that doesn't happen. can somebody help me please
see attachmend
greetz
cid
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
on my page (lessen.php)
i have a variable $sort
if this varible is empty if enterd the page then it will be set on 'day'
i have 3 links in the page
lessen.php?sort=day lessen.php?sort=game lessen.php?sort=player
so these links refure to the same page (itself) on clicked it opens itself and should set the varible to day, game or player but that doesn't happen. can somebody help me please
see attachmend
greetz
cid
begin 666 lessen.php
M/#]P:' -"
T*:68H(21S;W)T*7L-"B1S;W)T(#T
(F1A>2([#0I]#0H-"F5C
M:&\H(G-O<G0Z(B N("1S;W)T*3L-"C\^#0H-"CQ(5$U,/
T*/$A%040^#0H)
M/%1)5$Q%/CPO5$E43$4^#0H-"
T*/"](14%$/
T*/$)/1%D^#0H\<"!A;&EG
M;CTB<FEG:'0B(#XN3$534T5.4D]/4U1%4CPO<#X-"CQT86)L92!W:61T:#TB
M,3 P)2(
8F]R9&5R/2(P(B!C96QL<W!A8VEN9STB,2(
/
T*(" \='(
/B -
M"B
(" \=&0
=VED=&
](C$W)2(^/&$
:')E9CTB;&5S<V5N+G!H<#]S;W)T
M/61A>2(
=&%R9V5T/2)?<V5L9B(^9&%Y/"]A/CPO=&0^#0H
("
/'1D('=I
M9'1H/2(Q.24B/DAO=7(\+W1D/
T*"3QT9"!W:61T:#TB,S$E(CX\82!H<F5F
M/2)L97-S96XN<&AP/W-O<G0]9V%M92(
=&%R9V5T/2)?<V5L9B(^9V%M93PO
M83X\+W1D/
T*"3QT9"!W:61T:#TB,S,E(CX\82!H<F5F/2)L97-S96XN<&AP
M/W-O<G0]<&QA>65R(B!T87)G970](E]S96QF(CYP;&%Y97(\+V$^/"]T9#X-
J"CPO='(^#0H-"CPO=&%B;&4^#0H-"
T*#0H\+T)/1%D^#0H\+TA434P^
`
end
attached mail follows:
It works fine on my system. If you have register globals off you'll need to do it this way:
<?php
$sort = (!$_GET[sort]) ? 'day' : $_GET[sort]; echo("sort:" . $sort);
?>
Rick
And many strokes though with a little axe hew down and fell the hardest-timbered oak. - Shakespeare
> From: "sven vandamme" <sven.vandamme
pandora.be>
> Date: Wed, 10 Jul 2002 22:40:48 +0200
> To: php-general
lists.php.net
> Subject: [PHP] varible in url question
>
> on my page (lessen.php)
>
> i have a variable $sort
>
> if this varible is empty if enterd the page then it will be set on 'day'
>
> i have 3 links in the page
>
> lessen.php?sort=day
> lessen.php?sort=game
> lessen.php?sort=player
>
> so these links refure to the same page (itself)
> on clicked it opens itself and should set the varible to day, game or player
> but that doesn't happen.
> can somebody help me please
>
>
> see attachmend
>
> greetz
cid
>
>
>
>
attached mail follows:
Php4? or 3?
Have you tried $_GET["sort"]
---------------------------------------------------------------------------
Chris Kay
Technical Support - Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102
Platinum Channel Partner of the Year - Request DSL - Broadband for Business
---------------------------------------------------------------------------
> -----Original Message-----
> From: sven vandamme [mailto:sven.vandamme
pandora.be]
> Sent: Thursday, 11 July 2002 6:41 AM
> To: php-general
lists.php.net
> Subject: [PHP] varible in url question
>
>
> on my page (lessen.php)
>
> i have a variable $sort
>
> if this varible is empty if enterd the page then it will be
> set on 'day'
>
> i have 3 links in the page
>
> lessen.php?sort=day
> lessen.php?sort=game
> lessen.php?sort=player
>
> so these links refure to the same page (itself)
> on clicked it opens itself and should set the varible to day,
> game or player but that doesn't happen. can somebody help me please
>
>
> see attachmend
>
> greetz
cid
>
>
>
>
>
attached mail follows:
Please read this manual page, it has examples to suit your needs:
http://www.php.net/manual/en/language.variables.external.php
Regards, Philip Olson
On Wed, 10 Jul 2002, sven vandamme wrote:
> on my page (lessen.php)
>
> i have a variable $sort
>
> if this varible is empty if enterd the page then it will be set on 'day'
>
> i have 3 links in the page
>
> lessen.php?sort=day
> lessen.php?sort=game
> lessen.php?sort=player
>
> so these links refure to the same page (itself)
> on clicked it opens itself and should set the varible to day, game or player
> but that doesn't happen.
> can somebody help me please
>
>
> see attachmend
>
> greetz
cid
>
>
>
>
> begin 666 lessen.php
> M/#]P:' -"
T*:68H(21S;W)T*7L-"B1S;W)T(#T
(F1A>2([#0I]#0H-"F5C
> M:&\H(G-O<G0Z(B N("1S;W)T*3L-"C\^#0H-"CQ(5$U,/
T*/$A%040^#0H)
> M/%1)5$Q%/CPO5$E43$4^#0H-"
T*/"](14%$/
T*/$)/1%D^#0H\<"!A;&EG
> M;CTB<FEG:'0B(#XN3$534T5.4D]/4U1%4CPO<#X-"CQT86)L92!W:61T:#TB
> M,3 P)2(
8F]R9&5R/2(P(B!C96QL<W!A8VEN9STB,2(
/
T*(" \='(
/B -
> M"B
(" \=&0
=VED=&
](C$W)2(^/&$
:')E9CTB;&5S<V5N+G!H<#]S;W)T
> M/61A>2(
=&%R9V5T/2)?<V5L9B(^9&%Y/"]A/CPO=&0^#0H
("
/'1D('=I
> M9'1H/2(Q.24B/DAO=7(\+W1D/
T*"3QT9"!W:61T:#TB,S$E(CX\82!H<F5F
> M/2)L97-S96XN<&AP/W-O<G0]9V%M92(
=&%R9V5T/2)?<V5L9B(^9V%M93PO
> M83X\+W1D/
T*"3QT9"!W:61T:#TB,S,E(CX\82!H<F5F/2)L97-S96XN<&AP
> M/W-O<G0]<&QA>65R(B!T87)G970](E]S96QF(CYP;&%Y97(\+V$^/"]T9#X-
> J"CPO='(^#0H-"CPO=&%B;&4^#0H-"
T*#0H\+T)/1%D^#0H\+TA434P^
> `
> end
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hello,
I'm trying to use imagecreatetruecolor & imagecopyresampled to resize some of my images. The problem is I can't get PHP Version 4.0.6 to recognize that I have gd-2.0 installed. I keep getting this error: Fatal error: imagecreatetruecolor(): requires GD 2.0 or later.
I have these files in /usr/lib for gd : libgd.la libgd.so libgd.so.1 libgd.so.1.8 libgd.so.1.8.4 libgd.so.2 libgd.so.2.0.0
I installed php and gd by rpm. I did try to install gd from the source, Did make install with no errors.
Not sure where to go from here.
Thanks in advance for any help,
Mike
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.371 / Virus Database: 206 - Release Date: 6/13/02
attached mail follows:
Mike,
I suggest you try the latest snapshot
http://snaps.php.net/php-latest.tar.gz and configure like this:
./configure --with-gd=php --other options
This will use the bundled GD library, which is more current than any 'official' release. The PHP Dev Team decided to bundle it to make sure there are no more weird problems with PHP in combination with GD.
Derick
Mike wrote: > Hello, > > I'm trying to use imagecreatetruecolor & imagecopyresampled to resize some > of my images. The problem is I can't get PHP Version 4.0.6 to recognize that > I have gd-2.0 installed. I keep getting this error: Fatal error: > imagecreatetruecolor(): requires GD 2.0 or later. > > I have these files in /usr/lib for gd : > libgd.la > libgd.so > libgd.so.1 > libgd.so.1.8 > libgd.so.1.8.4 > libgd.so.2 > libgd.so.2.0.0 > > I installed php and gd by rpm. I did try to install gd from the source, Did > make install with no errors. > > Not sure where to go from here. > > Thanks in advance for any help, > > Mike > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.371 / Virus Database: 206 - Release Date: 6/13/02 >
attached mail follows:
I've done it, and it's quite a pain. Try http://www.php.net/~rasmus/gd.html and look for Rasmus's posts on google groups for some insight. One problem I had was that configure kept finding old gd's; I had go thru my system and rename them temporarly to get it to work.
"Mike" <mike
wkla.com> wrote in message
news:004501c2285c$9059c620$0a02a23f
tone.net...
> Hello,
>
> I'm trying to use imagecreatetruecolor & imagecopyresampled to resize some
> of my images. The problem is I can't get PHP Version 4.0.6 to recognize
that
> I have gd-2.0 installed. I keep getting this error: Fatal error:
> imagecreatetruecolor(): requires GD 2.0 or later.
>
> I have these files in /usr/lib for gd :
> libgd.la
> libgd.so
> libgd.so.1
> libgd.so.1.8
> libgd.so.1.8.4
> libgd.so.2
> libgd.so.2.0.0
>
> I installed php and gd by rpm. I did try to install gd from the source,
Did
> make install with no errors.
>
> Not sure where to go from here.
>
> Thanks in advance for any help,
>
> Mike
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.371 / Virus Database: 206 - Release Date: 6/13/02
>
attached mail follows:
Is their 1 function method to remove an element within an array using its key instead of its position within the element?
I am looking for a substitution for placing removing an element without having to make another array just to list all the array elements and then using that to specify where to splice.
attached mail follows:
Is their a 1 function method to remove an element within an array using its key instead of its position within the array?
I am looking for a substitution for placing removing an element without having to make another array just to list all the array elements and then using that to specify where to splice.
"David Duong" <davidduong1
hotmail.com> wrote in message
news:20020710220436.96476.qmail
pb1.pair.com...
> Is their 1 function method to remove an element within an array using its
> key instead of its position within the element?
>
> I am looking for a substitution for placing removing an element without
> having to make another array just to list all the array elements and then
> using that to specify where to splice.
>
>
attached mail follows:
I've been trying to get the follwing example to work and it just doesn't seem to be able to handle php variables in some of the excel com function args, like:
/* start entering data into the cells */ for( $i = 0; $i < 10; $i++ ) { $var_i = new Variant($i,VT_I4); echo $i. "<br>"; echo $var_i->value. "<br>"; $cell = $sheet->Cells( $i, 1 ); /* this gags, but */ $cell = $sheet->Cells( 1, 1 ); /* this works fine */ $cell->Activate(); $cell->Value = $i; /* this works */ }
Is there something I'm missing or is this really touchy like trying to do automation a few years ago?
Jeff.
-- Jeff D. Hamann Hamann, Donald & Associates, Inc. PO Box 1421 Corvallis, Oregon USA 97339-1421 Bus. 541-753-7333 Cell. 541-740-5988 jeff_hamannhamanndonald.com www.hamanndonald.com
attached mail follows:
I am not quite sure but this will do the trick:
<?php $fixedfile="<img src=\"http://64.4.14.24/spacer.gif\" width=1 height=2>"; $fixedfile=preg_replace("/src=[^>]*?>/","src=\"<!---image goes here--->\">", $fixedfile);
#preg_replace("/[search]/","[replacement]",[string]);
exit ($fixedfile); ?>
I have made some differences from what you were trying to do: I used preg_replace, I added ">" to the replacement since without it you would get: <img src="<!---image goes here--->" which would be incorrect HTML (<img src=""> would be correct).
A note From a PHP manual.: preg_replace(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg_replace().
"Kelly Meeks" <info
rightangleinc.com> wrote in message
news:002701c22832$3992e800$6501a8c0
yourw92p4bhlzg...
Hi folks,
I'm trying my hand at some pattern matching, and I have a question.
I need to take all the text between the title tags of a page, and replace it. This I can do, with the following:
$fixedfile=ereg_replace("<title>.*</title>","<title><? echo \$bstitle; ?></title>", $fixedfile); works like a charm....
Now I want to delete everything in the src section of an image tag, so I'm trying this:
$fixedfile=ereg_replace("src=\".*\">","src=\"<!---image goes here--->\"", $fixedfile);
but this doesn't work.
What am I doing wrong?
Kelly
attached mail follows:
List, I'm trying to set a cookie like this: <?php function redirect() { if ($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_NAME']) { $to = func_get_arg(0); header("HTTP/1.1 301\n"); header("Location:http://".$_SERVER['SERVER_NAME'].$to."\n"); header("Set-Cookie: sid=$sid;\n\n"); exit(); } }
function login() { [... validation code here ...] // set my cookie setcookie("sid", $sid); return true; }
if (login($token) == true) { redirect("/somepage.php"); } ?>
but this thing isn't working...seems like it's not writing the SID value in the cookie. In other code (on /somepage.php for example) when I read the cookie value ($_COOKIES['sid']) it can't find it. Ideas?
So how do I set cookies then redirect?
I'm using Apache 1.3.x, PHP 4.1.2, RH7.3
TIA /B
attached mail follows:
David Busby wrote:
> List, > I'm trying to set a cookie like this: > <?php > function redirect() { > if ($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_NAME']) { > $to = func_get_arg(0); > header("HTTP/1.1 301\n"); > header("Location:http://".$_SERVER['SERVER_NAME'].$to."\n"); > header("Set-Cookie: sid=$sid;\n\n"); > exit(); > } > }
You can't do this. Your "Set-Cookie" header is not going to be included in the HTTP response, so the browser never receives it. This is because you are using a "Location" header on the same page, which is going to take precedence. If you search the archives, you'll see more details about this behavior and some other peoples' opinions.
You have two ways around this: 1. Use a meta refresh instead of a protocol-level redirect. 2. Redesign the flow of your application to better handle this behavior.
Happy hacking.
Chris
attached mail follows:
Jason,
I too have this problem, and got the same response from them.
But I believe they weren't stripped out by your mail client, but by the PHP list itself... because I didn't *forward*, I copied and pasted.
Either that, or they can't be bothered dealing with the real issue :)
I don't know what else to do.
Justin French
on 11/07/02 2:41 AM, Jason Soza (solja
gci.net) wrote:
> Hey,
>
> I got a response from abuse
online.no regarding Erik Hegreberg's little
> stunt yesterday and they want full headers from the message in
> question. I thought all headers were going with my message to
> abuse
online.no when I forwarded, but apparently they got stripped by
> my client.
>
> Unfortunately, I deleted all of Erik's messages as they came in, so I'm
> hoping someone out there that still has at least one copy can either
> forward me a copy with all headers intact, or can copy/paste headers
> into a new message and send those to me.
>
> Just want to make sure Erik is properly dealt with by his ISP. Thanks,
>
> Jason Soza
>
attached mail follows:
Hello Justin,
Thursday, July 11, 2002, 1:35:50 AM, you wrote:
JF> Jason,
JF> I too have this problem, and got the same response from them.
JF> But I believe they weren't stripped out by your mail client, but by the PHP JF> list itself... because I didn't *forward*, I copied and pasted.
JF> Either that, or they can't be bothered dealing with the real issue :)
JF> I don't know what else to do.
JF> Justin French
Here's example of headers from my copy of his mails
From: Erik Hegreberg <ehegrebe
online.no>
To: php-general
lists.php.net
Date: Tuesday, July 9, 2002, 9:40:49 PM
Subject: [PHP]
ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
===8<==============Original message text===============
Return-Path: <php-general-return-106507-nookie=xtina.pl
lists.php.net>
Delivered-To: nookie
xtina.pl
Received: from pb1.pair.com (pb1.pair.com [216.92.131.4])
by mail.megavita.pl (Postfix) with SMTP id CACCFB8268
for <nookie
xtina.pl>; Tue, 9 Jul 2002 21:54:34 +0200 (CEST)
Received: (qmail 76145 invoked by uid 1010); 9 Jul 2002 19:39:51 -0000
Mailing-List: contact php-general-help
lists.php.net; run by ezmlm
Precedence: bulk
list-help: <mailto:php-general-help
lists.php.net>
list-unsubscribe: <mailto:php-general-unsubscribe
lists.php.net>
list-post: <mailto:php-general
lists.php.net>
Delivered-To: mailing list php-general
lists.php.net
Received: (qmail 76074 invoked from network); 9 Jul 2002 19:39:50 -0000
Message-ID: <025f01c22780$873d3db0$01000a0a
mi6>
From: "Erik Hegreberg" <ehegrebe
online.no>
To: <php-general
lists.php.net>
Date: Tue, 9 Jul 2002 21:40:49 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_025C_01C22791.4A9846F0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
Disposition-Notification-To: "Erik Hegreberg" <ehegrebe
online.no>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Subject: [PHP]
ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
Status:
===8<===========End of original message text===========
-- Pozdrowienia, Nookie mailto:nookiextina.pl http://www.shakira-online.net http://www.xtina.pl http://www.jessica.prv.pl
attached mail follows:
Read your data from $_COOKIE not $_COOKIES.
David Busby wrote: > List, > I'm trying to set a cookie like this: > <?php > function redirect() { > if ($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_NAME']) { > $to = func_get_arg(0); > header("HTTP/1.1 301\n"); > header("Location:http://".$_SERVER['SERVER_NAME'].$to."\n"); > header("Set-Cookie: sid=$sid;\n\n"); > exit(); > } > } > > function login() { > [... validation code here ...] > // set my cookie > setcookie("sid", $sid); > return true; > } > > if (login($token) == true) { > redirect("/somepage.php"); > } > ?> > > but this thing isn't working...seems like it's not writing the SID value > in the cookie. In other code (on /somepage.php for example) when I read > the cookie value ($_COOKIES['sid']) it can't find it. Ideas? > > So how do I set cookies then redirect? > > I'm using Apache 1.3.x, PHP 4.1.2, RH7.3 > > TIA > /B > >
attached mail follows:
I've got a (hopefully) simple question which is indirectly related to php.
I'm currently developing an application which includes functionality to allow users to upload image files. Does anyone here know of a way to customize the look of the HTML "file" input type? By this I mean changing the "browse" button to a graphic, hiding the text field, etc.
Any help with this would be greatly appreciated.
attached mail follows:
Go to http://www.cs.tut.fi/~jkorpela/forms/file.html; It gives an example. Press Find on Page (ctrl+F for Internet Explorer) and type in "Style Sheet", you should find what you are looking for by reading the paragraph and any below that concern Style Sheet.
For more info about Style Sheets do a search for "style sheet" or "CSS".
"Nick Oostveen" <nicko-ml
hpmarketing.com> wrote in message
news:5.1.1.6.0.20020710163120.02ef04a0
pop.hpmarketing.com...
> I've got a (hopefully) simple question which is indirectly related to php.
>
> I'm currently developing an application which includes functionality to
> allow users to upload image files. Does anyone here know of a way to
> customize the look of the HTML "file" input type? By this I mean changing
> the "browse" button to a graphic, hiding the text field, etc.
>
> Any help with this would be greatly appreciated.
>
>
attached mail follows:
on 11/07/02 10:10 AM, Nick Oostveen (nicko-ml
hpmarketing.com) wrote:
> I've got a (hopefully) simple question which is indirectly related to php.
Very indirectly. Infact, it's completely a HTML/CSS question.
Try the comp.infosystems.www.authoring.stylesheets newsgroup.
Justin French
attached mail follows:
On Wed, Jul 10, 2002 at 09:50:27AM -0000, Alex Elderson wrote: > > class test { > function test() { > $globals['test2'] = &$this; > } > } > $test1 = new test(); > > The problem hier is that $globals['test2'] is a copy of > $globals['test1'] not a > references.
Use "$GLOBALS" rather than "$globals"
--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:
just would like to confirm here whether thumbnail images that i generated dynamically with gd is cached by browsers.
a) i have a html frontend to call the php script that does that thumbnail. this html file, say, view.htm contains these lines:
<html> <img src="thumb.php?image=../images/001.jpg&x=150&resize=1"> </html>
b) the thumbnailing works perfectly. but is this thumbnail cached inside my browser. how do i find this out ?
c) if the answer to question b) above is 'No', is it a good idea to generate thumbnails dynamically but PHYSICALLY writing it to disk (with extra checking of course; is the thumb previously was available, is it the desired size etc etc)
please advise.
-- roger__________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
attached mail follows:
I have this in my web site not in an executable folder:
<HTML> <HEAD> <TITLE>My First PHP Program</TITLE> </HEAD> <BODY> <?php echo "Hello World!"; ?> </BODY> </HTML>
No problem. I then put this in the same folder:
<HTML> <HEAD> <TITLE>My Second PHP Program</TITLE> </HEAD> <BODY> <?php echo $HTTP_USER_AGENT; ?> </BODY> </HTML>
Nothing appears. What's wrong?
-- George Hester _________________________________
attached mail follows:
the $HTTP_USER_AGENT varible contains nothing...
Try doing a phpinfo(); to see what the correct varible to use is, it is most likly $_SERVER['HTTP_USER_AGENT'] since the way these varibles are handled changed a few versions ago
Andrew
"George Hester" <hesterloli
hotmail.com> wrote in message
news:20020711023254.54808.qmail
pb1.pair.com...
> I have this in my web site not in an executable folder:
>
> <HTML>
> <HEAD>
> <TITLE>My First PHP Program</TITLE>
> </HEAD>
> <BODY>
> <?php echo "Hello World!"; ?>
> </BODY>
> </HTML>
>
> No problem. I then put this in the same folder:
>
> <HTML>
> <HEAD>
> <TITLE>My Second PHP Program</TITLE>
> </HEAD>
> <BODY>
> <?php echo $HTTP_USER_AGENT; ?>
> </BODY>
> </HTML>
>
> Nothing appears. What's wrong?
>
>
> --
> George Hester
> _________________________________
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
It is working fine for me!!!
-----Original Message-----
From: George Hester [mailto:hesterloli
hotmail.com]
Sent: Thursday, July 11, 2002 8:03 AM
To: php-general
lists.php.net
Subject: [PHP] HTTP_USER_AGENT?
I have this in my web site not in an executable folder:
<HTML> <HEAD> <TITLE>My First PHP Program</TITLE> </HEAD> <BODY> <?php echo "Hello World!"; ?> </BODY> </HTML>
No problem. I then put this in the same folder:
<HTML> <HEAD> <TITLE>My Second PHP Program</TITLE> </HEAD> <BODY> <?php echo $HTTP_USER_AGENT; ?> </BODY> </HTML>
Nothing appears. What's wrong?
-- George Hester _________________________________-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- text/plain attachment: Wipro_Disclaimer.txt
attached mail follows:
Try:
<? echo $_SERVER['HTTP_USER_AGENT']; ?>
... you might have a newer version of PHP (4.1+), which uses the global arrays like:
$_SERVER $_POST $_GET $_SESSION $_COOKIE
...
Justin French
on 11/07/02 12:32 PM, George Hester (hesterloli
hotmail.com) wrote:
> I have this in my web site not in an executable folder: > > <HTML> > <HEAD> > <TITLE>My First PHP Program</TITLE> > </HEAD> > <BODY> > <?php echo "Hello World!"; ?> > </BODY> > </HTML> > > No problem. I then put this in the same folder: > > <HTML> > <HEAD> > <TITLE>My Second PHP Program</TITLE> > </HEAD> > <BODY> > <?php echo $HTTP_USER_AGENT; ?> > </BODY> > </HTML> > > Nothing appears. What's wrong? > > > -- > George Hester > _________________________________ > >
attached mail follows:
I wish I could say the same. Thanks.
-- George Hester _________________________________ "Balaji Ankem" <balaji.ankemwipro.com> wrote in message news:005901c22883$f22d5840$0c03910a
wipro.com... > It is working fine for me!!! > > > -----Original Message----- > From: George Hester [mailto:hesterloli
hotmail.com] > Sent: Thursday, July 11, 2002 8:03 AM > To: php-general
lists.php.net > Subject: [PHP] HTTP_USER_AGENT? > > > I have this in my web site not in an executable folder: > > <HTML> > <HEAD> > <TITLE>My First PHP Program</TITLE> > </HEAD> > <BODY> > <?php echo "Hello World!"; ?> > </BODY> > </HTML> > > No problem. I then put this in the same folder: > > <HTML> > <HEAD> > <TITLE>My Second PHP Program</TITLE> > </HEAD> > <BODY> > <?php echo $HTTP_USER_AGENT; ?> > </BODY> > </HTML> > > Nothing appears. What's wrong? > > > -- > George Hester > _________________________________ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Have you tried $_SERVER["HTTP_USER_AGENT"]
---------------------------------------------------------------------------
Chris Kay
Technical Support - Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102
Platinum Channel Partner of the Year - Request DSL - Broadband for Business
---------------------------------------------------------------------------
> -----Original Message-----
> From: George Hester [mailto:hesterloli
hotmail.com]
> Sent: Thursday, 11 July 2002 1:18 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] HTTP_USER_AGENT?
>
>
> I wish I could say the same. Thanks.
>
> --
> George Hester
> _________________________________
> "Balaji Ankem" <balaji.ankem
wipro.com> wrote in message
news:005901c22883$f22d5840$0c03910a
wipro.com...
> It is working fine for me!!!
>
>
> -----Original Message-----
> From: George Hester [mailto:hesterloli
hotmail.com]
> Sent: Thursday, July 11, 2002 8:03 AM
> To: php-general
lists.php.net
> Subject: [PHP] HTTP_USER_AGENT?
>
>
> I have this in my web site not in an executable folder:
>
> <HTML>
> <HEAD>
> <TITLE>My First PHP Program</TITLE>
> </HEAD>
> <BODY>
> <?php echo "Hello World!"; ?>
> </BODY>
> </HTML>
>
> No problem. I then put this in the same folder:
>
> <HTML>
> <HEAD>
> <TITLE>My Second PHP Program</TITLE>
> </HEAD>
> <BODY>
> <?php echo $HTTP_USER_AGENT; ?>
> </BODY>
> </HTML>
>
> Nothing appears. What's wrong?
>
>
> --
> George Hester
> _________________________________
>
>
>
> --
> 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:
It works for you because you have register_globals set to "on" in php.ini. If you set it to "off" it won't work any longer.
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Thu, 11 Jul 2002 08:07:48 +0530 "Balaji Ankem" <balaji.ankem
wipro.com> wrote:
> It is working fine for me!!! > > > -----Original Message----- > From: George Hester [mailto:hesterloli
hotmail.com] > Sent: Thursday, July 11, 2002 8:03 AM > To: php-general
lists.php.net > Subject: [PHP] HTTP_USER_AGENT? > > > I have this in my web site not in an executable folder: > > <HTML> > <HEAD> > <TITLE>My First PHP Program</TITLE> > </HEAD> > <BODY> > <?php echo "Hello World!"; ?> > </BODY> > </HTML> > > No problem. I then put this in the same folder: > > <HTML> > <HEAD> > <TITLE>My Second PHP Program</TITLE> > </HEAD> > <BODY> > <?php echo $HTTP_USER_AGENT; ?> > </BODY> > </HTML> > > Nothing appears. What's wrong? > > > -- > George Hester > _________________________________ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Yes..That is right!!! :-)
-----Original Message-----
From: Tyler Longren [mailto:tyler
captainjack.com]
Sent: Thursday, July 11, 2002 8:53 AM
To: Balaji Ankem
Cc: php-general
lists.php.net
Subject: Re: [PHP] HTTP_USER_AGENT?
It works for you because you have register_globals set to "on" in php.ini. If you set it to "off" it won't work any longer.
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Thu, 11 Jul 2002 08:07:48 +0530 "Balaji Ankem" <balaji.ankem
wipro.com> wrote:
> It is working fine for me!!! > > > -----Original Message----- > From: George Hester [mailto:hesterloli
hotmail.com] > Sent: Thursday, July 11, 2002 8:03 AM > To: php-general
lists.php.net > Subject: [PHP] HTTP_USER_AGENT? > > > I have this in my web site not in an executable folder: > > <HTML> > <HEAD> > <TITLE>My First PHP Program</TITLE> > </HEAD> > <BODY> > <?php echo "Hello World!"; ?> > </BODY> > </HTML> > > No problem. I then put this in the same folder: > > <HTML> > <HEAD> > <TITLE>My Second PHP Program</TITLE> > </HEAD> > <BODY> > <?php echo $HTTP_USER_AGENT; ?> > </BODY> > </HTML> > > Nothing appears. What's wrong? > > > -- > George Hester > _________________________________ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Thanks that worked just fine. But now I am irritated as hell. Obviously there is no backwards compatibility with new releases. Does this mean if I install a new version of PHP then all books published before that date are worthless? Seems so.
For example in a book discussing PHP 3 it says:
<? phpinfo(); ?>
This works just fine. In a book that discusses PHP 4 it says:
<? php_info() ?>
This gives "Fatal error: Call to undefined function: php_info() in c:\inetpub\wwwroot\php\phpinfo.php on line 2."
So it's not just backwards compatibility it is careless planning. This is not good. I will have to search hi and lo to determine if a failure is due to incorrect syntax because of version and not just careless typing on my part.
I remember when FORTRAN was being developed we were assurred that all previous commands from older versions would continue operative in the new. FORTRAN 77 to FORTRAN 90. I think the developers of PHP ought to consider why the developers of FORTRAN thought that might be a good thing to do. It is still used to this day. Write a FORTRAN 77 prog and it will compile and run on a FORTRAN 90 compiler out of the box. Thanks again.
-- George Hester _________________________________ "Justin French" <justinindent.com.au> wrote in message news:B9532D6D.A2C5%justin
indent.com.au... > Try: > > <? echo $_SERVER['HTTP_USER_AGENT']; ?> > > ... you might have a newer version of PHP (4.1+), which uses the global > arrays like: > > $_SERVER > $_POST > $_GET > $_SESSION > $_COOKIE > > ... > > > Justin French > > > > > on 11/07/02 12:32 PM, George Hester (hesterloli
hotmail.com) wrote: > > > I have this in my web site not in an executable folder: > > > > <HTML> > > <HEAD> > > <TITLE>My First PHP Program</TITLE> > > </HEAD> > > <BODY> > > <?php echo "Hello World!"; ?> > > </BODY> > > </HTML> > > > > No problem. I then put this in the same folder: > > > > <HTML> > > <HEAD> > > <TITLE>My Second PHP Program</TITLE> > > </HEAD> > > <BODY> > > <?php echo $HTTP_USER_AGENT; ?> > > </BODY> > > </HTML> > > > > Nothing appears. What's wrong? > > > > > > -- > > George Hester > > _________________________________ > > > > >
attached mail follows:
I use <? phpinfo(); ?> in both php3 and php4 and it works fine.
All the commands that I have used are all forward compatible. I even have some php2 code that still works in php4!
Martin
-----Original Message-----
From: George Hester [mailto:hesterloli
hotmail.com]
Sent: Thursday, July 11, 2002 1:41 PM
To: php-general
lists.php.net
Subject: Re: [PHP] HTTP_USER_AGENT?
Thanks that worked just fine. But now I am irritated as hell. Obviously there is no backwards compatibility with new releases. Does this mean if I install a new version of PHP then all books published before that date are worthless? Seems so.
For example in a book discussing PHP 3 it says:
<? phpinfo(); ?>
This works just fine. In a book that discusses PHP 4 it says:
<? php_info() ?>
This gives "Fatal error: Call to undefined function: php_info() in c:\inetpub\wwwroot\php\phpinfo.php on line 2."
So it's not just backwards compatibility it is careless planning. This is not good. I will have to search hi and lo to determine if a failure is due to incorrect syntax because of version and not just careless typing on my part.
I remember when FORTRAN was being developed we were assurred that all previous commands from older versions would continue operative in the new. FORTRAN 77 to FORTRAN 90. I think the developers of PHP ought to consider why the developers of FORTRAN thought that might be a good thing to do. It is still used to this day. Write a FORTRAN 77 prog and it will compile and run on a FORTRAN 90 compiler out of the box. Thanks again.
-- George Hester _________________________________ "Justin French" <justinindent.com.au> wrote in message news:B9532D6D.A2C5%justin
indent.com.au... > Try: > > <? echo $_SERVER['HTTP_USER_AGENT']; ?> > > ... you might have a newer version of PHP (4.1+), which uses the global > arrays like: > > $_SERVER > $_POST > $_GET > $_SESSION > $_COOKIE > > ... > > > Justin French > > > > > on 11/07/02 12:32 PM, George Hester (hesterloli
hotmail.com) wrote: > > > I have this in my web site not in an executable folder: > > > > <HTML> > > <HEAD> > > <TITLE>My First PHP Program</TITLE> > > </HEAD> > > <BODY> > > <?php echo "Hello World!"; ?> > > </BODY> > > </HTML> > > > > No problem. I then put this in the same folder: > > > > <HTML> > > <HEAD> > > <TITLE>My Second PHP Program</TITLE> > > </HEAD> > > <BODY> > > <?php echo $HTTP_USER_AGENT; ?> > > </BODY> > > </HTML> > > > > Nothing appears. What's wrong? > > > > > > -- > > George Hester > > _________________________________ > > > > >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
PHP tries very hard to remain BC, in fact, some will say too hard :) The register_globals change was the biggest change in PHP history, can't think of any other change that comes close. And, that only changed the default value for this directive, you can turn it on if you wish.
The PHP 4 book that you have has a typo, there simply is no php_info().
Regards, Philip Olson
On Wed, 10 Jul 2002, George Hester wrote:
> Thanks that worked just fine. But now I am irritated as hell. Obviously there
> is no backwards compatibility with new releases. Does this mean if I install a
> new version of PHP then all books published before that date are worthless?
> Seems so.
>
> For example in a book discussing PHP 3 it says:
>
> <?
> phpinfo();
> ?>
>
> This works just fine. In a book that discusses PHP 4 it says:
>
> <?
> php_info()
> ?>
>
> This gives "Fatal error: Call to undefined function: php_info() in
> c:\inetpub\wwwroot\php\phpinfo.php on line 2."
>
> So it's not just backwards compatibility it is careless planning. This is not
> good. I will have to search hi and lo to determine if a failure is due to
> incorrect syntax because of version and not just careless typing on my part.
>
> I remember when FORTRAN was being developed we were assurred that all previous
> commands from older versions would continue operative in the new. FORTRAN 77
> to FORTRAN 90. I think the developers of PHP ought to consider why the
> developers of FORTRAN thought that might be a good thing to do. It is still
> used to this day. Write a FORTRAN 77 prog and it will compile and run on a
> FORTRAN 90 compiler out of the box. Thanks again.
>
> --
> George Hester
> _________________________________
> "Justin French" <justin
indent.com.au> wrote in message
> news:B9532D6D.A2C5%justin
indent.com.au...
> > Try:
> >
> > <? echo $_SERVER['HTTP_USER_AGENT']; ?>
> >
> > ... you might have a newer version of PHP (4.1+), which uses the global
> > arrays like:
> >
> > $_SERVER
> > $_POST
> > $_GET
> > $_SESSION
> > $_COOKIE
> >
> > ...
> >
> >
> > Justin French
> >
> >
> >
> >
> > on 11/07/02 12:32 PM, George Hester (hesterloli
hotmail.com) wrote:
> >
> > > I have this in my web site not in an executable folder:
> > >
> > > <HTML>
> > > <HEAD>
> > > <TITLE>My First PHP Program</TITLE>
> > > </HEAD>
> > > <BODY>
> > > <?php echo "Hello World!"; ?>
> > > </BODY>
> > > </HTML>
> > >
> > > No problem. I then put this in the same folder:
> > >
> > > <HTML>
> > > <HEAD>
> > > <TITLE>My Second PHP Program</TITLE>
> > > </HEAD>
> > > <BODY>
> > > <?php echo $HTTP_USER_AGENT; ?>
> > > </BODY>
> > > </HTML>
> > >
> > > Nothing appears. What's wrong?
> > >
> > >
> > > --
> > > George Hester
> > > _________________________________
> > >
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
That "clever guy" is my brother, so I know what buttons to push.
I actually got the ability to be able to edit files through my scripts, so it does work. Thanks for the help/input!
"Alberto Serra" <albertoserra
gala.net> wrote in message
news:3D2BD4FB.3090205
gala.net...
> Привет!
>
> Chris Earle wrote:
> > Thank you for the reply (I don't speak or read Russian if that's what
that
> > other stuff is).
> It is, but it's nothing more than "hello" and my signature, so you did
> not miss any basic content :)
>
> > I forgot to mention that the server is a Win2k server with
> > IIS 5 running. Obviously I'm not the server admin (otherwise I would be
> > using Apache).
> Dunno. Never had that running myself. BUt as far as I can remember Ms
> security should be directory based. So the guy actually *might* allow
> you writing somewhere if you can convince him that it would show how
> clever he is ;)
>
> > I hope that I can get permissions, but I bet you're right. Probably
just
> > have to create a database, which I planned on doing (and know how to).
I
> > really did want to use XML though, oh well.
>
> Besides, sooner or later you might need to just log events out to a flat
> file, right?
>
> пока
> Альберто
> Киев
>
>
>
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
>
> LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
> lOrD i'M sHiNiNg...
> YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is.......
>
attached mail follows:
I don't have time to actually make the function for you, but I know it could be easily done with a single function and a double for loop, which could go through an two-dimensional array of the questions (first element), answers (next group except last), and the right answer (last element).
basically:
$ArrCount = count($Question);
for ($Counter = 0; $Counter < $ArrCount; $Counter++) { $Que = $Question[$Counter][0]; $SecArrCount = count($Question[$Counter]); // SecArrCount should be the number equal to the last element (answer) ?><SCRIPT LANGUAGE="Javascript">function CheckAnswer() {var RightAnswer = $Question[$Counter][$SecArrCount]; }</SCRIPT><? for ($AnsCount = 1; $AnsCount < SecArrCount; $AnsCount++): ?><!--Write the HTML code with the PHP variables ($Question[$Counter][$AnsCount]) placed where they're needed--><? endfor; $AnsCount++; }
The other loop would then generate a table row kind of like this:
<TR..><..TD> <SCRIPT LANGUAGE="Javascript"...> function CheckAnswer(str) { var Answer = <?=$Question[$Counter][$LastElementNum]?> if ( } </SCRIPT...> $Question[$Counter][0]<..BR..><INPUT.. onChange="CheckAnswer(this.value)"> or <SELECT..><options... onClick="CheckAnswer(this.value)"></SELECT..></TD..></TR..>
I didn't check to see if any of that stuff worked, but it should give you a basic idea of what I mean.
In response to one of your e-mails to me (for some reason I cannot send e-mail right now, but I can post in here): <RE: [PHP] Generating word documents based on fields in a browser>
I would think so, and with all of the functions with PHP it might be easier.
I had some trouble making up a template language in ASP, but in PHP it would be quite easy because of the vast amount of built-in functions. You might be able to fiddle with the exec(); function to start up programs on a Windows server, but don't take my word for it.
"Henning Sittler" <Henning
inscriber.com> wrote in message
news:FBA86B8BA4D6D411BC2A0002B323D39A019408D4
MAIL2...
> Speaking of forms, and I'm sure lots have asked this before me, but anyone
> know anywhere I can go to see some examples or existing code for
> automatically generating and and validating dynamic forms?
>
> Wait though, I'm already doing this myself. To explain further, what I
> really want is an abstract set of php functions to say, ok, I want another
> form with say 10 questions, and I want to define each question and set of
> possible answers (input types and ranges) manually, and have the action
> script automatically check that the input types and ranges for each
question
> are valid.
attached mail follows:
I've been trying to tweak my sendmail_path to work with some batch emails I have to sent out[1]. What'd like to do is set within a virtual site in httpd.conf:
php_admin_value sendmail_path = "/usr/sbin/sendmail -t -oQ/var/spool/mqueue_batch -ODeliveryMode=q"
Problem is when I do this, my emails go in to oblivion. I've tried other paths/options like "/usr/sbin/sendmail -oi -t -odq" and it works just fine. I've tested my path in a perl script so I'm sure it's correct; I'm sure my permissions are correct...any ideas?
--Ricky
[1] It's not spam. Honest!
attached mail follows:
Can you just use the built-in mail function?
mail("chris
earleweb.com", "Errors", $ObjectGET->EMAIL, // doesn't have to
be an object
"From: errorresponse
earleweb.com\n"
."Reply-To: chris
earleweb.com\n"
."X-Mailer: PHP/" . phpversion());
"Ricky Dhatt" <ricky
electricarrow.com> wrote in message
news:20020711031950.93564.qmail
pb1.pair.com...
> I've been trying to tweak my sendmail_path to work with some batch emails
I
> have to sent out[1]. What'd like to do is set within a virtual site in
> httpd.conf:
>
> php_admin_value sendmail_path =
> "/usr/sbin/sendmail -t -oQ/var/spool/mqueue_batch -ODeliveryMode=q"
>
> Problem is when I do this, my emails go in to oblivion. I've tried other
> paths/options like "/usr/sbin/sendmail -oi -t -odq" and it works just
fine.
> I've tested my path in a perl script so I'm sure it's correct; I'm sure my
> permissions are correct...any ideas?
>
>
> --Ricky
>
> [1] It's not spam. Honest!
>
>
attached mail follows:
I was wondering if there was a function that would allow me to "jump" to a certain line if a file and then write from there? I'm searching php.net without any luck :(.
Also, if there is not specific function, is there a trick that gives the same effect (without reading the entire file line by line, then writing to it where I need to, then replacing the file)?
Thanks in advance (hopefully :)).
attached mail follows:
I dodn't know of any single function that does what you want, but you can do this:
$contents = file($filename); // each line has it's own array position $contents[$line] = $newline; $content = implode("\n", $contents); $f = fopen($filename, "w"); fputs($f, $content); fclose($f);
(not tested, but should work as is) some error checking would also be good.... :)
-----Original Message-----
From: Chris Earle [mailto:chris
earleweb.com]
Sent: Thursday, July 11, 2002 2:10 PM
To: php-general
lists.php.net
Subject: [PHP] Editing files by line
I was wondering if there was a function that would allow me to "jump" to a certain line if a file and then write from there? I'm searching php.net without any luck :(.
Also, if there is not specific function, is there a trick that gives the same effect (without reading the entire file line by line, then writing to it where I need to, then replacing the file)?
Thanks in advance (hopefully :)).
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
That's what I was talking about :). I wish there was something built in that would just let me append a file where I want, that would make things a little easier. Oh well, thanks a lot for the help that makes sense (and I think it works).
"Martin Towell" <martin.towell
world.net> wrote in message
news:6416776FCC55D511BC4E0090274EFEF508A5FD
EXCHANGE...
> I dodn't know of any single function that does what you want, but you can
do
> this:
>
> $contents = file($filename); // each line has it's own array position
> $contents[$line] = $newline;
> $content = implode("\n", $contents);
> $f = fopen($filename, "w");
> fputs($f, $content);
> fclose($f);
>
>
> (not tested, but should work as is) some error checking would also be
> good.... :)
>
> -----Original Message-----
> From: Chris Earle [mailto:chris
earleweb.com]
> Sent: Thursday, July 11, 2002 2:10 PM
> To: php-general
lists.php.net
> Subject: [PHP] Editing files by line
>
>
> I was wondering if there was a function that would allow me to "jump" to a
> certain line if a file and then write from there? I'm searching php.net
> without any luck :(.
>
> Also, if there is not specific function, is there a trick that gives the
> same effect (without reading the entire file line by line, then writing to
> it where I need to, then replacing the file)?
>
> Thanks in advance (hopefully :)).
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Thu, Jul 11, 2002 at 02:11:30PM +1000, Martin Towell wrote:
>> From: Chris Earle [mailto:chris
earleweb.com]
>>
>> I was wondering if there was a function that would allow me to "jump"
>> to a certain line if a file and then write from there? I'm searching
>> php.net without any luck :(.
>
> I dodn't know of any single function that does what you want, but you can do
> this:
>
> $contents = file($filename); // each line has it's own array position
> $contents[$line] = $newline;
That's nice, except you could start overwriting existing data.
If you're only interested in appending to the end of a file, then use $fp = fopen('filename', 'a+'); and fputs() all you want.
But, if you want to stick stuff into the middle...
# Real process uses file(), # but for test, set Content manually. $Content[] = 'The start of the content array.'; $Content[] = 'Some more stuff.'; $Content[] = 'And yet more stuff.';
$Location = array_search('Some more stuff.', $Content);
$New[] = 'Why, here is some new stuff';
$Final = array_merge( array_slice($Content, 0, $Location + 1), $New, array_slice($Content, 0 - (count($Content) - $Location - 1)) );
# In your process, you'll really want to insert # implode('', $Final) into the file with fputs(), # but, hey, this is a demonstration. print_r($Final);
--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:
On Wed, Jul 10, 2002 at 12:45:01PM -0400, Chris Earle wrote: > I'm just curious if there's a function that allows you to see how many lines > there are in a file.
I don't recall there being one. Simple way:
$Array = file('file.name'); echo count($Array);
--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:
or use the unix command "wc"
$num_lines = `wc -l $file`;
Martin
-----Original Message-----
From: Analysis & Solutions [mailto:danielc
analysisandsolutions.com]
Sent: Thursday, July 11, 2002 2:13 PM
To: PHP List
Subject: Re: [PHP] Appending to a file
On Wed, Jul 10, 2002 at 12:45:01PM -0400, Chris Earle wrote: > I'm just curious if there's a function that allows you to see how many lines > there are in a file.
I don't recall there being one. Simple way:
$Array = file('file.name'); echo count($Array);
--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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thanks again for this response. The computer is a Win2k server.
Thanks for the tips. :)
"Martin Towell" <martin.towell
world.net> wrote in message
news:6416776FCC55D511BC4E0090274EFEF508A5FE
EXCHANGE...
> or use the unix command "wc"
>
> $num_lines = `wc -l $file`;
>
> Martin
>
> -----Original Message-----
> From: Analysis & Solutions [mailto:danielc
analysisandsolutions.com]
> Sent: Thursday, July 11, 2002 2:13 PM
> To: PHP List
> Subject: Re: [PHP] Appending to a file
>
>
> On Wed, Jul 10, 2002 at 12:45:01PM -0400, Chris Earle wrote:
> > I'm just curious if there's a function that allows you to see how many
> lines
> > there are in a file.
>
> I don't recall there being one. Simple way:
>
> $Array = file('file.name');
> echo count($Array);
>
> --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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Wed, Jul 10, 2002 at 11:14:51AM -0600, CM wrote: > Are there any php scripts or classes that do Automatic Form Creation? If it > worked from a MySQL datbase that would be a plus.
Check out my SQL Solution class: http://www.sqlsolution.info/
Makes it really easy to generate dynamic form elements (among other things) from a MySQL or ODBC database. It'll even select/check default elements for you or your users specify.
--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:
On Wed, Jul 10, 2002 at 12:25:08PM -0500, Rw wrote: > > "01-02-2003" > > Is there a handy function to convert that to other ways of expressing the > date such as: > > "01/02/03"
$temp = preg_replace('/^(\d{2})-(\d{2})-(\d{2})(\d{2})$/', '\\1/\\2/\\4', $date);
> "2003-01-02"
$temp = preg_replace('/^(\d{2})-(\d{2})-(\d{4})$/', '\\3/\\1/\\2', $date);
It's also a good idea to do a test to make sure the initial date is in the format you expect it to be:
if ($temp == $date) { echo 'WAIT a second... Your initial date was bad.'; }
--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:
MySQL Error : Database Error Error Number: 1050 Table 'book_auth' already exists ------------------------------------------------------------------------ what this meant? what should i do for correct this thaank you for your help
sincerly your -- tjandra
====================================================================== This email is confidential and may also be privileged. If you are not the intended recipient, please notify me immediately and delete the original message. You should not copy or use it for any other purpose, nor disclose its contents to any other person. Thank you.
attached mail follows:
From: "Peter" <php
vfsa.com.au>
To: <aromania
aromania.com>, <php-general
lists.php.net>
Date: Thu, 11 Jul 2002 14:50:40 +1000
Message-ID: <DPEPKCNEFOKBCNNANCIPAEELCFAA.php
vfsa.com.au>
MIME-Version: 1.0
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: base64
Subject: RE: [PHP] need help about this
bWVhbnMgdGhlIHRhYmxlIHVyIHRyeWluZyB0byBjcmVhdGUgYWxyZWFkeSBpcyB0aGVyZS4uLiBp ZiB1IGRvbid0IHdhbnQgdG8ga2VlcCB0aGUgdGFibGUgZG8gYSBEUk9QIHRhYmxhZW5hbWUgaW4g bXlzcWwgb3IgaWYgbm90ICB0aGVuIGNoYW5nZSB0aGUgbmFtZSBvZiB0aGUgdGFibGUgeW91IGFy ZSB0cnlpbmcgdG8gY3JlYXRlDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJv bTogYXJvbWFuaWFAYXJvbWFuaWEuY29tIFttYWlsdG86YXJvbWFuaWFAYXJvbWFuaWEuY29tXQ0K PiBTZW50OiBUaHVyc2RheSwgMTEgSnVseSAyMDAyIDQ6NTIgUE0NCj4gVG86IHBocC1nZW5lcmFs QGxpc3RzLnBocC5uZXQNCj4gU3ViamVjdDogW1BIUF0gbmVlZCBoZWxwIGFib3V0IHRoaXMNCj4g SW1wb3J0YW5jZTogSGlnaA0KPiANCj4gDQo+IE15U1FMIEVycm9yIDogRGF0YWJhc2UgRXJyb3IN Cj4gRXJyb3IgTnVtYmVyOiAxMDUwIFRhYmxlICdib29rX2F1dGgnIGFscmVhZHkgZXhpc3RzDQo+ ICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tDQo+IHdoYXQgdGhpcyBtZWFudD8NCj4gd2hhdCBzaG91bGQgaSBk byBmb3IgY29ycmVjdCB0aGlzDQo+IHRoYWFuayB5b3UgZm9yIHlvdXIgaGVscA0KPiANCj4gc2lu Y2VybHkgeW91cg0KPiAtLSB0amFuZHJhDQo+IA0KPiANCj4gPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiBUaGlz IGVtYWlsIGlzIGNvbmZpZGVudGlhbCBhbmQgbWF5IGFsc28gYmUgcHJpdmlsZWdlZC4NCj4gSWYg eW91IGFyZSBub3QgdGhlIGludGVuZGVkIHJlY2lwaWVudCwgcGxlYXNlIG5vdGlmeSBtZSBpbW1l ZGlhdGVseSBhbmQNCj4gZGVsZXRlIHRoZSBvcmlnaW5hbCBtZXNzYWdlLiAgWW91IHNob3VsZCBu b3QgY29weSBvciB1c2UgaXQgZm9yIGFueQ0KPiBvdGhlciBwdXJwb3NlLCBub3IgZGlzY2xvc2Ug aXRzDQo+IGNvbnRlbnRzIHRvIGFueSBvdGhlciBwZXJzb24uICBUaGFuayB5b3UuDQo+IA0KPiA=
attached mail follows:
"Table 'book_auth' already exists" means that you're trying to create the 'book_auth' table again, even though it already exists. Remove the old 'book_auth' table to create the new one.
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Thu, 11 Jul 2002 13:51:43 +0700 aromania
aromania.com wrote:
> MySQL Error : Database Error > Error Number: 1050 Table 'book_auth' already exists > ------------------------------------------------------------------- > ----- > what this meant? > what should i do for correct this > thaank you for your help > > sincerly your > -- tjandra > > > ====================================================================== > This email is confidential and may also be privileged. > If you are not the intended recipient, please notify me immediately > and delete the original message. You should not copy or use it for > any other purpose, nor disclose its > contents to any other person. Thank you. > >
attached mail follows:
You are creating a table which already exists. The easy way to get out of this, is either create a table with a different name or drop the existing table and re-create it.
Cheers, Sachin.
-----Original Message-----
From: aromania
aromania.com [mailto:aromania
aromania.com]
Sent: Thursday, July 11, 2002 12:22 PM
To: php-general
lists.php.net
Subject: [PHP] need help about this
Importance: High
MySQL Error : Database Error Error Number: 1050 Table 'book_auth' already exists ------------------------------------------------------------------------ what this meant? what should i do for correct this thaank you for your help
sincerly your -- tjandra
====================================================================== This email is confidential and may also be privileged. If you are not the intended recipient, please notify me immediately and delete the original message. You should not copy or use it for any other purpose, nor disclose its contents to any other person. Thank you.
attached mail follows:
How are you getting this error?
Are you trying to create the table?
aromania
aromania.com wrote: MySQL Error : Database Error
Error Number: 1050 Table 'book_auth' already exists
------------------------------------------------------------------------
what this meant?
what should i do for correct this
thaank you for your help
sincerly your -- tjandra
====================================================================== This email is confidential and may also be privileged. If you are not the intended recipient, please notify me immediately and delete the original message. You should not copy or use it for any other purpose, nor disclose its contents to any other person. Thank you.
--------------------------------- Do You Yahoo!? New! SBC Yahoo! Dial - 1st Month Free & unlimited access
attached mail follows:
To: php-general
lists.php.net
Date: Thu, 11 Jul 2002 00:54:54 -0400
From: Monty <monty3
hotmail.com>
Message-ID: <B95287DE.10FF0%monty3
hotmail.com>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
Subject: Breaking Dynamic Content into Pages...
I'm trying to determine the best way to break dynamic content into pages before flowing into a template (with "1|2|3" type paging icons at the bottom of the page). I considered using a user-defined type code like "[pagebreak]" that would allow content contributors to determine the page breaks themselves when entering the article into the database. A parsing function would grab the chunk of text/html between the appropriate [pagebreak] codes for each page.
But this just doesn't seem a very elegant solution. Anyone know of a better way to do this?
Thanks!
Monty
attached mail follows:
Thanks guys....it's work now.....
On Wednesday 10 July 2002 04:39 pm, Chris Hewitt wrote:
> Yamin,
>
> You probably chose not to install bison or flex when you installed
> RedHat. They are on your CDs.
>
> HTH
> Chris
>
> Yamin Prabudy wrote:
> >Hi guys,... In configure PHP 4.2.1 on RedHat 7.3 I found this problem
> >checking for ranlib... ranlib
> >checking whether ln -s works... yes
> >checking for gawk... (cached) gawk
> >checking for bison... no
> >checking for byacc... no
> >configure: warning: You will need bison if you want to regenerate the PHP
> >parsers.
> >checking for flex... lex
> >checking for yywrap in -ll... no
> >checking lex output file root... ./configure: lex: command not found
> >configure: error: cannot find output from lex; giving up
> >[yamin
dusak php-4.2.1]$
> >
> >what's wrong with it ???
> >
> >thanks in advance
> >
> >Yamin
attached mail follows:
I'm driving myself crazy trying to visualize what I want to do, so I thought I'd share the insanity and hope for some advice.
I have this nice piece of code to take my SQL result and organize it into a nice 5 column table:
print "<center><table width=\"100%\" border=\"0\">\n"; //start table
$i=0; //define variable - avoid errors $grad_year=""; //define variable - avoid errors
while ($row = mysql_fetch_array($sql)) { extract($row); $i++;
if($i=="1") { print "<tr>\n"; //start table row on $i = 1 }
printf("<td align=\"center\"><a href=\"year.asp?year=%s\">%s</a><br></td>\n", $grad_year, $grad_year); //print links
if ($i=="5") { print "</tr>\n"; //end table row on $i = 5 to get 5 columns $i=0; //reset $i }
$grad_year=""; //clear $grad_year
}
if ($i<5) print "</tr>\n"; //end any rows with less than 5 columns
print "</table></center><p>\n"; //end table -------------------END------------------------
Now, this works great for most things - it takes my SQL results and puts them in a table sequentially, from left to right, top to bottom. So in this case, the top-left cell displays "1941", the top-right cell displays "1945", the next row starts with "1946" on the left and goes to "1950" on the right, and so on.
What I want is rather than sorting left to right, top to bottom, I want to sort top to bottom, left to right. So the top-left would still be "1941", but rather than increasing to the right, it would increase down, then continue at the top of the next column.
I'm thinking this might be an easy thing to do with some creative use of $i and print, but I just can't think it out. I'm guessing $i would be used to limit the amount of items in a column... But, I'm in need of some guidance to get it right. I can't even begin to think where to start. Any help would be great - thanks!
Jason Soza
attached mail follows:
Jason:
On Wed, Jul 10, 2002 at 10:04:45PM -0800, Jason Soza wrote: > > I have this nice piece of code to take my SQL result and organize it into a > nice 5 column table:
Nice is in the eye of the beholder... Here's what I think is nice:
echo "<table width=\"100%\" border=\"0\" align=\"center\">\n"; echo " <tr>\n";
while ($row = mysql_fetch_array($sql, MYSQL_ASSOC)) { echo ' <td align="center"><a href="year.asp?year='; echo $row['grad_year'] . '">' . $row['grad_year'] . "</a></td>\n"; }
echo " </tr>\n"; echo "</table>\n\n";
If you want to reverse the order, use an ORDER BY clause in your query string.
--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
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]