[PHP] Evaluate PHP var in stored sql statement?

2003-01-24 Thread CF High
Hey all. I need to find out how to get PHP to evaluate a PHP variable stored in our MySql database. Currently the variable is being read as a string; i.e. select * from table where column = $myrow[0] -- instead of evaluating $myrow[0] as a variable. The SQL statement is retrieved in the first

[PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread CF High
Hey all. Don't know if this is possible, but here goes: I've got a simple switch statement that carries out one of several operations based on the switch statement variable value. Each operation has @ 50 lines of html -- do I have to echo or print all this html!? I'm new to PHP so pardon my

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread CF High
$somevar){ case 'case1': ? some html some html some html ?php break; case 'case2': ? some html some html some html ?php break; } ? CF High wrote: Hey all. Don't know if this is possible, but here goes: I've got a simple switch statement that carries out one of several op

[PHP] Combine 3 MySql rows into one PHP output row ?

2003-01-26 Thread CF High
Hey all. I'm a recent PHP convert (coming from Cold Fusion).. Here's the deal: I've got a table that contains hockey game result info; for each goal scored I record the goal scorer ID (i.e. their Jersey Number), and assist1 and assist2 IDs if applicable. When I output the game box

[PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup

2003-01-29 Thread CF High
Hey all. This driving me nuts: I've got Apache, MySql, and Windows 2000 running on my local machine. In order to get passed php variables evaluated, whether via a url query string, or through a form post, I have to use this syntax: $_REQUEST[$my_passed_variable] I have no such problem with

[PHP] Need to set default parameter || How to do in PHP?

2003-02-01 Thread CF High
Hey all. In cold fusion I was able to define a default value with the cfparam name = test default = myValue tag When I passed the variable test via a form or query string, it would over ride the parameter value. How can I do this in PHP? I looked in PHP manual for param, default, etc., but

[PHP] addslashes() || Why the multiple slashes?

2003-09-09 Thread CF High
Hey All. Simple ? why does PHP add 3 slashes to the following var: $apostrophe = I've got an apostrophe; $slashed = addslashes($apostrophe); echo $slashed; Result: I\\\'ve got an apostrophe. What's up with that -- why not just add a single backslash? --Noah -- -- PHP General Mailing

[PHP] count() numerical arrays....

2003-09-09 Thread CF High
Hey all. Another simple, yet baffling for me, question: I have a comma delimited list of numbers; e.g. $num_list = 1,2,3,4 I split the number list to array -- $num_list_array = split(, $num_list) I then count the number of elements -- $count = count($num_list_array); I do not get 4 for

[PHP] Web server file perms || More than I can chew.....

2003-09-19 Thread CF High
Hey all. Got a problem with a site builder app I've spent three months developing. On my local machine (win2k pro, apache), no problems -- everything works just as designed. Today I began testing on the live server; i.e. my client's hosting company (linux, apache 1.3.27, php 4.3.1) -- that's

Re: [PHP] Web server file perms || More than I can chew.....

2003-09-19 Thread CF High
Thanks for the informative post, Lowell Marek. Our host suggested chmod-ing necessary directories via ftp. Completely defeats the purpose of my app which is supposed to allow the client to maintain the site themselves; not have me mess around with directory/file perms -- ugggh In any

[PHP] fopen() || Execute read file as php page; not plain text

2003-09-19 Thread CF High
Any ideas here? was able to use an absolute reference on my local machine to execute read file contents; e.g. fopen('http://www.mysite.com/index.php', 'a'), but on the host webserver no such luck. Administrator said I can only use relative paths. Problem is, when I use a relative path, I just

Re: [PHP] fopen() || Execute read file as php page; not plain text

2003-09-19 Thread CF High
Hey Jay. Yes, the file is php code. Um, why not use include()? I'm ashamed, and very pleased, to admit that I had no idea I could set a var = to an include file! Well, one learns something new each day, often with much head banging ;--) Thanks for clueing me in. --Noah Jay

Re: [PHP] fopen() || Execute read file as php page; not plain text

2003-09-19 Thread CF High
Hm.. Looks like I was deluding myself. The only data returned by setting a var = include $include_path, is 0 or 1. I'm looking for a few hundred lines of evaluated text. Back to the drawing board. Christ, this is a pain in the. --Noah Jay Blanchard [EMAIL PROTECTED] wrote in

Re: [PHP] fopen() || Execute read file as php page; not plain text

2003-09-19 Thread CF High
Because I need to write $include_path content to file; not display it in the browser... --Noah Andu [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 19 Sep 2003 17:05:47 -0700 CF High [EMAIL PROTECTED] wrote: Hm.. Looks like I was deluding myself. The only

Re: [PHP] fopen() || Execute read file as php page; not plain text

2003-09-19 Thread CF High
Could you explain what you mean by: Then you're not INCLUDEing it inline to the source --Noah Roger B.A. Klorese [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Because I need to write $include_path content to file; not display it in the browser... Then you're not

Re: [PHP] fopen() || Execute read file as php page; not plain text

2003-09-19 Thread CF High
file to be executed. Got help from a PHP guru -- he suggested shell access --Noah Andu [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 19 Sep 2003 18:20:01 -0700 CF High [EMAIL PROTECTED] wrote: Because I need to write $include_path content to file; not display

[PHP] session_start() || shell access problem......

2003-09-20 Thread CF High
Hey all. I'm running a script from the command-line php interpreter as follows: (thanks to D. Souza for lead) $text = `usr/local/bin/php /path/to/my/php/page.php`; within the read file I want to enable sessions, so I session_start() at the top of the page: ? session_start(); ? ? code to

Re: [PHP] session_start() || shell access problem......

2003-09-20 Thread CF High
shell access issues. --Noah Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sat, 2003-09-20 at 15:46, CF High wrote: Hey all. I'm running a script from the command-line php interpreter as follows: (thanks to D. Souza for lead) $text = `usr/local/bin/php /path

Re: [PHP] session_start() || shell access problem......

2003-09-21 Thread CF High
ideas? --Noah Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sessions don't work on command line and that is how you run your script - from command line. CF High wrote: Hey Robert. Indeed, hard to find the problem. I don't believe it's a whitespace issue

Re: [PHP] session_start() || shell access problem......

2003-09-21 Thread CF High
(DOCUMENT_ROOT=$inc_path); That does the trick for what I need done now; namely, being able to include files within my command line executed files. Still, there must be a way to pass params to command line executed files.. --Noah Cf High [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED

Re: Re[2]: [PHP] session_start() || shell access problem......

2003-09-21 Thread CF High
to be processed CH in command line). CH Any ideas? CH --Noah CH Marek Kilimajer [EMAIL PROTECTED] wrote in message CH news:[EMAIL PROTECTED] Sessions don't work on command line and that is how you run your script - from command line. CF High wrote: Hey Robert. Indeed

[PHP] Trouble with fopen() || Win2k Machine

2003-06-06 Thread CF High
Hey all. Quick question here that's driving me up the wall: Using fopen(), I'm easily able to open files for reading; however, when I attempt to open files for writing using fopen($file_path, W+), an error occurs. I'm able to use fopen($file_path, a+), but I need to be able to overwrite files;

[PHP] Re: Trouble with fopen() || Win2k Machine

2003-06-06 Thread CF High
the file path on windows. In any case, thanks for the idea -- it's a step in the right direction, --Noah Ptker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If the file is binary, try fopen($file_path, wb); Cf High [EMAIL PROTECTED] ~{P4HkO{OPBNE~} :[EMAIL PROTECTED] Hey all

Re: [PHP] Re: Trouble with fopen() || Win2k Machine

2003-06-06 Thread CF High
Ah, well that's a useful bit of info ;--) Didn't run across that in php.net's description of fopen() Thanks, Jason -- I'll switch to relative paths.. --Noah Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Saturday 07 June 2003 03:25, CF High wrote: Still

[PHP] strip_tags() Quandry....

2003-05-27 Thread CF High
Hey all. I've got a chunk of HTML text I'd like to format for insertion into our mySql db. Let's say $html_string equals the following: tr td1/td tdBardo, Jesse/td tdS/td tdA/td tdAndover, MA/td /tr To setup this chunk of text for insertion I first use

Re: [PHP] strip_tags() Quandry....

2003-05-30 Thread CF High
again, --Noah Justin French [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] on 28/05/03 2:56 PM, CF High ([EMAIL PROTECTED]) wrote: I've got a chunk of HTML text I'd like to format for insertion into our mySql db. Let's say $html_string equals the following: tr td1/td

[PHP] Generating Static Pages || Preserve PHP Code?

2003-06-10 Thread CF High
Hey all. Interesting problem here, at least for me ;--): How to generate php pages using fopen() without having php code evaluated in the written pages? For example, if build_pages.php runs a db query and, based on the result set, produces a test page using fopen(), how to avoid having php code

[PHP] Single vs. Multiple DBs || Which way to go?

2003-02-08 Thread CF High
Hey all. I'm attempting to organize a sport report site into working order. We've got approximately 100 tables, and I'm unsure whether to break the info up by sport (i.e. baseball, basketball, hockey, etc.) or to lump all the tables in one db and prefix tables by their sport name (e.g.

[PHP] Alternating Row Colors in PHP........

2003-02-08 Thread CF High
Hey all. I'm coming from Cold Fusion to PHP; in CF I could alternate rows with the following: tr bgcolor=###Iif(((CurrentRow MOD 2) is 0),de('FF'),de('EE'))# Any ideas how to do this in PHP? Thanks for clues, --Noah -- -- PHP General Mailing List (http://www.php.net/) To

[PHP] Output yyyymmdd formatted date || 20030131 to FridayJanuary 31, 2003

2003-02-08 Thread CF High
Sorry for the frequent simple posts... I've been storing my dates in mmdd format (apparently this is a bad idea). In any case, I need to display this date format as [day name month name day #, year] e.g. Friday January 31, 2003. Any ideas? Thanks for any leads, --Noah -- --

[PHP] Why does this happen?

2003-02-08 Thread CF High
Hey all. Got a problem with I'm sure a simple solution:: In this test form when I submit and insert into my db, only the last select field get entered; i.e. in this case the day value of 25. form name=form1 method=post action= Year select name=date onSelect=return check_submit() option

Re: [PHP] Why does this happen?

2003-02-09 Thread CF High
Alright, alright, everyone, I could get away with this in Cold Fusion, but not in PHP. The simple example I gave is part of a more complex problem, however. Here's the deal: Let's say I have a form that requests the season schedule of a baseball team, and the team in question has twenty

Re: [PHP] Output yyyymmdd formatted date || 20030131 to FridayJanuary 31, 2003

2003-02-09 Thread CF High
Very nice John. I'm quickly learning the utility of MySql Date and Time objects. I used to have to write a ten line script to format the date; now, I can use this: SELECT DATE_FORMAT(mydate, '%a %M %d, %Y') and I'm done. Thanks a bunch for your help, John. I might even write an effiicient

[PHP] Sitewide Header Footer Includes || Trouble with Relative Paths..........

2003-02-22 Thread CF High
Hey All. Got a perhaps easy question here: How can I create a global header and footer include to my site pages where I don't rely on absolute paths to include and image files? I'm having trouble including my header and footer .inc's within a multi-level directory structure -- the relative

Re: [PHP] Sitewide Header Footer Includes || Trouble with Relative Paths..........

2003-02-22 Thread CF High
Hey Tom. Thanks for the idea; however, since we're not hosting the site on our own server, we don't have permissions for altering the php.ini file.. --Noah Tom Rogers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Sunday, February 23, 2003, 6:14:32 AM, you wrote: CH

Re: [PHP] Sitewide Header Footer Includes || Trouble with Relative Paths..........

2003-02-22 Thread CF High
($footer); ? my config.php has all my site includes and it allows me to dynamically change anything throughout the site in a matter of seconds. hope this helps. Sebastian - [BBR] Gaming Clan http://www.BroadBandReports.com - Original Message - From: CF High [EMAIL PROTECTED

[PHP] Why use persistent connections? || Data driven site

2003-02-22 Thread CF High
Hey all. We've got a site makes several queries to our MySql db in every site page. Should we be using persistent connections, or are we better off opening and closing connections on each query? Thanks for any leads, --Noah -- -- PHP General Mailing List (http://www.php.net/) To

[PHP] Efficient db connect function?

2003-02-23 Thread CF High
Hey all. I'm currently using the following db connection function, but I'm not sure if it's as efficient as it could be. function dbConnect($SQL) { global $result; // Connect to DB if (!$link = mysql_connect($db_host, $db_user, $db_pass)) { $result = 0;

[PHP] Output Numerical Month as String?

2003-02-25 Thread CF High
Hey all. Easy question here (can't find the answer in php manual) In Cold Fusion I'm able to format a given numerical month value, say the third month, as #MonthAsString(3)# and it returns March What's the equivalent in PHP? Thanks for any ideas.. --Noah -- -- PHP General

[PHP] $_POST arrays not evaluated in sql statement -- why?

2003-02-25 Thread CF High
Hey all. Got a problem with this sql statement -- php vars are evaluated (e.g. the $date var), but not the $_POST arrays.. All of the arrays return correct values -- What am I missing here? $sql = INSERT into rosters (school_id, sport_id, date, jersey_id, first, last, position, grade,

Re: [PHP] $_POST arrays not evaluated in sql statement -- why?

2003-02-25 Thread CF High
Hey John et. al I tried your method John, and it works! Re: excessive single quotes in the sql, but I tried stripping them out to no effect. Using curly braces in the sql statement wasn't an option I knew about. Thanks again for illuminating another bit of the PHP world.

[PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread CF High
Hey all. In Cold Fusion I was able to do the following: CFSWITCH expression = #action# CFCASE value = getUpdate,getDelete Do Stuff /CFCASE /CFSWITCH Note the comma delimited set of values for the case. Is there a way to do this in php?( i.e. if any of the comma

[PHP] Run db query with db query?

2003-03-03 Thread CF High
Hey all. Got a problem here: 1) I have a page that queries our db for info 2) Based on the # of rows returned I loop through to create a set of formfields for each customer 3) Within this loop I run another query to retrieve option elements for a particular category The problem is

[PHP] Re: Run db query with db query?

2003-03-03 Thread CF High
in to different result vars. I do this all the time with no problems. From: [EMAIL PROTECTED] (Cf High) Newsgroups: php.general Date: Mon, 3 Mar 2003 16:45:52 -0800 To: [EMAIL PROTECTED] Subject: Run db query with db query? Hey all. Got a problem here: 1) I have a page that queries

[PHP] Populate var with function output string?

2003-03-03 Thread CF High
Hey all. Is it possible to populate a var with an output string generated by a function? So: *** function write_string(count) { for ($x = 0; $x $count; $x++) { echo option value=$x Row $x/option; } } $my_string = write_string(5); echo

[PHP] Yarrrrgggghhhhh || Simplest php question in existence........

2003-03-03 Thread CF High
Hey all. Basic question here: How can I refer to a query result set as $result['field_name'] rather than $result[0]? So, I'm looking for ? echo $result['field_name'] ? -- just can't seem to get the right syntax. -- clueless -- -- PHP General Mailing List (http://www.php.net/) To

[PHP] md5 encrypt problem

2003-03-10 Thread CF High
Hey all. Having a wee bit o' trouble with a simple md5 script: for ($x=1 ; $x 62 ; $x++) { $mypass = sports . $x; $mypass = md5($mypass); dbConnect(UPDATE user_login SET password = '$mypass' WHERE school_id = $x); } For some reason, when I attempt to login with my md5'd

[PHP] Performance and Function Calls

2003-03-15 Thread CF High
Hey all. Quick question: If I have a function that, say, prints out the months in a year, and I call that function within a 10 cycle loop, which of the following is faster: 1) Have function months() return months as a string; set var string_months = months() outside of the loop; then echo

[PHP] PHP Processing Order || Function Calls

2003-03-18 Thread CF High
Hey all. I was under the impression that PHP processes all php code first before handing HTML processing over to the browser. It seems that if you call an external function that, say, queries your db for data and spits out populated formfields, the function is processed somehow simultaneously

Re: [PHP] PHP Processing Order || Function Calls

2003-03-18 Thread CF High
in message news:[EMAIL PROTECTED] CF High wrote: Hey all. I was under the impression that PHP processes all php code first before handing HTML processing over to the browser. http://www.php.net/manual/en/ref.outcontrol.php Erik -- PHP General Mailing List (http://www.php.net

[PHP] Detailed error message?

2003-03-21 Thread CF High
Hey all. I'm having a difficult time adjusting my php.ini file to display detailed error messages in my local testing environment. For example, when a query returns an error, I do not get the line # where the error occurred or really any info other than: Query not executed. Unknown column

Re: [PHP] Detailed error message?

2003-03-21 Thread CF High
to see it. Check http://www.php.net/manual/en/function.set-error-handler.php There's a whole section in the manual that deals with error handling in some detail. -Original Message- From: CF High [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2003 12:46 PM To: [EMAIL

[PHP] Code Design || Functions vs. Switch Statements

2003-03-21 Thread CF High
Hey all. I'm looking for guidance from any PHP Gurus, or gurus in the making re: whether to use a function based design or a switch statement based design for a multi-sport data driven sport report. Alright, here's the deal: Last year I developed a data driven hockey report for a friend -- the

[PHP] IE6 Session Problem

2003-11-28 Thread CF High
Hey all. Hope this will help someone hours of useless searching. Looks like out-of-the-box winXP machines running IE6 have session cookies automatically disabled! Ug, 24 hours slogging through newsgroups to stumble across this solution myself. If you have a login based site rely on

[PHP] Session Expiration Problem....

2003-12-03 Thread CF High
Hey all. Our hosting company sets session vars to expire every 15 minutes. I've setup an Admin Center for users to enter various types of information, some of which, for example entering a basketball team roster, can take slower users upwards of 25 minutes or more. The result? Admin user

Re: [PHP] Session Expiration Problem....

2003-12-04 Thread CF High
Hey Lowell. H, no, not a particularly elegeant solution, but it must work for you. I'm experimenting with ini_set('session.gc_maxlifetime', 4320); Don't know if this will extend the session timeout; i.e. garbage collection routine, I'm still testing it. A total drag that our host

[PHP] Object Oriented Programming Book(s)?

2003-12-26 Thread CF High
Hey all. I've got the O'Reilly Programming PHP PHP Cookbook PHP books -- excellent PHP Resources -- however, the OOP sections are rather short. I'm hoping to get my hands on a relatively in-depth OOP book. It doesn't look like there are any PHP specific OOP books out there yet, so any OOP

[PHP] Zlib Compression || Implementation || Bandwidth Savings?

2004-02-02 Thread CF High
Hey all. Having a good problem -- our hockey report site has jumped from 10 gigs/month to 30+ gigs/month growing. We're getting killed in bandwidth fees at the moment; barring switching to another host, will utilizing ZLIB compression significantly reduce bandwidth? Also, in terms of ZLIB

[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-02 Thread CF High
. will all content be automatically be compressed, or do I need to ob_start() ob_end_clean() at the start and end of each page? TIA for any clues -- I'm obviously confused about compression techniques. --Noah Rush [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Cf High [EMAIL

[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-03 Thread CF High
in message news:[EMAIL PROTECTED] if this works for you, could you please post your story in the group. this is very interesting if you could save 50% of your bandwidth just by turning the zlib flag :) good Luck, Ammar Cf High [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey all

[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-03 Thread CF High
My lord, this rocks! Our pages load at least twice as fast now, and bandwidth will likely be reduced by at least a factor of 2. I would strongly recommend utilizing zlib compression functions to anyone looking to speed page delivery reduce bandwidth! --Noah Rush [EMAIL PROTECTED] wrote in

[PHP] Re: Search Engines || Dynamic Content || Apache Mod_Rewrite....

2004-02-23 Thread CF High
Hey all. I've got a PHP-MySql database driven site setup in a shared hosting environment that does NOT support apache mod_rewrite. Is there a workaround for getting dynamic pages (e.g. index.php?display=contact) indexed in major search engines without using mod_rewrite? Any clues very much

[PHP] Re: PHP || MySql Directory Tree Problem......

2004-03-05 Thread CF High
Hey all. I've developed a site builder application that allows my clients to build/maintain their sites without my having to deal with tedious web design tasks. The current version has some problems, however. To resolve these issues I've switched over to an MVC (Model-View-Controller)

[PHP] Re: PHP || Create File (not upload) with ftp()?

2004-03-12 Thread CF High
Hey all. I've been having ownership issues when writing files with fwrite(); i.e. file owner is nobody while ftp'd files are owned by the site owner. In order to streamline file management, I'd like to be able to write files on our webhost server using PHP's ftp functions; not using fwrite() and

[PHP] PHP 4.2.3 || Can't unset $_SESSION!

2004-03-28 Thread CF High
Hey all. Strange problem here. I'm running on apache 1.3.26 php 4.2.3. In a test page, test1.php, I set $_SESSION['checker'] = 1; In another test page, test2.php, I unset($_SESSION['checker']); When I print_r($_SESSION) in test1.php, $_SESSION['checker'] is still set still equals 1! I've

[PHP] md5() with rand() || Strange results, need help....

2004-05-13 Thread CF High
Hey all. I'm running an online sport report that is member protected; i.e. users need to login to gain site access. When a new user signs up, I set their username to their email address generate a temporary password for them using rand() md5(): $username = strip_illegals($_POST['email']);

Re: [PHP] md5() with rand() || Strange results, need help....

2004-05-13 Thread CF High
PROTECTED] wrote in message news:[EMAIL PROTECTED] * Thus wrote CF High ([EMAIL PROTECTED]): $username = strip_illegals($_POST['email']); $plain_pass = rand(); $password = md5($plain_pass); I then insert their login info into our member's table. Unexpectedly, when users attempt to login

Re: [PHP] md5() with rand() || Strange results, need help....

2004-05-13 Thread CF High
fanatics are filling up my admin inbox. --Noah John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] CF High wrote: If anyone has any clues as to what might be happening; i.e. why the md5'd submitted plain text password does not match the stored md5'd password, please

Re: [PHP] md5() with rand() || Strange results, need help....

2004-05-13 Thread CF High
-- I know PHP is server side, but I'm looking for any clues --Noah John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] CF High wrote: If anyone has any clues as to what might be happening; i.e. why the md5'd submitted plain text password does not match the stored md5

Re: [PHP] md5() with rand() || Strange results, need help....

2004-05-14 Thread CF High
. Let us know what happens. cheers, Travis CF High wrote: Re: the browser track, it looks like all adversely affected users; i.e. those who can no longer log in, have a browser of I.E. 6.0. I know that in many cases I.E. 6.0 has session and cookie vars disabled by default