[PHP] Dumb Question - Casting

2010-02-18 Thread Chuck
Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad
rusty.

Can someone explain why the second expression in this code snippet evaluates
to 7 and not 8?

$a = (int) (0.1 +0.7);

echo $a\n;

$x = (int) ((0.1 + 0.7) * 10);

echo $x\n;

$y = (int) (8);

echo $y\n;


[PHP] How to prevent direct access..

2008-01-27 Thread Chuck
I have a php file that produces an image and is only referred to from
an img tag like so:

img src=getRandImage.php

I want to prevent anyone from directly accessing the getRandImage.php
file. The file has to be world readable or the image will not display.
I played around with testing $_SERVER['HTTP_REFERER'] using regular
expressions but the above image tag appears in the default splash page
and there is no http referer set when they first visit the site. (also
ran into some IE quirkiness as well) I played around with putting
getRandImage.php into a subdirectory that is only viewable by the user
the web server is running as and the image also would not appear. I
couldn't figure out a way to embed this into a function that could be
hidden in a non-world readable subdirectory -- which would be my
preferred approach. (Is there a way to call a php function that
returns an image from within an img tag, instead of calling a php
file?)

I can easily check http request type but the img tag is doing a GET
request which is also what request type is used if they try and
directly access the URL.

I'm sure its something simple I am overlooking. Maybe another $_SERVER
variable or something I can work with.

fyi: running php 5.2.5 and apache 2.2.

Thanks for any help..
/CC

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



Re: [PHP] Using mysql_real_escape_string without connecting to mysql

2008-01-23 Thread Chuck
On Jan 22, 2008 7:01 PM, Dotan Cohen [EMAIL PROTECTED] wrote:
 I have a file of my own functions that I include in many places. One
 of them uses mysql_real_escape_string, however, it may be called in a
 context that will or will not connect to a mysql server, and worse,
 may already be connected. So I must avoid connecting. However, when I
 run the script without connecting I get this error:

 Warning: mysql_real_escape_string()
 [function.mysql-real-escape-string]: Access denied for user:
 '[EMAIL PROTECTED]' (Using password: NO)

 I was thinking about checking if there is a connection, and if not
 then connecting. This seems redundant to me, however. What is the
 list's opinion of this situation? Thanks in advance.

 Dotan Cohen

 http://what-is-what.com
 http://gibberish.co.il
 א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

 A: Because it messes up the order in which people normally read text.
 Q: Why is top-posting such a bad thing?


Why not write a function that does the same thing?
mysql_real_escape_strings is a very simple function. And if your data
is properly normalized and you don't support other charsets its very
simple.


[PHP] Any way to use header() or another function to force user to top level

2008-01-12 Thread Chuck
I have some code doing some checks that sit inside div tags using href elements:
...
div class=pArea
a class=panel href=code.php?= target=pframe1 Panel1/a
...

In code.php, if various conditions aren't met, this script will do a
bunch of house cleaning, logging, then redirect using
header(Location: /some_url).

My problem is that /some_url comes up inside the div area, instead of
causing the browser to load /some_url as if accessed directly.  Im
just starting to dabble with PHP so I'm sure there is another way of
doing this or maybe an argument to header() itself.

I'm looking for the same behavior as the HTML snippet a href=/
target=_tophere/a

Once I make the call to header(), I no longer care about any state
information, session variables, or anything. Basically I am booting
the user out of the application and back to the login/splash page. All
information I need to retain has already been logged to various
mechanisms prior to calling header() which is immediately followed by
exit();

Thanks for any help,
CC

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



Re: [PHP] Any way to use header() or another function to force user to top level

2008-01-12 Thread Chuck
That is exactly what I am using now but the location I am redirecting
to is loading within the div tags and at the top level of the
browser.

-CC
On 1/12/08, Jim Lucas [EMAIL PROTECTED] wrote:
 Chuck wrote:
  I have some code doing some checks that sit inside div tags using href 
  elements:
  ...
  div class=pArea
  a class=panel href=code.php?= target=pframe1 
  Panel1/a
  ...
 
  In code.php, if various conditions aren't met, this script will do a
  bunch of house cleaning, logging, then redirect using
  header(Location: /some_url).
 
  My problem is that /some_url comes up inside the div area, instead of
  causing the browser to load /some_url as if accessed directly.  Im
  just starting to dabble with PHP so I'm sure there is another way of
  doing this or maybe an argument to header() itself.
 
  I'm looking for the same behavior as the HTML snippet a href=/
  target=_tophere/a
 
  Once I make the call to header(), I no longer care about any state
  information, session variables, or anything. Basically I am booting
  the user out of the application and back to the login/splash page. All
  information I need to retain has already been logged to various
  mechanisms prior to calling header() which is immediately followed by
  exit();
 
  Thanks for any help,
  CC
 

 Sounds like header() is what you are looking for then.

 The one thing that you have to make sure is that you have not sent any
 data to the browser.  Use this:

 ?php

 #
 #Do whatever you want here.  Just don't output any data to the browser.
 #

 header('Location: http://www.example.com/');
 exit;
 # Always follow a header/location redirect with the exit; command.

 ?

 I have found that it is best to include the entire domain when using the
 header/location redirect method.




-- 
Chuck Carson - Sr. Software Engineer
Galileo Educational Solutions

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



[PHP] setup help in IIS6

2007-09-18 Thread Chuck Chidekel

Hello,

I have installed the latest PHP on my windows server 2003 IIS6 machine. From 
the DOS command line interface (when in the C:\PHP directory) if I type PHP 
phpinfo.php, the file runs. However I cannot get it to work on the browser 
on the server our out on the web using my URL. I'm sure it's just an II6 
issue, but what am I doing wrong?


Thanks! 


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



[PHP] Where can I get the Printer extension?

2007-01-17 Thread Chuck Anderson
It thought it would be bundled with my Windows version pf Php 4.4.1, but 
it is not.


I've searched for it and can't find it at php.net.

How do get a copy of php_printer.dll for Php4.4.1 for Windows?

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



Re: [PHP] Where can I get the Printer extension?

2007-01-17 Thread Chuck Anderson

Chris wrote:

Chuck Anderson wrote:
  
It thought it would be bundled with my Windows version pf Php 4.4.1, but 
it is not.


I've searched for it and can't find it at php.net.



You didn't search very hard.
  



On this page:

http://php.net/printer

Read the bit under Installation.

This PECL extension is not bundled with PHP.

and

You may obtain this unbundled PECL extension from the various PECL 
snaps pages (select the appropriate repository for your version of PHP): 
PECL for PHP 4.3.x, PECL for PHP 5.0.x  or PECL Unstable.


  


I did look there.  I did read that.

You didn't try those links, though, did you?  (Not Found)

(btw,  I asked in another group and just found that it is located 
here: http://pecl4win.php.net/index.php)


I don't see how to get there from the main PECL site, but there it is.

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



[PHP] Re: Havn't been on the list in a while

2006-12-13 Thread Chuck Anderson

Jim Lucas wrote:

Seems like this list has slowed down alot.

Anybody else notice this, or am I just missing something?

jl
  


If you're referring to what I think you are  yes . I get almost 
nothing but timeouts when trying to do anything in this newsgroup.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



[PHP] Re: Havn't been on the list in a while

2006-12-13 Thread Chuck Anderson

Jim Lucas wrote:

Seems like this list has slowed down alot.

Anybody else notice this, or am I just missing something?

jl
  


If you're referring to what I think you are  yes . I get almost 
nothing but timeouts when trying to do anything in this newsgroup.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



Re: [PHP] Re: news.php.net times out - unreachable for days

2006-12-11 Thread Chuck Anderson

Lester Caine wrote:

Chuck Anderson wrote:
  
In the time it takes to write a message, I lose my connection and often 
cannot even connect to send it.


I'm hurrying this time, so I hope it works.

( not that time . timed out . I'll try Sending again)



When I was forced to use the newsgroup interface I often had that 
problem, and I was complaining that I could not get eMails working :(


I've been running on emails for a while now after some kind fairy lifted 
the blocking of my email addresses, but I'm still using the newsgroup 
interface for a couple of php.net lists and nothing has changed there.


  


It was not like this until about two or three weeks ago.  Prior to that 
it behaved like any other news server I connect to (it simply connected 
... right away).  Something has changed or broken.


(... It took three tries just to get this composition window to open 
with quoted material)


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



Re: [PHP] Re: news.php.net times out - unreachable for days

2006-12-11 Thread Chuck Anderson

Lester Caine wrote:

Chuck Anderson wrote:
  
In the time it takes to write a message, I lose my connection and often 
cannot even connect to send it.


I'm hurrying this time, so I hope it works.

( not that time . timed out . I'll try Sending again)



When I was forced to use the newsgroup interface I often had that 
problem, and I was complaining that I could not get eMails working :(


I've been running on emails for a while now after some kind fairy lifted 
the blocking of my email addresses, but I'm still using the newsgroup 
interface for a couple of php.net lists and nothing has changed there.


  


It was not like this until about two or three weeks ago.  Prior to that 
it behaved like any other news server I connect to (it simply connected 
... right away).  Something has changed or broken.


(... It took three tries just to get this composition window to open 
with quoted material)


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



[PHP] news.php.net times out - unreachable for days

2006-12-07 Thread Chuck Anderson
It's probably been well over a week or even two.  I can no longer 
connect to php.net through Thunderbird (as I have been doing daily for 
many months).  It always times out.  I'll be lucky if this post even 
makes it.  I saw some other posts indicating that I am not alone.


Something NEEDS to be fixed.

I'll just have to keep trying to connect every day and hope something 
changes.  As of now, das ist kaput!


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



[PHP] news.php.net times out - unreachable for days

2006-12-07 Thread Chuck Anderson
It's actually been well over a week or even two.  I can no longer 
connect to php.net with Thunderbird (as I have been doing daily for many 
months - news.php.net - port 119).  It always times out.  I'll be lucky 
if this post even makes it.  I got connected briefly yesterday and saw 
some other posts indicating that I am not alone.


Something NEEDS to be fixed.

I'll just have to keep trying to connect every day and hope something 
changes. 


As of now, das ist kaput!

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



[PHP] Re: Newsgroup connect time has become very long

2006-12-06 Thread Chuck Anderson

Al wrote:
Anyone having problems connecting the last few days? Or, is there something 
wrong on my end. All other sites are working just fine.


Thanks.
  


Same here. The group has become nearly unusable. I've been ignoring it 
for days as most of the time I get a timeout - from Thunderbird - 
connecting to news.php.net.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



[PHP] Re: Newsgroup connect time has become very long

2006-12-06 Thread Chuck Anderson

Al wrote:
Anyone having problems connecting the last few days? Or, is there something 
wrong on my end. All other sites are working just fine.


Thanks.
  


Same here. The group has become nearly unusable. I've been ignoring it 
for days as most of the time I get a timeout - from Thunderbird - 
connecting to news.php.net.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



[PHP] worst sites / standard format

2006-10-19 Thread Chuck Stearns

hey, check out the bar on the side of the ones with main.html.

http://www.997thelake.com/main.html
http://www.cool929fm.com/main.html
http://www.star933.com/
http://www.wzzo.com/main.html
http://www.929nin.com/main.html

guess we have our work cut out for us, eh?  we need to find a distinct, 
unarguable value for this product, and i believe that it's the fact that 
the link redistributes to amazon, whereas there is a greater value if 
they can sell the songs themselves.


problem is, what agreement dot hey have with amazon?

anyway, that's what i found.

later

/cs

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



Re: [PHP] worst sites / standard format

2006-10-19 Thread Chuck Stearns
shoot, sorry guys, i was working on an email to a buddy, and didn't 
realize i was still on my newsgroup program til it was too late... 
won't happen again...


/cs

Skip Evans wrote:

Me thinks Chuckie boy here is spamming our list and needs to get booted.

Sorry, Chuckie, only the best tasting tuna get to be Starkist.

Skip

Ed Lazor wrote:
Sorry, how does this relate to PHP?  It seems like you're just trying  
to get us to visit your sites to bump up traffic.



On Oct 19, 2006, at 8:44 AM, Chuck Stearns wrote:


hey, check out the bar on the side of the ones with main.html.

http://www.997thelake.com/main.html
http://www.cool929fm.com/main.html
http://www.star933.com/
http://www.wzzo.com/main.html
http://www.929nin.com/main.html

guess we have our work cut out for us, eh?  we need to find a  
distinct, unarguable value for this product, and i believe that  it's 
the fact that the link redistributes to amazon, whereas there  is a 
greater value if they can sell the songs themselves.


problem is, what agreement dot hey have with amazon?

anyway, that's what i found.

later

/cs

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



[PHP] Re: pop-up window in php???

2006-06-08 Thread Chuck Anderson

Michelle Konzack wrote:

Am 2006-05-29 11:56:43, schrieb [EMAIL PROTECTED]:
  

ok, maybe I didn't make my question too clear. I was mostly wondering
if there
is a way to do it in PHP rather than Javascript. I would prefer only
using php.



Maybe it can be done, like,

1)  Client fill out a form
2)  Client klick the Submit Button
3)  The php script on the server get the data
and store it temporary
4)  The php script on the server send back a HTML page
which open a new (popup) window with the question
5)  Client must confirm
6)  The php script on the server get the confirmation
and do something wit the previously sored data

