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
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
$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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
(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
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
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;
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
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
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
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
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
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.
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
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
--
--
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
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
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
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
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
($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
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
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;
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
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,
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
. 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
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
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
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
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)
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
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
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']);
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
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
-- 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
. 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
70 matches
Mail list logo