Greetings
Michelle Konzack


  
You can not specify the window parameters (a popup) without using 
Javascript.


You are correct, tough. You could load a new page asking them to confirm 
(I do this a lot with scripts that delete something - are you sure?), 
but not in a popup window.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*

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



Re: [PHP] Help with enter key in Forms

2006-06-01 Thread Chuck Anderson

Chris wrote:

George Babichev wrote:
  

Hello everyone, I am programming a blog, and most of it is done, except I
have one issue. When I am typing in the form (before I click submit) and I
click the neter key to make a space, the MySQL database does not recognize
that space. How do I make it recognize it?



Unless you're stripping it out, it will recognise it. View HTML Source 
and you'll see the newline is actually in there. A \n is not a html 
newline so you need to convert it.


What you want is http://php.net/nl2br

  

Uhhh  did you try this -- nl2br?

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*

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



[PHP] Re: User confirmation questions?

2006-05-05 Thread Chuck Anderson

William Stokes wrote:


Hello,

In PHP is it possible to generate windows style question boxes and get the 
users choice back? Or do I need javascript or something else for that?


For example if a user hits a button in form I could ask for his confirmation 
for the action. Like Do you Really wan't to drop the whole database? Yes 
or No. And perform or cancel the action by user's decision.


-Will
 

It's not what you want to do (popup window), but I do it in the 
following often.


I put the question right on the page - using a form. The form reloads 
the page on submit and my script checks for the submit value at the top 
of the page. If the form was submitted it either performs the action or 
not - based on the submitted values.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: Session contamination?

2006-04-20 Thread Chuck Anderson
This has been a very interesting discussion, as I have had the same 
problem, but never thought much about the fact that I could do 
anything about it.


As to session save path, when I run phpinfo (at my remote Linux server) 
it tells me that it is set to no value. This means it would default to 
/tmp. Where is this tmp directory? I have looked at the tmp directory 
that is one level above my site's www directory (outside of the web 
space), but I do not see any session data there. That's why I am asking 
if it is a system wide directory, or is it the one in my home directory.


If I set the path myself, what would be a good location? (I assume it 
should be outside the web space). Should I make up some random folder 
name (one time) and story my session data within that directory, within 
my own home directory?


Ben Liu wrote:


Hello All,

I'm using a single development server to host multiple client
projects, many of which require session management. I've noticed that
sometimes when I test these various web apps (which are simply in
separate sub directories) I get session leakage where logging in and
establishing a session on one app allows me access to (automatically
logs me in) to other app(s) on the same server. Or sometimes a session
variable will be set across all the apps, like $_SESSION['username'].

Is this due to the fact that sessions are established between client
browsers and servers, regardless of directory/sub directory?

What is the best way to avoid/prevent this problem? Should I be using
specific Session ID's or Session names?

Thanks for any help,

- Ben
 




--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: phpMyAdmin--resetting auto increments to 0

2006-04-16 Thread Chuck Anderson

alex wrote:


hi everyone

i have delete a few entries in my database as they were entered for testing 
purposes and are no longer need (actually 102 entries)... and even thought 
that db is empty i noticed that when the next entry went in the id number 
went to 103
not 0 so i was wondering is it possible to somehow reset the value to 
zero...


it is of int type and auto_increment

i have a few db's which id like to reset to zero i have tried placing a zero 
enrty after deleting the lot but it only jumps to  its next increment.

does anyone know what i mean...?
any help will be grateful
regards alex 
 


On a related note (he did say PhpMyAdmin) ...

ALTER TABLE 'tablename' auto_increment=n works, but I can't get 
PhpMyAdmin to reset the auto_increment through the Operations menu page.


If I go to the Operations tab for a table and set the auto_increment 
value to something less that it currently is, PhpMyAdmin will not honor 
my request and re-specifies the current auto_increment value in the 
ALTER TABLE command (even though my requested value is valid).


Is this because of a config setting? I could have sworn earlier versions 
would obey my request.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



Re: [PHP] Re: phpMyAdmin--resetting auto increments to 0

2006-04-16 Thread Chuck Anderson

tedd wrote:


At 1:42 PM -0600 4/16/06, Chuck Anderson wrote:
 


alex wrote:

   


hi everyone

i have delete a few entries in my database as they were entered for 
testing purposes and are no longer need (actually 102 entries)... 
and even thought that db is empty i noticed that when the next 
entry went in the id number went to 103

not 0 so i was wondering is it possible to somehow reset the value to zero...

it is of int type and auto_increment

i have a few db's which id like to reset to zero i have tried 
placing a zero enrty after deleting the lot but it only jumps to 
its next increment.

does anyone know what i mean...?
any help will be grateful
regards alex
 


On a related note (he did say PhpMyAdmin) ...

ALTER TABLE 'tablename' auto_increment=n works, but I can't get 
PhpMyAdmin to reset the auto_increment through the Operations menu 
page.


If I go to the Operations tab for a table and set the auto_increment 
value to something less that it currently is, PhpMyAdmin will not 
honor my request and re-specifies the current auto_increment value 
in the ALTER TABLE command (even though my requested value is valid).


Is this because of a config setting? I could have sworn earlier 
versions would obey my request.
   



Chuck:

This always works for me in PhpMyAdmin (I mistyped it before).

1. Delete the first record.
2. Reset the auto_increment in Operations to whatever you want.
3. Insert a record.
4. Delete that record.

After that, the next record will start at the new auto_increment 
value. Don't ask why, that's just the way it works.


tedd
 

That would work, except that I want to change the auto_increment without 
deleting the first record.


During testing I may add many entries to the end of an existing database 
table. When I am done testing I want to delete those extraneous 
entries (leaving the earlier entries intact). Call me 
obsessive/compulsive or whatever, but I like to knock the auto_increment 
value back down to the next valid value (what was the first test value).


PhpMyAdmin refuses to use the valid auto_increment value I specify in 
Operations and I have to edit the query to set it right.



--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



Re: [PHP] Re: phpMyAdmin--resetting auto increments to 0

2006-04-16 Thread Chuck Anderson

tedd wrote:


At 3:01 PM -0600 4/16/06, Chuck Anderson wrote:
 


tedd wrote:

   


At 1:42 PM -0600 4/16/06, Chuck Anderson wrote:

 


alex wrote:

 

   


hi everyone

i have delete a few entries in my database as they were entered 
for testing purposes and are no longer need (actually 102 
entries)... and even thought that db is empty i noticed that when 
the next entry went in the id number went to 103
not 0 so i was wondering is it possible to somehow reset the 
value to zero...


it is of int type and auto_increment

i have a few db's which id like to reset to zero i have tried 
placing a zero enrty after deleting the lot but it only jumps to 
its next increment.

does anyone know what i mean...?
any help will be grateful
regards alex
   

 


On a related note (he did say PhpMyAdmin) ...

ALTER TABLE 'tablename' auto_increment=n works, but I can't get 
PhpMyAdmin to reset the auto_increment through the Operations menu 
page.


If I go to the Operations tab for a table and set the 
auto_increment value to something less that it currently is, 
PhpMyAdmin will not honor my request and re-specifies the current 
auto_increment value in the ALTER TABLE command (even though my 
requested value is valid).


Is this because of a config setting? I could have sworn earlier 
versions would obey my request.
 

   


Chuck:

This always works for me in PhpMyAdmin (I mistyped it before).

1. Delete the first record.
2. Reset the auto_increment in Operations to whatever you want.
3. Insert a record.
4. Delete that record.

After that, the next record will start at the new auto_increment 
value. Don't ask why, that's just the way it works.


tedd

 

That would work, except that I want to change the auto_increment 
without deleting the first record.


During testing I may add many entries to the end of an existing 
database table. When I am done testing I want to delete those 
extraneous entries (leaving the earlier entries intact). Call me 
obsessive/compulsive or whatever, but I like to knock the 
auto_increment value back down to the next valid value (what was the 
first test value).


PhpMyAdmin refuses to use the valid auto_increment value I specify 
in Operations and I have to edit the query to set it right.
   




Chuck:

Okay, then delete whatever record you want and reset the 
auto_increment value to that -- for example: Let's say you have 
records 0 - 100 that you want to keep. Then you added some test 
records that went from 101 to 150 and now you want to delete those 
records and start again at 101, right?


Simple, just:

1. Delete records 101-150.
2. Reset the auto_increment in Operations to 101
3. Insert a false record.
4. Delete that false record.

Now, your dB will be set to start at 101.

What's even more amazing (at least I've found), is that if you had 
0-100 records you wanted to keep and 101-150 you wanted to delete, 
but also had 151 to 200 you also wanted to keep, you could do what I 
said above and the auto_increment would fill up 101-150 and then jump 
to 201. It's neat the way it works. At least that's my memory. Try it.


tedd
 


I appreciate your help here . but 


2. Reset the auto_increment in Operations to 101

That's the part that PhpMyAdmin refuses to do. It will not alter it to 
less than 151 (per your example).


PhpMyAdmin 2.6.4-pl3

It's not much work to then edit the PhpMyAdmin query to my liking, but I 
don't think I used to have to do that.


I like your second part about filling in the between stuff. If I'm at 
that point, though, I delete the auto_increment field (sorting the table 
by date) and then add it back in. That fills all the gaps, too.


What I want to know is why PhpMyAdmin will not do your step 2. I swear 
that earlier versions would let me do that.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.


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



Re: [PHP] Re: phpMyAdmin--resetting auto increments to 0

2006-04-16 Thread Chuck Anderson

Jay Blanchard wrote:


[snip]
 


2. Reset the auto_increment in Operations to 101
   


[/snip]

This isn't another of those 'reseting the auto-increment' holy war
questions where you use the AI number as an identifier for the record,
is it? 
 


Nope. And I have no intention of taking it there.

I just get obsessive and thorough when testing and then I don't like 
stale data in my database - so I like to reset everything. It would be 
better to backup before testing and then restore. Resetting the AI just 
makes it the same as if you had.


And my real question is about PhpMyAdmin and why it no longer seems to 
let you reset the AI using the Operations page. At least it doesn't on 
my machine - Windows XP - Apache/2.0.55 - PhpMyAdmin 2.6.4-pl3.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



Re: [PHP] Best practice to set up register_globals

2006-03-17 Thread Chuck Anderson

Curt Zirzow wrote:


On Thu, Mar 16, 2006 at 08:46:07PM -0700, Nicolas Verhaeghe wrote:
 


One of my clients has an os commerce install which requires
register_globals to be set to on, for some reason.

It is set up to off in php.ini, as it should, but I'd like to know what
the best fashion would be for me to set it on locally for this domain
only.
   



Assuming you have apache as your webserver..

If you must set it, you can set it per any apache directive, like
a VirtualHost, Directory or the like or even a .htaccess (if
enabled).


Curt.
 

I'm not sure how they set it up, but at my web host I can put individual 
php.ini files in the directory the php script files are in.


That means that I can create a php.ini file and add 'register_globals 
on' in any directory where I need it.


Does anyone know how to configure that?

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: displaying documents stored under web root

2006-03-10 Thread Chuck Anderson

Adrian Bruce wrote:


Hi

After some advice (surprise!)

I currently store restricted documents beneath the web root so they are 
not accessible via the URL, when a valid user wishes to view a document 
i copy it to a temporary folder above the root and load it in a new 
page.  the only way i can then manage to delete the copy is 
automatically deleting all temp files when any user goes to the log out 
page.


This is obviously not a very good way of doing this but unless i can 
establish when a user is no longer viewing the doc then i dont know when 
to delete it.  I was wandering how others deal with these problems like this


any advice appreciated greatly

Ade
 

I deliver restricted PDFs that are kept *above* the web root without 
using a temporary file. Why do you need to create a temporary file? I 
use headers and readfile.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: array variables with or without quotes

2006-02-22 Thread Chuck Anderson

2dogs wrote:

I recently encountered a situation where I had to retrieve data from a MYSQL 
database table with a field named include. My code looked like this:


$content_result = mysql_query('SELECT * FROM calander') or 
die(mysql_error());

$content_row = mysql_fetch_array($content_result);
if ($content_row[include])
   {go do something;}

When I tried to run this, PHP treated the word  -include- as a control 
structure rather than an index name. Understandable. So, I put it in single 
quotes  ('include') to see what would happen and it works fine. But I don't 
understand why!


What is the difference between $content_row [include] and 
$content_row['include']? I have been unable to resolve this question in the 
php manual, I need enlightenment.


2dogs 
 


http://www.php.net/manual/en/language.types.array.php#language.types.array.foo-bar

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: image location hiding techniques

2006-02-08 Thread Chuck Anderson

hbeaumont hbeaumont wrote:


Hi,

I have a site with images that I want people to download but not have
the direct path to. ie. I do not want them to be able to just view the
source, find the dir and then download everything or direct link to
them.

However I can see no way to do this other than keeping the images on
disk, having a php script read them and then spit them out. example:

view.php?92348924  where 92348924  is a code that translates to the
image on disk.

Can anyone think of a better method? If not, what is the most
efficient way to do this (ie. avoid the most i/o)

Thanks!


P.S. I also realize I could use .htaccess to stop direct linking and
turn off directory indexes. Still I think there might be some other
problems with .htaccess
 

I know it's not exactly what you're asking for, but here's a great php 
based defense against hotlinking.


http://www.alistapart.com/articles/hotlinking/


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: exec php.exe in windows

2006-01-22 Thread Chuck Anderson

Dave Kennedy wrote:


Env:
Windows XP
PHP 4.3.10 (cgi-fcgi)

I am trying to capture the html output of Balance.php to a file:
The code loops over month and branch to build up a report in
export/Balance.html

exec('c:\php\php -q Balance.php export=all branch=branch month=month
login=admin password=admin  export/Balance.html');

This command works in Linux when called from a web page.
In Windows it works from the command line 
but from a web page it hangs - a cmd and php process are left running in

the Windows Task Manager

Any help would be greatly appreciated

 

Sounds similar to something I had going on. In Control Panel - 
Administrative Tools - Services (I don't know of a shorter way to get 
there), I had to right-click on the Apache service and under Log On - 
check Allow service to interact with desktop.


I run run Php as an Apache module, but you may want to give that a try.

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Upgrade to 4.4.2 shows as 4.4.1-pl-1 (Windows)

2006-01-20 Thread Chuck Anderson
I upgraded to 4.4.2, the Windows binary.  When I run phpinfo, the title 
says PHP Version 4.4.1-pl1 (my previous version).  However, under 
apache2handler, though, it says:

Apache/2.0.55 (Win32) mod_ssl/2.0.55 OpenSSL/0.9.8a PHP/4.4.2
(I run php as an Apache module on my home PC.)

Is there something wrong?

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: PHP 4.4.2 released!

2006-01-18 Thread Chuck Anderson

Derick Rethans wrote:


Hello!

The PHP Development Team would like to announce the immediate release of 
PHP 4.4.2. This is a maintenance release that addresses a number of 
minor security problems and fixes a few regressions that shown up in PHP 
4.4.1. All users of PHP 4 are recommended to upgrade to PHP 4.4.2.


A separate release announcement is also available. For changes in PHP 
4.4.2 since PHP 4.4.1, please consult the PHP 4 ChangeLog. 


Release Announcement: http://www.php.net/release_4_4_2.php
Downloads:http://www.php.net/downloads.php#v4
Changelog:http://www.php.net/ChangeLog-4.php#4.4.2

regards,
Derick
 

I just installed the Windows binary and phpinfo still displays PHP 
Version 4.4.1-pl1 (as does phpversion)


Under apache2handler, though, it says:
Apache/2.0.55 (Win32) mod_ssl/2.0.55 OpenSSL/0.9.8a PHP/4.4.2
(I run php as an apache module on my home PC.)

Have I done something wrong?

--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: Image editing?

2006-01-09 Thread Chuck Anderson

William Stokes wrote:


Hello,

I might have to start doing some automated image editing or rezising with 
PHP. I've never done anything like this before so I would need some 
guidelines to get started. Basically what sections of the manual to read and 
what tools need to be installed to the server side to get things like this 
done. Are there any websites about this issue, other than php.net, that 
might provide help to beginners? Thanks for your assistance!


-Will
 

Most photo images need some unsharp mask applied to crisp them back up 
after being resized. I found I needed ImageMagick to do the job right. 
If you are concerned about tweaking the quality of your final graphic, 
you might look into using it. It *is* installed on many servers. There 
is a Windows version you can install, too.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: Can't use secure file wrappers - Windows

2005-11-28 Thread Chuck Anderson

James Benson wrote:


Could use the xampp package or just the openssl  php from it,


http://www.apachefriends.org/en/xampp.html


Chuck Anderson wrote:
 

[I've had this posted in the php.windows group for a few days, but I got 
no replies there.]


I have been plugging away at this for some time now and I can not figure 
out how to get https and ftps as registered streams in my Windows 
installation of Php (4.4.0).  My direct need is to use fopen on secure 
URLs - https.


(I've installed openssl - enabled the Php openssl extension - and 
verified that my copy of Php was compiled with the openssl module.)


The latest thing I have read says that I need a special copy of 
php4ts.dll in order to enable secure streams (https, ftps) in Php on 
Windows (XP, in my case).


The posts I read point to copies of php4ts.dll for Php 4.3.4.

I am running Php 4.4.0.  Where can I find a copy of php4ts.dll for 
Php4.4.0 that enables secure streams?


(And is that really the solution in Php 4.4.0?)

Thanks in Advance
   

A followup: This is from a while back (two weeks ago), but I finally 
tried installing xampp. I installed it into c:\xampp and when I managed 
to get it working (independent of my other apache service) it did what I 
needed. I had https and ftps as registered streams. S ... I 
copied the php in xampp into c:\php and the apache dll files into my 
existing apache folder and ultimately made a real mess of things. Since 
I had backed everything up, I put it all back the way it was, 
uninstalled xampp, and to my surprise, I now have https and ftps streams 
registered in my previous installation. I'm glad I can finally access 
secure sites from my Php scripts, but I have no idea what is that I 
managed to change to allow it.


(I have a guess. With things mixed up a bit I started getting an error 
message I'd never seen before when starting Apache (with Php as a 
module). A search on Google for the error message ... Function 
registration failed - duplicate name  I got the advice to NOT 
register openssl in php.ini, if it was already statically linked in the 
binary. H. This may have been my problem earlier, but for 
some reason I was not seeing any error messages.)


Oh well. At least it's Apache 2.0.55 OpenSSL/0.9.8a and Php 4.4.1, so I 
shouldn't need to upgrade any time soon (other than to eventually try 
out Php 5).


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Re: php error message

2005-11-17 Thread Chuck Anderson

Ben wrote:


Edward Martin said the following on 11/17/2005 04:27 PM:

 


Warning: Cannot modify header information - headers already sent by
(output started at
/usr/home/ecmartin/public_html/ethics06/calendarlogin.php:8) in
/usr/home/ecmartin/public_html/ethics06/sas.php on line 34
   



It means you are trying to change the page's headers after they have 
already been sent to the user's browser. You are probably trying to use 
the header() function after HTML/Javascript/what have you has already 
been sent to the browser.  If you need to use header() you should write 
any earlier output to a variable and only output it to the browser after 
any header() function use.


- Ben
 

Most likely that is exactly what's happening. To be even more clear - 
the solution is to use the header function before any HTML (before *any* 
output). I learned this when I had an include file that was all Php 
causing this problem. The end of the included file had a carriage return 
after the closing tag ?. That was a nasty one to locate. Now I always 
make sure there is no white space after the closing tag in files I might 
include somewhere else.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



[PHP] Can't use secure file wrappers - Windows

2005-11-14 Thread Chuck Anderson

[I've had this posted in the php.windows group for a few days, but I got no 
replies there.]

I have been plugging away at this for some time now and I can not figure out 
how to get https and ftps as registered streams in my Windows installation of 
Php (4.4.0).  My direct need is to use fopen on secure URLs - https.

(I've installed openssl - enabled the Php openssl extension - and verified that 
my copy of Php was compiled with the openssl module.)

The latest thing I have read says that I need a special copy of 
php4ts.dll in order to enable secure streams (https, ftps) in Php on 
Windows (XP, in my case).


The posts I read point to copies of php4ts.dll for Php 4.3.4.

I am running Php 4.4.0.  Where can I find a copy of php4ts.dll for 
Php4.4.0 that enables secure streams?


(And is that really the solution in Php 4.4.0?)

Thanks in Advance

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



[PHP] Re: Can't use secure file wrappers - Windows

2005-11-14 Thread Chuck Anderson

James Benson wrote:


Could use the xampp package or just the openssl  php from it,


http://www.apachefriends.org/en/xampp.html

 

Hey thanks.  I may give that a try, but I already have two full apache 
servers loaded on my PC.  What I can't figure out is why these secure 
streams are not registered.  I seem to have done everything needed.


If I get some free time this week, I may install Xampp - see what happens.





Chuck Anderson wrote:
 

[I've had this posted in the php.windows group for a few days, but I got 
no replies there.]


I have been plugging away at this for some time now and I can not figure 
out how to get https and ftps as registered streams in my Windows 
installation of Php (4.4.0).  My direct need is to use fopen on secure 
URLs - https.


(I've installed openssl - enabled the Php openssl extension - and 
verified that my copy of Php was compiled with the openssl module.)


The latest thing I have read says that I need a special copy of 
php4ts.dll in order to enable secure streams (https, ftps) in Php on 
Windows (XP, in my case).


The posts I read point to copies of php4ts.dll for Php 4.3.4.

I am running Php 4.4.0.  Where can I find a copy of php4ts.dll for 
Php4.4.0 that enables secure streams?


(And is that really the solution in Php 4.4.0?)

Thanks in Advance
   



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



[PHP] ARG: Seg Faults with PHP 5.0.5, now on Solaris and SLES9

2005-10-10 Thread Chuck
After 3 months of headache and intermittent seg faults on Solaris 9, we
decided to give SLES 9 a try.

Now we get continuous seg faults.

I am running apache 2.0.54 on SLES 9 with all updates, and Oracle
10.2.0.1http://10.2.0.1.
(everything is the 32-bit flavor)

I built PHP as follows:
adcinfops02:/usr/local/httpd-2.0.54/htdocs #./configure
--prefix=/usr/local/php-5.0.5 --with-apxs2=/usr/local/httpd-2.0.54/bin/apxs
--enable-cli --enable-debug --with-config-file-path=/usr/local/php-5.0.5/lib
--enable-sigchild --with-zlib --with-bz2 --enable-ftp --with-gettext
--enable-mbstring --with-ncurses --with-oci8=/u01/app/oracle/product/10.2
--enable-session --enable-sockets --enable-shared --disable-xml
--disable-libxml --disable-dom --with-jpeg-dir=/usr/lib
--with-png-dir=/usr/lib --with-zlib-dir=/usr/lib --with-xpm-dir=/usr/lib
--disable-simplexml --without-pear

Here is the simply php page that seg faults _every_ time it is called. (On
solaris, it only seg faulted 25% of the time)
?php

putenv(ORACLE_HOME=/u01/app/oracle/product/10.2);
putenv(ORACLE_SID=ADCDM02);
putenv(TNS_ADMIN=/var/opt/oracle);


$ora = ociplogon(dm,mypassword, MYSID);

$stmt=OCIParse($ora, select USERNAME from dba_users);
$res=OCIExecute($stmt);

$rows = OCIFetchstatement($stmt, $results);

print DEBUG: rows=$rowsBR\n;

$keys = array_keys($results);
foreach($keys as $key)
{
print $keyBR\n;
}
for($i=0; $i  $rows; $i++)
{
print   . $results[USERNAME][$i] . BR\n;
}

OCIFreeStatement($stmt);
OCILogoff($ora);

?


I can run this script 100 times from the command line ( # php oratest.php )
and not a single seg fault.

Anyone have any idea why this is happenning?

Also, is there a config, any OS, any version, and combination AT ALL, where
PHP is reliable when using Oracle 10g as the back end? Any configuration at
all?

Thx,
CC
--


[PHP] Code broken after upgrading from Oracle 10.1.0.4 to 10.2.0.1

2005-09-28 Thread Chuck
After upgrading my database to 10.2 I get the following error when trying to
connect: (Using Solaris 9, Apache 2.0.54, and php 5.0.5)

*Warning*: ocilogon()
[function.ocilogonhttp://adcinfops01/function.ocilogon]:
_oci_open_server: Error while trying to retrieve text for error ORA-12154 in
*/usr/local/httpd-2.0.54/htdocs/oratest.php* on line *6*

*Warning*: ociparse(): supplied argument is not a valid OCI8-Connection
resource in */usr/local/httpd-2.0.54/htdocs/oratest.php* on line *8*

*Warning*: ociexecute(): supplied argument is not a valid OCI8-Statement
resource in */usr/local/httpd-2.0.54/htdocs/oratest.php* on line *9*

*Warning*: ocifetchstatement(): supplied argument is not a valid
OCI8-Statement resource in */usr/local/httpd-2.0.54/htdocs/oratest.php* on
line *11*
DEBUG: rows=

*Warning*: array_keys()
[function.array-keyshttp://adcinfops01/function.array-keys]:
The first argument should be an array in */usr/local/httpd-2.0.54
/htdocs/oratest.php* on line *15*

*Warning*: Invalid argument supplied for foreach() in */usr/local/httpd-
2.0.54/htdocs/oratest.php* on line *16*

*Warning*: ocifreestatement(): supplied argument is not a valid
OCI8-Statement resource in */usr/local/httpd-2.0.54/htdocs/oratest.php* on
line *25*


Everything is identical. (SID, dbname, etc)

Here is my listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = adcdm02)
(ORACLE_HOME = /u01/app/oracle/product/10.2)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = adcinfops01)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = DMKEY))
)
)
)

In tnsnames.ora:
ADCDM02 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
adcinfops01.mydomain.comhttp://adcinfops01.mydomain.com)(PORT
= 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = adcdm02.mydomain.com http://adcdm02.mydomain.com)
)
)

Here is a snippet of code I am trying:
putenv(ORACLE_SID=adcdm02);
putenv(ORACLE_HOME=/u01/app/oracle/product/10.2);

$ora = OCILogon(dm,password, ADCDM02);

$stmt=OCIParse($ora, select USERNAME from dba_users);
$res=OCIExecute($stmt);

Anyone have any ideas?
Thanks,
CC


[PHP] Error Handling

2005-09-09 Thread Chuck Brockman
What is a good way to capture errors that occur.  I've tried the
following code in development, but it still spits out an error (Parse
error: syntax error, unexpected '}', expecting ',' or ';' in
X:\\\.php on line 7)

?
// error handling test

try{
 $test = 1;
 echo $test1
}
catch (Exception $e) {
print Exception caught\n;
}
?

Thanks.

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



[PHP] Object Scope

2005-09-06 Thread Chuck Brockman
What is the best practice for calling objects that are to be used
throughout a users site visit.  For example, I have a members class
with two classes that extend this class.  Is it best to instantiate
the object in the $_Session scope or make individual calls to the
class/object.

For example:

class members {
var $iMemberID;
var $iProfileID;
var $dbServer;
var $dbUser;
var $dbPassword;
var $dbDSN;
var $_dbServer;
var $_dbUser;
var $_dbPassword;
var $_dbDSN;

function members($dbServer, $dbUser, $dbPassword, $dbDSN){
$this-_dbServer = $dbServer;
$this-_dbUser = $dbUser;
$this-_dbPassword = $dbPassword;
$this-_dbDSN = $dbDSN;
}
}

I have created a _global.php file that instantiates the object such as:

if(!isset($_SESSION[objMember])){
 $_SESSION[objMember] = new members($aSiteSettings[sDBServer],
$aSiteSettings[sDBLogin], $aSiteSettings[sDBPassword],
$aSiteSettings[sDSN]);
}

Or am I way off base altogether (wouldn't be too suprises)?

Thanks!

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



[PHP] Class/Function Query Call Problem

2005-07-21 Thread Chuck Brockman
I'm creating a psuedo mail/message app for users to send messages to
one another.  For this, I've created  a parent class,
class.members.php, and an extended class, class.mail.php.  The problem
I'm having is when I make page which calls the classes members and
memberMail creates an infite loop; however, if I bypass the classes
and do the mysqli functions directly on the page, I get the right
output. There is only one record in the database; fnGetMailCount()
produces one record and fnGetMail() using 'return $query-num_rows'
produces one record. I'm assuming there's something with my while
loop, but I've used
this method for other query output without issue.

One other note, I've also tested by removing all session variables and
hard coding values instead and received the same results.  Also, the
database variables are stored in an array in _global.php which is
included in the output page.

I apologize if these are basic questions, but while I'm learning, I
would prefer to learn properly instead of coding a bunch of junk just
for the sake of getting it done quickly (please let me know if I'm
heading down that path).

Under class.members.php I've created the constructor to initialize the
database vars.

class members {
  var $iMemberID;
  var $iProfileID;
  var $_iMemberID;
  var $_iProfileID;
  var $mysqli;
  var $query;

function members($dbServer, $dbUser, $dbPassword,$dbDSN){
  $this-_dbServer = $dbServer;
  $this-_dbUser = $dbUser;
  $this-_dbPassword = $dbPassword;
  $this-_dbDSN = $dbDSN;
}
 [...]
}


Under class.mail.php I've extended members():

class memberMail extends members {
var $iMailID;

function memberMail(){
  parent::members();
}

function fnGetMailCount() {
  $sql = 
SELECT iMessageID
FROM tblEmail
WHERE iToMemberID = . $this-getMemberID();

  $mysqli = new mysqli($this-_dbServer,
$this-_dbUser,$this-_dbPassword, $this-_dbDSN);
  $query = $mysqli-query($sql);
  return $query-num_rows;
}

function fnGetMail() {
  $sql = 
SELECT *
FROM tblEmail
WHERE iToMemberID = . $this-getMemberID() .
Order by dtEmailDate Desc;

  $mysqli = new mysqli($this-_dbServer, $this-_dbUser,
$this-_dbPassword, $this-_dbDSN);
  $query = $mysqli-query($sql);
  return $query-fetch_object();
  //return $query-num_rows;
  //return $query-fetch_assoc();
}
[]
}


Output/calling page:

?
require_once(../../classes/class.members.php);
require_once(../../classes/class.mail.php);

session_start();

require_once(../../_global.php);

//$objMember = new members(); //intialize member class

$objMail = new memberMail(); //initialize memberMail class
$objMail-members($aSiteSettings[sDBServer],$aSiteSettings[sDBLogin],$aSiteSettings[sDBPassword],
$aSiteSettings[sDSN]);
$objMail-setMemberID($_SESSION[iMemberID]);
$iMailCount = $objMail-fnGetMailCount();
while($rows=$objMail-fnGetMail()){
  print_r($rows-sTitle);
}

/*
// Test mysqli directly on page - same as fnGetMail()
$sql = 
  SELECT *
  FROM tblEmail
  WHERE iToMemberID = . $_SESSION[iMemberID] .
  Order by dtEmailDate Desc;

$mysqli = new mysqli($aSiteSettings[sDBServer],
$aSiteSettings[sDBLogin],
$aSiteSettings[sDBPassword],
$aSiteSettings[sDSN]);
$query = $mysqli-query($sql);
while($rows = $query-fetch_object()){
  print_r($rows-sTitle);
}
$mysqli-close;
*/
?

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



[PHP] Before I pull anymore hair out.. Is anyone Using..

2005-07-20 Thread Chuck Carson
Is anyone here using php 5.0.4 on Solaris 9 and compiled with Oracle
10g support and using apache 2.0.54? I have looked at every 10 times
over. I have built php with oracle support probably 100 times on 5
different platforms and never had as many issues as I have had so far
with this system.

After finally getting php to build with everything I needed, I am
getting seg faults when accessing a php page that connects to the
oracle database. (but it doesn't happen _every_ time, it is
inconsistent)

I'm at a loss and must move to tomcat/jsp/servlets if I can't get a
stable platform up this week. =(

Thx
CC

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



[PHP] PHP Build Issues on Soalris 9

2005-07-20 Thread Chuck Carson
Okay, something I just noticed. (PHP builds fine, including make test)

I see this after running configure:
Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/php-config
creating sapi/cli/php.1
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
++
|   *** ATTENTION ***|
||
| Something is likely to be messed up here, because the configure|
| script was not able to detect a simple feature on your platform.   |
| This is often caused by incorrect configuration parameters. Please |
| see the file debug.log for error messages. |


I am configuring with this:
adcinfops01:/usr/local/src/php-5.0.4 #./configure
--prefix=/usr/local/php-5.0.4 --with-apxs2=/usr/local/apache2/bin/apxs
--enable-cli --enable-cgi --with-openssl=/usr/local/ssl --with-zlib
--with-zlib-dir=/usr/local/lib --with-bz2 --enable-dio --with-gd
--with-gettext --with-mysql=/usr/local/mysql
--with-mysql-sock=/tmp/mysql.sock --enable-sockets
--with-oci8=/u01/app/oracle/product/10.2 --enable-sigchild

LDFLAGS=-L/usr/local/mysql/lib/mysql
-L/u01/app/oracle/product/10.2/lib32 -L/usr/local/ssl/lib
-L/usr/local/lib

How can I determine what it thinks is missing?
Thx,
CC

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



Re: [PHP] Before I pull anymore hair out.. Is anyone Using..

2005-07-20 Thread Chuck Carson
Yea, there is nothing talking about my eact configuration. (mainly on
Solaris) I can get this config working on SLES 9 and Red Hat w/o
problems and currently have it running on a dozen systems or so.

I need it on Solaris 9...

-CC

On 7/20/05, Mikey [EMAIL PROTECTED] wrote:
 Chuck Carson wrote:
 
 Is anyone here using php 5.0.4 on Solaris 9 and compiled with Oracle
 10g support and using apache 2.0.54? I have looked at every 10 times
 over. I have built php with oracle support probably 100 times on 5
 different platforms and never had as many issues as I have had so far
 with this system.
 
 After finally getting php to build with everything I needed, I am
 getting seg faults when accessing a php page that connects to the
 oracle database. (but it doesn't happen _every_ time, it is
 inconsistent)
 
 I'm at a loss and must move to tomcat/jsp/servlets if I can't get a
 stable platform up this week. =(
 
 Thx
 CC
 
 
 
 I guess you have tried reading the walkthrough on Oracle?
 
 http://www.oracle.com/technology/tech/php/index.html
 
 HTH,
 
 Mikey
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
 The day Microsoft makes something that doesn't suck is probably
 the day they start making vacuum cleaners. -Ernst Jan Plugge

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



[PHP] Can PHP Talk directly to Oracle w/o Using Listener

2005-07-19 Thread Chuck Carson
Does PHP have the ability to talk directly to a local oracle database
w/o the need for a listener?

Thx,
CC

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



[PHP] Solaris 9/Oracle 10g Compile Time Problems

2005-07-19 Thread Chuck Carson
How do you build php 5.0.4 with support for oracle 10.2 on Solaris 9?
I am getting the following compile time error?

snip
z -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl
-lnsl -lsocket -lgen -ldl -lclntsh -lxml2 -lz -liconv -lm -lsocket
-lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl  -o libphp5.la
ld: fatal: file /u01/app/oracle/product/10.2/lib/libclntsh.so: wrong
ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to .libs/libphp5.so
*** Error code 1
make: Fatal error: Command failed for target `libphp5.la'

Thanks,
CC

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



[PHP] ARG, call to undefined function, same problem I had on SuSE

2005-07-19 Thread Chuck Carson
Okay, just built php 5.0.4 on solaris 9 and added mysql and oracle
support (using Oracle 10.2.0.1). phpinfo() shows that oracle support
is enabled, however, a simple call to ora_logon doesnt work:

Fatal error: Call to undefined function ora_logon() in
/usr/local/apache2/htdocs/oratest.php
on line 2

I configured php as follows:
./configure --prefix=/usr/local/php-5.0.4
--with-apxs2=/usr/local/apache2/bin/apxs --enable-cli --enable-cgi
--with-openss=/usr/local/ssl --with-zlib --with-bz2 --enable-dio
--with-gd --with-gettext --with-mysql=/usr/local/mysql
--with-mysql-sock=/tmp/mysql.sock --enable-sockets
--with-oci8=/u01/app/oracle/product/10.2

Anyone have any ideas???
Thx,
CC

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



[PHP] PHP is occasionally seg faulting

2005-07-19 Thread Chuck Carson
Im running php 5.0.4 with oracle 10g on Solaris 9 and apache 2.0.54.
(I built with --with-oci8 so I am using the OCI stuff)

I have a simple test page that does select username from dba_users
and merely prints each username to the browser. It will work 1 time or
sometimes 2 but then subsequent calls produce errors (in the browser)
and the apache log gets this:

[Tue Jul 19 16:01:10 2005] [notice] child pid 7105 exit signal
Segmentation fault (11)
[Tue Jul 19 16:02:18 2005] [notice] child pid 7107 exit signal
Segmentation fault (11)
[Tue Jul 19 16:02:19 2005] [notice] child pid 7110 exit signal
Segmentation fault (11)

Anyone have any ideas?
Thx,
CC

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



[PHP] SOlaris 10 Build Problems

2005-07-15 Thread Chuck Carson
Trying to build php 5.0.4 on solaris using gcc, and get this error:
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... 

Sorry, I cannot run apxs.  Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /usr/local/apache2/bin/apxs follows:
./configure: /usr/local/apache2/bin/apxs: not found
configure: error: Aborting

ccarson-sun:/usr/local/src/php-5.0.4 #/usr/local/apache2/bin/httpd  -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c
ccarson-sun:/usr/local/src/php-5.0.4 #which perl
/usr/bin/perl

ccarson-sun:/usr/local/src/php-5.0.4 #ls -l /usr/local/apache2/bin/apxs 
-rwxr-xr-x   1 root bin22795 Jun 19 00:17
/usr/local/apache2/bin/apxs

According to the error, the problem could be one of 3 things, however,
none of those apply to my case.

Anyone have any ideas?
Thx,
CC

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



[PHP] Call to undefined function ora_logon()

2005-07-05 Thread Chuck Carson
I am unable to get php 5.0.4 working with Oracle 10.1.0.3. (also
Apache 2.0.54). Running on SuSE 9.3.

When I look at the output of phpinfo() it shows OCI8 support enabled
as well as mysql support. (Mysql support works fine)

bongrip:/usr/local/apache2/modules # ldd libphp5.so
   linux-gate.so.1 =  (0xe000)
   libcrypt.so.1 = /lib/libcrypt.so.1 (0x402c6000)
SNIP
   libclntsh.so.10.1 =
/u01/app/oracle/product/10.1.0.3/lib/libclntsh.so.10.1 (0x4048d000)
SNIP

Here you can see it is correctly linked with the oracle client.
However, Ora_Logon and OCILogOn but fail with this error:

Call to undefined function ora_logon()/OCILogon()

$ORACLE_HOME/lib is defined in LD_LIBRARY_PATH of the environment that
is running the apache server, I also explictly set ORACLE_HOME in the
same environment as well as using SetEnv in the httpd.conf file.
(although I'm not getting to a point where ORACLE_HOME is an issue
yet)

I saw a document that said to build with --with-oci8 AND
--with-oracle, however --with-oracle doesn't work with 10g. (it
complains about not finding the correct libraries)

Any ideas? Does php 5.0.4 work with Oracle 10.1.0.3?

Thx,
CC

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



[PHP] Support for Oracle 10g in php 5.0.4

2005-07-05 Thread Chuck Carson
I'm having problems getting php 5.0.4 working with Oracle 10.1.0.3 and
just wanted to check and make sure 10g was supported before wasting
any more cycles on it.

Thx,
CC

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



[PHP] Re: corrected

2005-01-19 Thread chuck
Requested file.


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

[PHP] A simple question

2004-11-13 Thread Chuck PUP Payne
Hey,

I have just upgrade my box and my forms are no longer passing information
into the database. I did a simple echo test and sure enough nothing. I was
using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I
thinking there is something that needs to be turn on in my php.ini that I
need to turn to pass information.

Any clues,

Payne 

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



Re: [PHP] A simple question

2004-11-13 Thread Chuck PUP Payne
If I was still on 4.1 I would understand, but I am on 4.3.4 now

I will read it but I think it will there is something that turn on in the
php.ini.

Payne

On 11/13/04 9:13 PM, Brad Bonkoski [EMAIL PROTECTED] wrote:

 Read this..
 http://www.php.net/release_4_1_0.php
 
 (Especially the part about global variables...)
 - Original Message -
 From: Chuck PUP Payne [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, November 13, 2004 9:02 PM
 Subject: [PHP] A simple question
 
 
 Hey,
 
 I have just upgrade my box and my forms are no longer passing information
 into the database. I did a simple echo test and sure enough nothing. I was
 using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I
 thinking there is something that needs to be turn on in my php.ini that I
 need to turn to pass information.
 
 Any clues,
 
 Payne
 
 -- 
 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



Re: [PHP] A simple question

2004-11-13 Thread Chuck PUP Payne
Ugh, from what I read now I have to re-write all my forms. No fun. Thanks
guys, I was hoping it was something simple.

I would like to ask one thing, here is a simple code that I was using can
someone explain to what need to be change to work with 4.3.4 so that I can
work on my other pages

?

$db_name = mylinks;

$table_name = links;

$connection = @mysql_connect(localhost,xxx,xxx) or die (Couldn't
connect);

$db = @mysql_select_db($db_name, $connection) or die (Couldn't select
database.);

$sql = INSERT INTO $table_name
(abc, keywords, links, name)
VALUES
('$abc', '$keyword', '$links', '$name');

// echo what should be going into the table...

print A: $abc, KW: $keyword, LINKS: $links, NAME: $name, SQL: $sqlP;

$result = @mysql_query($sql, $connection) or die(Couldn't execute query.);

?


Sorry to ask, just nothing is inserting into the data, and most of the books
I have are from 2000 a little dated.

Payne  


PS. Before someone tells me that it not good to post information here,
things have been change to protect my database.

On 11/13/04 9:59 PM, Janet Valade [EMAIL PROTECTED] wrote:

 
 Actually, read this:
 
 http://us2.php.net/manual/en/security.globals.php
 
 Janet
 
 Chuck PUP Payne wrote:
 
 If I was still on 4.1 I would understand, but I am on 4.3.4 now
 
 I will read it but I think it will there is something that turn on in the
 php.ini.
 
 Payne
 
 On 11/13/04 9:13 PM, Brad Bonkoski [EMAIL PROTECTED] wrote:
 
 
 Read this..
 http://www.php.net/release_4_1_0.php
 
 (Especially the part about global variables...)
 - Original Message -
 From: Chuck PUP Payne [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, November 13, 2004 9:02 PM
 Subject: [PHP] A simple question
 
 
 
 Hey,
 
 I have just upgrade my box and my forms are no longer passing information
 into the database. I did a simple echo test and sure enough nothing. I was
 using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I
 thinking there is something that needs to be turn on in my php.ini that I
 need to turn to pass information.
 
 Any clues,
 
 Payne
 
 -- 
 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



[PHP] fopen by URL is disabled, is there another way of reading a remote webpage?

2004-10-20 Thread Chuck Barnett
Hi, my new server has fopen by url disabled.  My ISP doesn't want to turn it
on.  So is there a way to do an equivilant function some other way?  I need
to read a remote webpage and manipulate it.

Thanks,
Chuck

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



RE: [PHP] Recursive Interpolation

2004-10-05 Thread Chuck Wolber
On Mon, 4 Oct 2004, Michael Sims wrote:

 Chuck Wolber wrote:
  The method I've come up with in the meantime, I believe is much more
  effective than heredocs, but still an ugly hack:
 
  function interpolate ($text, $msg_variable) {
  $msg_key = '_FP_VAR_';
 
  foreach (array_keys($msg_variable) as $key) {
  $token = $msg_key.$key;
  $text = preg_replace(/$token/, $msg_variable[$key],
  $text); }
 
  return ($text);
  }
 
 What's ugly about it?  I saw your earlier post I was actually planning 
 on responding and suggesting something exactly like you just came up 
 with.

The main problem (aside from performance, which you addressed) is that it 
does not handle corner cases such as when you want to use one of your 
variables within the text of the dispatch (escaping). It is also not 
truly recursive. 

From a hacker standpoint, it extends the base PHP tool set, rather than 
making use of existing tools (not necessarily a bad thing). IMHO a 
non-ugly version of this would allow you to use standard PHP variables in 
your dispatch and force PHP itself to re-interpret the variables. This is 
why I think an interpolate() function would have to be built in to the 
base PHP interpreter rather than be done with the language itself. 


 I think it's fairly clean and logical.

Thank you :)



 The only problem I can see with this approach is that it's inefficient 
 as $msg_variable gets larger or the $text gets larger, since you're 
 iterating through every key of the former, even if the token isn't in 
 $text, and you run preg_replace() once for each token, but that 
 shouldn't hurt you unless you really have a heavy traffic site, IMHO.

Right, which is another reason my hack shouldn't be considered a 
generalized solution to the recursive interpolation problem. Any 
developers on the list want to comment on a possible interpolate() 
function?



 I toyed around with using preg_replace_callback() for this eariler, but 
 the only problem with it is that you can't create a callback that 
 accepts more than just one variable (the array of matches).  This means 
 I couldn't get the equivalent of your $msg_variable passed to the 
 callback, so I had to make it global in the callback function (yuk).  
 If it weren't for that it'd be a perfect solution, because 
 preg_replace_callback would only be called once and the function 
 wouldn't need to iterate through all of $msg_variable. It's times like 
 that that I miss Perl's more powerful variable scoping rules.  Ah 
 well...

Definitely cleaner and even appears (at first glance) that it lends itself 
to being recursive a lot easier than mine. Could you solve the global 
problem by doing a $this.msg_variable sort of thing within the callback?

-Chuck



-- 
http://www.quantumlinux.com 
 Quantum Linux Laboratories, LLC.
 ACCELERATING Business with Open Technology

 The measure of the restoration lies in the extent to which we apply 
  social values more noble than mere monetary profit. - FDR

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



Re: [PHP] Recursive Interpolation

2004-10-05 Thread Chuck Wolber

Ah yes, thanks. Looks like it's mentioned here:

http://marc.theaimsgroup.com/?l=php-devm=109405450709578w=2

Doesn't look like it's going to happen too soon though based on Sara's 
comment: and I havn't personally had the motivation to actually get it 
done.

Looks like there's some traction for something like this. That's a good 
first step :)

-Chuck


On Tue, 5 Oct 2004, l0t3k wrote:

 if you check the internals archive, i think Sara said she had an
 interpolator on her plate...
 
 
 Chuck Wolber [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  On Mon, 4 Oct 2004, Michael Sims wrote:
 
 
 

-- 
http://www.quantumlinux.com 
 Quantum Linux Laboratories, LLC.
 ACCELERATING Business with Open Technology

 The measure of the restoration lies in the extent to which we apply 
  social values more noble than mere monetary profit. - FDR

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



[PHP] Recursive Interpolation

2004-10-04 Thread Chuck Wolber

Greetings,

I've seen a few posts from the middle of last year discussing the problem 
of recursive interpolation:

http://marc.theaimsgroup.com/?l=php-generalm=105543152906744w=2
http://marc.theaimsgroup.com/?l=php-generalm=105542523331255w=2

It seems there's a HEREDOC method of hacking through this problem. In the 
meantime, is there any other way?

Here's a description of a problem I'm having and how it would be nice to 
see it solved:

Database *FIELD* with text data in it. The text data contains sentences 
interspersed with $foo['bar'] array variables. The idea is that when one 
selects this field, PHP will interpolate $foo['bar'] with the currently 
defined $foo array variable. This allows for form letter like dispatches 
to be created.

Given a variable $text that contains data retrieved with array variables, 
It'd be useful to see something: $text_i = interpolate($text) which 
recursively interpolates based on variables in the current namespace.

Granted, this opens up a *WHOLE* mountain of problems (circular references 
anyone?). Is there any traction on an idea like this? Any other solutions 
that aren't so hackish as HEREDOCs?

Thanks,

-Chuck

-- 
http://www.quantumlinux.com 
 Quantum Linux Laboratories, LLC.
 ACCELERATING Business with Open Technology

 The measure of the restoration lies in the extent to which we apply 
  social values more noble than mere monetary profit. - FDR

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



Re: [PHP] something wrong with $_SERVER var

2004-10-04 Thread Chuck Wolber
On Tue, 5 Oct 2004, Merlin wrote:

 I am experiencing a strange behaviour with $_SERVER vars.
 Somehow the var: $_SERVER[SERVER_PORT]  seems to be 443 even if
 it is 80. I had following statement inside my app:
 
 if ($_SERVER[SERVER_PORT] == '443' AND !$SSL){
   header(Location:http://.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]);
   exit;
 }


You can start by putting a space between the Location: and the rest of 
your URL.

-Chuck


-- 
http://www.quantumlinux.com 
 Quantum Linux Laboratories, LLC.
 ACCELERATING Business with Open Technology

 The measure of the restoration lies in the extent to which we apply 
  social values more noble than mere monetary profit. - FDR

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



Re: [PHP] Recursive Interpolation

2004-10-04 Thread Chuck Wolber
On Mon, 4 Oct 2004, Chuck Wolber wrote:

 Database *FIELD* with text data in it. The text data contains sentences 
 interspersed with $foo['bar'] array variables. The idea is that when one 
 selects this field, PHP will interpolate $foo['bar'] with the currently 
 defined $foo array variable. This allows for form letter like 
 dispatches to be created.

The method I've come up with in the meantime, I believe is much more 
effective than heredocs, but still an ugly hack:


function interpolate ($text, $msg_variable) {
$msg_key = '_FP_VAR_';
   
   
foreach (array_keys($msg_variable) as $key) {
$token = $msg_key.$key;
$text = preg_replace(/$token/, $msg_variable[$key], $text);
}
   
   
return ($text);
}




-- 
http://www.quantumlinux.com 
 Quantum Linux Laboratories, LLC.
 ACCELERATING Business with Open Technology

 The measure of the restoration lies in the extent to which we apply 
  social values more noble than mere monetary profit. - FDR

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



[PHP] PHP Login Script

2004-08-25 Thread Chuck
Could anyone let me know or point me to where I could find out how to setup
a login for my php site.  I've been looking around and found plenty of stuff
for PHP/Apache, but nothing for just PHP.

Any help or info about this would be appreciated.

Thanks,
Chuck

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



[PHP] Select List PHP,HTML

2004-08-23 Thread Chuck
Hello everyone,

I have been able to create a list with no problem, but now I need to get the
value of which item is selected in the list.  I looked around, but couldn't
find anywhere that would let me do this.

Here's my code to build the list.
SELECT name=Company List multiple size=8
?php
  $db = new COM(ADODB.Connection);
  $dsn = DRIVER=SQL Server; SERVER=D63WV941;UID=sa;PWD=sa;
DATABASE=BINDER;
  $db-Open($dsn);
  $rs = $db-Execute(SELECT * from company);
  while (!$rs-EOF)
  {
$Name = $rs-Fields['Name']-Value;
print OPTION.$Name;
$rs-MoveNext();
  }
?
/Select


I would appreciate any help I could get with this.

Thanks,
Chuck

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



Re: [PHP] Select List PHP,HTML

2004-08-23 Thread Chuck
Thanks a lot, that worked perfectly.

Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
I have been able to create a list with no problem, but now I need to get
the
value of which item is selected in the list.  I looked around, but
couldn't
find anywhere that would let me do this.

Here's my code to build the list.
SELECT name=Company List multiple size=8
?php
  $db = new COM(ADODB.Connection);
  $dsn = DRIVER=SQL Server; SERVER=D63WV941;UID=sa;PWD=sa;
DATABASE=BINDER;
  $db-Open($dsn);
  $rs = $db-Execute(SELECT * from company);
  while (!$rs-EOF)
  {
$Name = $rs-Fields['Name']-Value;
print OPTION.$Name;
$rs-MoveNext();
  }
?
/Select


I would appreciate any help I could get with this.
[/snip]

echo $_POST['Company List'];

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



[PHP] PHP 5.01 and HTML

2004-08-20 Thread Chuck
Hello everyone.  I have the following script that creates a listbox.  My box
appears, but I can't get any data into it.  Can someone let me know what I'm
doing wrong.

SELECT name=Company List multiple size=8
?php
  $db = new COM(ADODB.Connection);
  $dsn = DRIVER=SQL Server; SERVER=D63WV941;UID=sa;PWD=sa;
DATABASE=BINDER;
  $db-Open($dsn);
  $rs = $db-Execute(SELECT * from company);
  while (!$rs-EOF)
  {
$Name = $rs-Fields['Name']-Value;
// This doesn't get listed.
OPTION.$Name;
$rs-MoveNext();
  }
?
/SELECT

I appreciate the help,
Chuck

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



Re: [PHP] PHP 5.01 and HTML

2004-08-20 Thread Chuck
Thanks alot, worked great.  You're the man!!


Matt M. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  SELECT name=Company List multiple size=8
  ?php
$db = new COM(ADODB.Connection);
$dsn = DRIVER=SQL Server; SERVER=D63WV941;UID=sa;PWD=sa;
  DATABASE=BINDER;
$db-Open($dsn);
$rs = $db-Execute(SELECT * from company);
while (!$rs-EOF)
{
  $Name = $rs-Fields['Name']-Value;
  // This doesn't get listed.
  OPTION.$Name;
  $rs-MoveNext();
}
  ?
  /SELECT

 print  OPTION.$Name;

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



[PHP] executing php script from sql field.

2004-06-18 Thread Chuck
Hello I am trying to get some php code that's in a mysql field to execute...all I can 
get it to do is print the php code as human readable...

I'm trying somthing like this..:

print $sql[data];

where data has something like this in it:

Hello, this is ? print $name;?


anyone have any suggestions?

Thanks,
Chuck

[PHP] Best way to do Last 3 Items Viewed

2004-05-14 Thread Chuck Barnett
Anyone have any code snippits that would allow me to do a Last 3 Items
Viewed like on ebay?

Thanks,
Chuck

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



[PHP] Mail Transaction Failed

2004-01-26 Thread chuck
The message contains Unicode characters and has been sent as a binary attachment.


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

[PHP] Mail Transaction Failed

2004-01-26 Thread chuck
The message contains Unicode characters and has been sent as a binary attachment.


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

[PHP] Problem with RAND()

2003-10-23 Thread Chuck PUP Payne
Hi,

I am trying to understand how RAND (), because I've had this problem before
with other langs., I am using with this with MySQL statement that is in my
php script, but it's only put the first files. I only have three files, do I
need more files in my database?

Is RAND() or RAND (), please help. When I did basic back in the 8-bit days I
had problem with RANDOM then too.

Chuck

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



[PHP] Php and Fortune

2003-10-22 Thread Chuck PUP Payne
Hi,

Is there a way I can get php to call the program fortune then print that a
web page.

Thanks.

Payne

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



Re: [PHP] Php and Fortune

2003-10-22 Thread Chuck PUP Payne
Thanks Everyone. This is so cool!!! :)

On 10/22/03 11:15 PM, Mykroft Holmes IV [EMAIL PROTECTED] wrote:

 
 
 Mykroft Holmes IV wrote:
 
 
 
 Chuck PUP Payne wrote:
 
 Hi,
 
 Is there a way I can get php to call the program fortune then print
 that a
 web page.
 
 Thanks.
 
 Payne
 
 
 echo 'pre';
 passthru(fortune);
 echo '/pre';
 
 Should do it. I use this for a nice little Server Status page that
 iterates through an array of unix commands, works like a charm.
 
 Adam
 
 
 Oops, should be:
 
 echo 'pre';
 passthru('fortune');
 echo '/pre';
 
 Adam

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



[PHP] Movie ticket reservation system.

2003-03-02 Thread Chuck
Hi. does anyone know of a php//mysql based movie ticket reservation system?

Thanks,
Chuck Barnett

[PHP] Wanting to better understand

2002-10-01 Thread Chuck \PUP\ Payne

Hey,

I am trying to better understand something, I learned a couple weeks ago
that if I do this...

If ($field == value1) {
$field = change to new value;

Now I have use this to change -00-00 to nbsp;. And the following.

If ($days  30) {
$days strongfont color='ff' . $days . /font/strong;
}


Want I want to do was add a second line this below to change the another
value to change to change to another color...

If ($days  45) {
$days strongfont color='ff00ff' . $days . /font/strong;

}

But, the second value is over riding the first vaule so I can't see the
differents. I sorry that this might be confusing but I am trying to ask the
way I can. I am not sure what you call this, expression I think. Any way is
there a way that I can use this expression to get two or more colors.

Thanks 

Chuck Payne
Magi Design and Support



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




Re: [PHP] Wanting to better understand

2002-10-01 Thread Chuck PUP Payne

A, ok. You know am still having problems with elseif, else, Ok, thanks I
will give it a try.


Chuck


On 10/1/02 11:03 PM, Chris Shiflett [EMAIL PROTECTED] wrote:

 Chuck,
 
 I'm not sure what you're trying to do, but I think you might just want
 to order it the other way around.
 
 if ($days  45)
 {
# $days is 46 or more
do stuff
 }
 elseif ($days  30)
 {
# $days is 31-45
do other stuff;
 }
 else
 {
# $days is 30 or less
more stuff;
 }
 
 Also, be careful about overwriting $days with that long string and then
 trying to compare it to a numeric value. You probably want to use a
 different variable name for the string.
 
 Happy hacking.
 
 Chris
 
 Chuck \PUP\ Payne wrote:
 
 If ($days  30) {
$days strongfont color='ff' . $days . /font/strong;
 }
 
 
 Want I want to do was add a second line this below to change the another
 value to change to change to another color...
 
 If ($days  45) {
$days strongfont color='ff00ff' . $days . /font/strong;
 
 }
 
 But, the second value is over riding the first vaule so I can't see the
 differents.
 
 


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




RE: [PHP] general apache list

2002-09-30 Thread Chuck Payne

apache.org or on Google for Apache Today, I think it apachetoday.org. There
you will find your list.

Chuck Payne
-Original Message-
From: electroteque [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 30, 2002 10:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] general apache list


where can i find it ?



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




[PHP] Include...

2002-09-28 Thread Chuck \PUP\ Payne

Hi,

I am trying to start using inc files. But I am this this error

Warning: Failed opening '/local/htdocs/movies/style.inc' for inclusion
(include_path='.:/usr/share/php') in /local/htdocs/movies/lmenu.php on line
3

I have this in my lmenu.php

Include (/local/htdocs/movies/style.inc);

So can't someone telling me what I am doing wrong. I thought .inc where
easy.


Chuck Payne



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




[PHP] Include...

2002-09-28 Thread Chuck PUP Payne

Hi,

I am trying to start using inc files. But I am this this error

Warning: Failed opening '/local/htdocs/movies/style.inc' for inclusion
(include_path='.:/usr/share/php') in /local/htdocs/movies/lmenu.php on line
3

I have this in my lmenu.php

Include (/local/htdocs/movies/style.inc);

So can't someone telling me what I am doing wrong. I thought .inc where
easy.


Chuck Payne



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




[PHP] Include Part 2

2002-09-28 Thread Chuck PUP Payne

Ok, I am trying to make my design a lot easier. I want to know if I can do
this...

I want to set up in my php page this...


$rows;

Under my db_info.inc I want to store this so that I can add delete from it.

$row = $title = myrow[title]; $format = myrow[format]; $category =
myrow[category];

Am I wrong to try this way? Do I need to set it up as fuction to call on?

Chuck Payne


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




Re: [PHP] Include Part 2

2002-09-28 Thread Chuck PUP Payne

What I was wanting to do was store the myrows under let say, db_info.inc
file. So that I can add or delete what myrows I want to call on.

I am thinking this what I need  to do...

Function row ($row) { //These are the rows to call on...
$title = $myrow[title];
$format = myrow[format];
$category =$myrow[category];
}

This way I can add more myrow to call upon at a later date or delete for
that matter.

I hope that helps...

Chuck

On 9/29/02 1:48 AM, Justin French [EMAIL PROTECTED] wrote:

 Not sure I fully understand, but usually this stuff calls for either a
 function, or an included file of code... in your case, sounds like a
 function is required, but I may not fully understand...
 
 Regards,
 
 Justin
 
 
 on 29/09/02 3:29 PM, Chuck PUP Payne ([EMAIL PROTECTED]) wrote:
 
 Ok, I am trying to make my design a lot easier. I want to know if I can do
 this...
 
 I want to set up in my php page this...
 
 
 $rows;
 
 Under my db_info.inc I want to store this so that I can add delete from it.
 
 $row = $title = myrow[title]; $format = myrow[format]; $category =
 myrow[category];
 
 Am I wrong to try this way? Do I need to set it up as fuction to call on?
 
 Chuck Payne
 
 


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




Re: [PHP] Include Part 2

2002-09-28 Thread Chuck PUP Payne

By the way I have time this but what is happen and maybe this will clear up
things. I only calling this first myrow call titles. It's not going on to
the other two. Now in my php page I have this...

$myrow = mysql_fetch_array($result);

$row;

Now this doesn't work. But this does.

$myrow = mysql_fetch_array($result);

$title = $myrow[title];
$format = $myrow[format];
$category =$myrow[category];


So want I wanted to do  but I am see you can was to make $row be called from
db_info.inc so that if lets say I wanted to add ratings I can add it to the
db_info.inc. The reasoning for this is about 50 pages and I am getting tried
of change each one I like to be able to change just one file. You know make
it easier. Better design. Sorry it 2:30am and Jolt cola is not working and I
am LD. So sorry if this is not clear.

Chuck Payne


On 9/29/02 2:06 AM, Chuck PUP Payne [EMAIL PROTECTED] wrote:

 What I was wanting to do was store the myrows under let say, db_info.inc
 file. So that I can add or delete what myrows I want to call on.
 
 I am thinking this what I need  to do...
 
 Function row ($row) { //These are the rows to call on...
   $title = $myrow[title];
   $format = $myrow[format];
   $category =$myrow[category];
 }
 
 This way I can add more myrow to call upon at a later date or delete for
 that matter.
 
 I hope that helps...
 
 Chuck
 
 On 9/29/02 1:48 AM, Justin French [EMAIL PROTECTED] wrote:
 
 Not sure I fully understand, but usually this stuff calls for either a
 function, or an included file of code... in your case, sounds like a
 function is required, but I may not fully understand...
 
 Regards,
 
 Justin
 
 
 on 29/09/02 3:29 PM, Chuck PUP Payne ([EMAIL PROTECTED]) wrote:
 
 Ok, I am trying to make my design a lot easier. I want to know if I can do
 this...
 
 I want to set up in my php page this...
 
 
 $rows;
 
 Under my db_info.inc I want to store this so that I can add delete from it.
 
 $row = $title = myrow[title]; $format = myrow[format]; $category =
 myrow[category];
 
 Am I wrong to try this way? Do I need to set it up as fuction to call on?
 
 Chuck Payne
 
 
 


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




[PHP] What other list are there?

2002-09-25 Thread Chuck Payne

Hi,

I am getting ready to start another project that will have to do a lot of
math. So I need to ask some question on how to get php and mysql to do that.
So can you tell what mailing list there because I think that I might have to
ask other list since this is general list, I am I think this might be a
little more advance. Hey, if I am wrong sorry, just thing to make sure a
head of time.

Thanks,

Chuck Payne
Magi Design and Support


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




[PHP] Thoughts on a simple search engine...

2002-09-24 Thread Chuck Payne

Ok for a simple search I should be able to create a form page and Enter the
value and select the feild that Ron want to search.

Example

$sql = SELECT * FROM \$table\ WHERE \$field\ LIKE \'%$value%'\ ORDER
BY \$input\;

$table = Of course the table they want to search
$field = Field that want to seach
$value = value what they want to by
$input = if they want to search by something other a node numder.

So I if I create the form, is there way that I can have it echo on the same
page if I am using a form?


Chuck Payne
Magi Design and Support



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




RE: [PHP] html input and php (newbie) -- What I was asking with my thoughts on Search Engine

2002-09-24 Thread Chuck Payne

This what I was asking, I want someone to press submit then have the returns
print out in one are of the table. So could I do this?


?php
 if ($submit == click){
   echo $sql_result;
 }

?

So instead of doing a search.html that calls on do_search.php like most
books teach. I am wanting to do a search.php. Just print the information on
that page.

Chuck


-Original Message-
From: Jesse Cablek [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 3:39 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] html input and php (newbie)


Anna Gyor mailto:[EMAIL PROTECTED] scribbled;

 Hi,

 I just began to learn php and I have te following code. How can I get
 the input field value in the php script? Because my script doesn't
 work. $UserName is always an empty string.

 ?php
 if ($submit == click){
   echo Hello, $UserName;
 }
[...]


Assuming register_globals=off, use $_POST['UserName'] instead

-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




[PHP] Maybe a stupid question but can it be done?

2002-09-23 Thread Chuck \PUP\ Payne

Ok, Let's try this again, for some reason this didn't post from early today.

I have db that has two tables that I am needing to post the same information
into both tables, I can't use ID. So I am want to see if there is a sql
statement that will let me or how I can do with a php page.

I am sorry to ask, I have looked around to see if there any on the net or in
my mysql and php books but this seems like a weird task.

Chuck Payne
Magi Design and Support


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




[PHP] Maybe a stupid question but can it be done?

2002-09-23 Thread Chuck PUP Payne

Ok, Let's try this again, for some reason this didn't post from early today.

I have db that has two tables that I am needing to post the same information
into both tables, I can't use ID. So I am want to see if there is a sql
statement that will let me or how I can do with a php page.

I am sorry to ask, I have looked around to see if there any on the net or in
my mysql and php books but this seems like a weird task.

Chuck Payne
Magi Design and Support


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




[PHP] Help with mail...

2002-09-22 Thread Chuck \PUP\ Payne

Hi,

Well after read php.net and my copy php 4 bible. I am lost with mail. I can
get it to work if I do this...

Mail ('[EMAIL PROTECTED]', 'Data Added',
   $fname, $lname .);

But I can't get this to work...I know someone going to call me stupid but I
am really having people with mail(), Is there a special place to put it?

Here example of my codeany way I trying to hammer it out and using
google to see where the error of my way is.

Chuck Payne


---

HTML
HEAD
TITLEKillers Added/TITLE
/HEAD

BODY TOPMARGIN=50

?php

if ($fname==) {
echo You did not supply a first name. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
  
  if ($lname==) {
echo You did not supply a Last Name. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
  
  if ($title==) {
echo You did not supply a Movie Title. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
 
 $dbh = mysql_connect(deathtoasp, zombieuser, eatmsbrains)
 or die (Unable to connect to database);
  mysql_select_db(slashers, $dbh)
 or die (An error was reported);
 
  $table_name = deathmovies;

  $statement = INSERT INTO $table_name (fname, lname, title) VALUES
(\$fname\, \$lname\, \$title\);

  $result = mysql_query($statement, $dbh);
  
  if ($result) {
  
echo H3Adding the following record/H3;
echo hr;
echo pstrongActor/Actress:/strongnbsp;nbsp; $fname $lname
/p;
echo br;
echo pstrongMovie:/strongnbsp;nbsp;$title/p;
echo a href='addactormovie.html'Add more Actor/Actress and Movie
which they stared in/a;
echo hr;

   $address = [EMAIL PROTECTED];
   $Subject = The new movie and actor added to phpMovie Library;
   $body = Adding the following record
Actor/Actress: '$fname $lname'
Movie: '$title';


mail('$address', '$Subject', '$body .');

  } else {
  
echo There was an error saving your entry. Please try back in a
little while.;
  }
 
?

/BODY
/HTML





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




Re: [PHP] Help with mail...

2002-09-22 Thread Chuck PUP Payne

Ok, that work. Why does the ' (quote) not make it work is it because it's an
array? Any thanks John that got it work.


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




[PHP] Design question.

2002-09-21 Thread Chuck PUP Payne

Hi,

I have a question. I been working a personal project that I am want to make
a like simpler. I have several pages have in which I have place the
information to connect to my database, whick is getting old.

What I am wanting to do is create file like most do, a config, but I want to
know which is better, config.php or config.inc. I know there not much
different from what I have read but I am wanting to know which gives more
protection. And what recommendation would you give on set it up? I am only
asking because I am at some point wanting to release my project to public.

Chuck Payne
Magi Design and Support


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




Re: [PHP] Design question.

2002-09-21 Thread Chuck PUP Payne

Thanks guys. That really helpful.

Chuck Payne

On 9/21/02 10:16 PM, Chris Shiflett [EMAIL PROTECTED] wrote:

 This explanation from Justin is worth saving.
 
 I also like to call all of my included modules *.inc, and I prefer to
 store them outside of document root.
 
 However, if you want to keep all of your files together, the .htaccess
 file shown below is the best way to restrict direct access to modules.
 Some people make the mistake of simply making *.inc files considered PHP
 by Apache (claiming it is better to execute them than to have their
 source code displayed), but this gives attackers the opportunity to
 execute your modules out of context - a very dangerous approach.
 
 One extra note worth adding is that you should add this configuration to
 your httpd.conf if you are the Web server administrator. This will keep
 you from having to remember the .htaccess file everywhere. Justin's
 method is best for when you do not have this option.
 
 Chris
 
 Justin French wrote:
 
 I place name all my included files *.inc... I place them all in a folder
 /inc/ and place a .htaccess file in that directory to restrict the files
 being served of HTTP:
 
 Files ~ \.inc$
Order Allow,Deny
Deny from all
 /Files
 
 Another option would be to place them in a folder ABOVE your web root, so
 that Apache can't serve them -- if you have that option.
 
 


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




[PHP] FPDF and MySQL

2002-09-19 Thread Chuck Payne

Hi,

I found a free pdfclass called FPDF http://www.fpdf.org, that I can use with
PHP to create pdf files with. Before someone tells me Read The Manual, I
have read their page and used Google to search for notes on how called mysql
into a PDF and I am lost. Does anyone know where there is a tutorial.

Thanks,

Chuck Payne
Magi Design and Support



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




[PHP] Time Stamp

2002-09-18 Thread Chuck Payne

Hi,

I have a form that I am using to update a mysql table but I can get
timestamp to update. How can I pass that information to pass on. I have
READ all books and feel I have correct systax but it just not working...

input type=text name=lastupdate value=?  echo date('D M d, Y H:i:s',
time()); ?

This should pass the time right?

Chuck Payne
Magi Design and Support




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




RE: [PHP] Date-format

2002-09-18 Thread Chuck Payne


I know everyone love to quote read the manual and forget that we[newbies]
are only asking here because we need help...so here you go...

You can do the following...

DATE_FORMAT IS THE MySQL Command

And let say you want to format your date as the following mm-dd-yy(US) or
dd-mm-yy(the rest of the world).

By the way this are format keys

%m the month in numbers,
%d the days in numbers,
%y the year in number
%M spells out the month
%D gives the date with th, rd, nd all that
%Y gives all four numbers

So you do the following sql statement...

SELECT DATE_FORMAT(yourdate, '%m-%d-%y') as youwanttocallit FROM yourtable;

So in your php code you can do this from your MySQL statement...

$youwantcallit = $myrow[youwanttoit];

? echo $youwanttocallit; ?

Advance note

then if you don't want to show 00-00-00 you can do this...

if ($youwanttocallit == 00-00-00) {
  $youwanttocallit = nbsp;;
}

that way you don't have a bunch of 00-00-00 showing up.

I hope that helps, because that is what the maillisting is for and not to
always quote Read the Book.

Chuck Payne
Magi Design and Support



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




[PHP] How to pass null as value?

2002-09-11 Thread Chuck PUP Payne

I know this may have been asked a thousand times but how do you pass null on
to a page as a value. Let say in a field where you have a yes and no. Null
needs to equal no. Is this more mysql? Can it be done in php?

Chuck Payne
Magi Design and Support


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




[PHP] Help getting count to show up.

2002-09-10 Thread Chuck Payne

Hi,

Last night I asked for help doing counts. One of the answers I got was
really great but I can't make it work. The answer I more or less show me a
great way to create a stats page,

ex. SELECT feild1, field2, COUNT(*) FROM tables GROUP BY category, format.

But my problem is I can't get count to show. I can get two of the fields.

Below is the PHP program that I am wanting to run. How can I get count to
show? Thanks.

Chuck Payne
Magi Design and Support




?

$db = mysql_connect('localhost','user','passwd');
mysql_select_db('media',$db);

$result =mysql_query(SELECT category, format, COUNT(*) FROM library GROUP
BY category, format,$db);

if ($myrow = mysql_fetch_array($result)) {

// display list if there are no records to display

do  {



printf(%s %s %sbr, $myrow[category], $myrow[format], $myrow[count]);

} while ($myrow = mysql_fetch_array($result));

} else {

// no record to display

echo 'Sorry no records were found!';

}


?



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




[PHP] Thanks...

2002-09-10 Thread Chuck \PUP\ Payne

Many thanks. That was the trick. :)

Chuck Payne
Magi Design and Support


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




[PHP] E-mail a submit

2002-09-09 Thread Chuck \PUP\ Payne

Hi,

Is there a way that when someone add a submit or edits a record that I can
have my php page e-mail that record? And is hard to do?

Chuck Payne


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




  1   2   3   >