[PHP] PHP session expiring too early?

2008-06-15 Thread gh
I am experiencing a strange bug after upgrading to PHP 5.2.4 with the 
Zend Optimizer 3.3.3.


In two of our locally-hosted web applications, NolaPro and SugarCRM, the 
login sessions are expiring after 5 minutes of inactivity and I cannot 
figure why. The relevant values from my /etc/php.ini file are as follows:


session.save_path = /var/lib/php
session.use_cookies = 1
session.cookie_lifetime = 0
session.auto_start = 0
session.cookie_path = /
session.cookie_domain =
session.gc_maxlifetime = 1440
session.cache_limiter = nocache
session.cache_expire = 180

/var/lib/php is set to 777 permissions.

There is a cron job in /etc/cron.d/php:
09,39 * * * *  root [ -d /var/lib/php ]  find /var/lib/php/ -type f 
-mmin +$(/usr/lib64/php/maxlifetime) -print0 | xargs -r -0 rm


The script /usr/lib64/php/maxlifetime outputs the value 24 which is 
consistent with the value in the php.ini file.


There are no .htaccess files in the root directories for either of the 
applications.


Does anyone know what else could be causing this problem?

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



[PHP] Mailing List Tool

2005-02-27 Thread GH
Does someone know of a mailing list tool that runs via PHP that can
check periodically (ie via a scheduled task) an email account for a
message and then send it out to an entire list of addresses?

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



[PHP] Checking the Version of mySql and settings on server

2005-02-11 Thread GH
Is it possible to check via php what version of mysql is running and
if it is a 4.1.x or better version to see if it is using the
--old-password switch or not?  I would like to know so that I can code
both ways and just have a conditional statement direct which code is
used...

Thanks

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



Re: [PHP] Checking the Version of mySql and settings on server

2005-02-11 Thread GH
However, this does not tell you if they are using the Old or New
Password on the newer version... how can i check that?



On Fri, 11 Feb 2005 21:01:02 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote:
 GH wrote:
  Is it possible to check via php what version of mysql is running and
  if it is a 4.1.x or better version to see if it is using the
  --old-password switch or not?  I would like to know so that I can code
  both ways and just have a conditional statement direct which code is
  used...
 
 hmm, mysql, that should be in mysql functions. I need to *get* *info*
 about *mysql* *server*. Oh yeah, there's one function like that:
 mysql_get_server_info


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



Re: [PHP] Re: Multi-Page Forms

2005-02-10 Thread GH
Question. Does the Tabs and Divs work under Mozilla Based Browsers?



On Wed, 09 Feb 2005 23:58:52 -0200, Manuel Lemos [EMAIL PROTECTED] wrote:
 Hello,
 
 on 02/09/2005 01:38 PM [EMAIL PROTECTED] said the following:
  I have a form which is too long to be useful displayed on one page.  I
  have it broken up into 7 sections.  All 7 are generated by the same PHP
  source file, from data in a database.
 
  When the user updates a section they can submit it and go to the next
  section, or submit it and finish (return to a higher-level page).
  There is also a navigation form at the top that lets them jump from any
  section to any other, and uses JavaScript to prompt if they try to jump
  without having saved changes they made to the page.  All of this is
  working fine.
 
  What's bothering me here is that when the user is done editing the data
  I use their input to regenerate a style sheet (the form allows them to
  customize the appearance of a web page for their customers).  That's
  expensive -- relatively speaking -- in server load so I'd rather do it
  only once, when they're really done.  But right now I do it every time
  they submit any page -- i.e. whenever any of the seven pages is
  submitted, the generation code runs.  I don't see any simple way to let
  them jump around between pages, yet for me to know when they are truly
  finished with all the data.  Of course I can give the required
  instructions -- after you are done you have to click submit to save
  all the data but I bet that those won't be read and the users will
  jump around, fail to save, and then complain that their changes are
  getting lost.
 
  Any thoughts on the design issues here?
 
 You may want to take a look at this class than handles multipage forms
 with pages either as wizard like (sequential access) or tabbed like
 (random access):
 
 http://www.phpclasses.org/multipageforms
 
 There is also this generates a single page using Javascript and DIVs to
 show you only part of the form at a time and links to switch to other pages:
 
 http://www.phpclasses.org/wizard
 
 --
 
 Regards,
 Manuel Lemos
 
 PHP Classes - Free ready to use OOP components written in PHP
 http://www.phpclasses.org/
 
 PHP Reviews - Reviews of PHP books and other products
 http://www.phpclasses.org/reviews/
 
 Metastorage - Data object relational mapping layer generator
 http://www.meta-language.net/metastorage.html
 
 --
 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] MySQL Error 1251 / phpMyAdmin

2005-02-07 Thread GH
I just installed phpMyAdmin 2.6.1 on my Windows Laptop with PHP
Version 4.3.10  [Build Date  Dec 14 2004 17:46:48] and mySql 4.1.8

I am receiving the enclosed error  when I attempt to go into
phpMyAdmin and do not know how to solve the issue...

Any assistance would be greatful.

Thank you
Gary


//## ERROR RECIEVED //

Welcome to phpMyAdmin 2.6.1

phpMyAdmin tried to connect to the MySQL server, and the server
rejected the connection. You should check the host, username and
password in config.inc.php and make sure that they correspond to the
information given by the administrator of the MySQL server.

Error 
MySQL said:  

#1251 - Client does not support authentication protocol requested by server

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



[PHP] Re: MySQL Error 1251 / phpMyAdmin

2005-02-07 Thread GH
I am still new to the PHP scene could you tell me how I rebuild the
PHP with the client library...


On Mon, 07 Feb 2005 12:20:26 -0500, Michael Stassen
[EMAIL PROTECTED] wrote:
 
 You have mysql 4.1.8, but your php was built with the library for an earlier
 version, which, as the error message says, doesn't support the new, more
 secure authentication protocol.  Your choices are to tell mysql to use the
 older, less-secure protocol, or build a copy of php using your current mysql
 client library.  See the manual for more
 http://dev.mysql.com/doc/mysql/en/old-client.html.
 
 Michael
 
 GH wrote:
 
  I just installed phpMyAdmin 2.6.1 on my Windows Laptop with PHP
  Version 4.3.10  [Build Date  Dec 14 2004 17:46:48] and mySql 4.1.8
 
  I am receiving the enclosed error  when I attempt to go into
  phpMyAdmin and do not know how to solve the issue...
 
  Any assistance would be greatful.
 
  Thank you
  Gary
 
 
  //## ERROR RECIEVED //
 
  Welcome to phpMyAdmin 2.6.1
 
  phpMyAdmin tried to connect to the MySQL server, and the server
  rejected the connection. You should check the host, username and
  password in config.inc.php and make sure that they correspond to the
  information given by the administrator of the MySQL server.
 
  Error
  MySQL said:
 
  #1251 - Client does not support authentication protocol requested by server
 


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



Re: [PHP] php editor

2005-01-13 Thread GH
On linux I use thee KDE IDE program...


On Thu, 13 Jan 2005 14:02:17 -0600, Greg Donald [EMAIL PROTECTED] wrote:
 On Thu, 13 Jan 2005 18:02:12 +0200, William Stokes [EMAIL PROTECTED] wrote:
  I'm quite new with writing php code. I was considering of using some kind of
  php editor program to help with the syntax. Know any goog ones?
 
 vim.org
 editplus.com
 
 Both support PHP syntax highlighting.
 
 --
 Greg Donald
 Zend Certified Engineer
 http://destiney.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] php vs java....

2005-01-02 Thread GH
Can you please explain Threads to me?


On Sat, 1 Jan 2005 14:38:50 -0600, Greg Donald [EMAIL PROTECTED] wrote:
 On Sat, 1 Jan 2005 10:07:20 -0800 (PST), Lewis LaCook [EMAIL PROTECTED] 
 wrote:
  ...just looking for opinions: will PHP eclipse (IS PHP
  eclipsing) Java?
 
 I'd like to see threads added to PHP.  Java has them, and Perl does as
 well.  And I'm sure there are others that I don't know about.
 
 --
 Greg Donald
 Zend Certified Engineer
 http://gdconsultants.com/
 http://destiney.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] phpMyAdmin w/ winXP - IIS w/PHP 4.3 w/mysql 4.1.8

2005-01-01 Thread GH
It would be nice if phpMyAdmin would kindly note that on their website... 

Also, when I run a phpInfo()... it says i have the 3.23.49  could this
be a contributing factor?

On Sat, 1 Jan 2005 15:55:27 +0700, Willy Sudiarto Raharjo
[EMAIL PROTECTED] wrote:
  Has anyone had any problems installing phpMyAdmin with the above
  configuration? I get an error about the mySql client and
  authentication methods? MySQL Error: 1251 : Client does not support
  authentication protocol requested by server
 
 MySQL 4.1.x is using a different authentication protocols so it may break
 phpmyadmin functionality. Use 4.0.x if you want to use phpmyadmin clearly or
 maybe you should wait for the next release
 
 --
 Willy Sudiarto Raharjo
 Registered Linux User : 336579
 Public-key : http://www.informatix.or.id/willy/public-key.txt
 Blog : http://willysr.blogspot.com
 OOo Documentation Project (ID) : http://project.informatix.or.id
 


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



Re: [PHP] phpMyAdmin w/ winXP - IIS w/PHP 4.3 w/mysql 4.1.8

2005-01-01 Thread GH
does anyone know of a simular tool that will work/has 4.1 support?

thanks


On Sat, 1 Jan 2005 14:33:05 -0600, Greg Donald [EMAIL PROTECTED] wrote:
 On Sat, 1 Jan 2005 14:15:27 -0500, GH [EMAIL PROTECTED] wrote:
  It would be nice if phpMyAdmin would kindly note that on their website...
 
 http://www.phpmyadmin.net/documentation/
 
 snip
 Note: phpMyAdmin's MySQL 4.1 support is experimental!
 /snip
 
 --
 Greg Donald
 Zend Certified Engineer
 http://gdconsultants.com/
 http://destiney.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



[PHP] phpMyAdmin w/ winXP - IIS w/PHP 4.3 w/mysql 4.1.8

2004-12-31 Thread GH
Has anyone had any problems installing phpMyAdmin with the above
configuration? I get an error about the mySql client and
authentication methods? MySQL Error: 1251 : Client does not support
authentication protocol requested by server

Please assist
Happy New Year
Gary

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



[PHP] Which Version To Get?

2004-12-29 Thread GH
Greetings
 I am about to launch on the mission to install PHP4 on my Laptop
running Win XP Pro SP2.

When I go to the download page of the PHP.net website I am presented
with the following for windows

PHP 4.3.10

Windows Binaries
All Windows binaries can be used on Windows 98/Me and on Windows
NT/2000/XP/2003.

PHP 4.3.10 zip package [7,405Kb] - 15 Dec 2004
(CGI binary plus server API versions for Apache, Apache2
(experimental), ISAPI, NSAPI, Servlet and Pi3Web. MySQL support
built-in, many extensions included, packaged as zip)
md5: 0bb30525512ea686abf22c8fe61e1bb6
 
PHP 4.3.10 installer [1,052Kb] - 15 Dec 2004
(CGI only, MySQL support built-in, packaged as Windows installer to
install and configure PHP, and automatically configure IIS, PWS and
Xitami, with manual configuration for other servers. N.B. no external
extensions included)
md5: 6d60129d738e16ea0b69f3fd6646bf3a 


Since there is a difference of 6.4Mbytes what extensions/features are
not included? Also, after installing the Installer version, can I add
in the extra features? If so, how?

Thanks

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



Re: [PHP] Which Version To Get?

2004-12-29 Thread GH
However, I have IIS on this box NOT Apache


On Wed, 29 Dec 2004 15:51:26 +, Richard Davey [EMAIL PROTECTED] wrote:
 Hello GH,
 
 Wednesday, December 29, 2004, 3:20:15 PM, you wrote:
 
 G  I am about to launch on the mission to install PHP4 on my Laptop
 G running Win XP Pro SP2.
 
 G PHP 4.3.10 zip package [7,405Kb] - 15 Dec 2004
 
 Get this one. Sure it doesn't come with an installer, but you don't
 need one anyway. Just un-zip, copy the right files to the right
 places, edit your Apache httpd.conf and voila, one working web server
 on XP. Using this method I have PHP4 and 5 on the same development
 box.
 
 Best regards,
 
 Richard Davey
 --
 http://www.launchcode.co.uk - PHP Development Services
 I am not young enough to know everything. - Oscar Wilde
 
 --
 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] Which Version To Get?

2004-12-29 Thread GH
So going to the ZIP though a harder install will be the best bet?


On Wed, 29 Dec 2004 11:04:11 -0500, Jason Barnett
[EMAIL PROTECTED] wrote:
 Gh wrote:
  However, I have IIS on this box NOT Apache
 
 
 
 It doesn't matter.  It's not terribly difficult to set up PHP and the
 extensions are well worth the download.  Almost guaranteed that once you
 take PHP out for a spin there will be a few extensions that start
 grabbing your attention...
 
 --
 Teach a person to fish...
 
 Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
 PHP Manual: http://php.net/manual/
 php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
 
 --
 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] Installing on Windows.... CGI v. ISAPI?

2004-12-29 Thread GH
#1 what is ISAPI?


#2 which method is better to install PHP with IIS? ISAPI or CGI?

Thanks

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



[PHP] Installing PHP 4.3 on Windows XP with SP2 and IIS

2004-12-29 Thread GH
I am trying to install php 4.3 on Windows XP Pro SP2 w/ IIS ...
(please dont kill me :-))

I am doing it via ISAPI, I am up to the step in the instruction sheet
that says Under Home Directory, click on the 'configuration' button.
Add a new entry to the Application Mappings. Use the path to the
php4isapi.dll / php5isapi.dll as the Executable, supply .php as the
extention, leave 'Method exclusions' blank, and check the 'script
engine' checkbox.'

I did that... but it is not allowing me to click on the OK button...

anyone have advice --- please dont tell me to get Apache :-P

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



[PHP] 4.3.10 mySQL

2004-12-29 Thread GH
Hi all
 I just installed PHP  MySql on my laptop together with IIS (go ahead
and boo)...

 I just ran a ?PHP phpinfo(); ? script to test that the server was
working and got a strange result

it says that I have version  3.23.49  when I have 4.1.8 of mysql
installed on the machine... what happened?

Thanks 

mysql
MySQL Support enabled 
Active Persistent Links  0  
Active Links  0  
Client API version  3.23.49  

Directive Local Value Master Value 
mysql.allow_persistent On On 
mysql.connect_timeout 60 60 
mysql.default_host no value no value 
mysql.default_password no value no value 
mysql.default_port no value no value 
mysql.default_socket no value no value 
mysql.default_user no value no value 
mysql.max_links Unlimited Unlimited 
mysql.max_persistent Unlimited Unlimited 
mysql.trace_mode Off Off

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



Re: [PHP] Installing PHP 4.3 on Windows XP with SP2 and IIS

2004-12-29 Thread GH
Well actually it now works just took a bit of rest and relaxing :)

On Wed, 29 Dec 2004 22:18:25 +, Richard Davey [EMAIL PROTECTED] wrote:
 Hello GH,
 
 Wednesday, December 29, 2004, 9:22:08 PM, you wrote:
 
 G anyone have advice --- please dont tell me to get Apache :-P
 
 You'd have none of these issues if you did. Apache even has a pretty
 installer.
 
 Best regards,
 
 Richard Davey
 --
 http://www.launchcode.co.uk - PHP Development Services
 I am not young enough to know everything. - Oscar Wilde
 
 --
 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] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread GH
The isAttendanceReport() fails... so in the displayMenu() function I get

Print Attendance Sheet
No Attendance Report Available1

 Note that it is good practice to use { } around your statement(s).

I am under the opression that it is only for when you have
multistatement groups and not just a one statement after a condition?
Please correct me if I am wrong.

Thanks

Gary

On Tue, 28 Dec 2004 19:24:28 +0800, Jason Wong [EMAIL PROTECTED] wrote:
 On Tuesday 28 December 2004 13:00, GH wrote:
 
  I am having a problem with some php that I have written...  In an
  attempt to clearly state the problem and how it is supposed to work
  the following may be lengthy, to which I appologize for.
 
 It's better to have a lengthy explanation of what your problem is rather than
 havong to trade posts back and forth trying to determine what your problem
 is, so no need to apologize. NB it is good to have a lengthy explanation but
 not good to post lengthy code.
 
  I am not getting the results that I am expecting.  I am using the
  following url  to access my page.
 
  http://localhost/AHRC_PL/ahrc_programleader/ahrc_programleader.php?SID=1ge
 t_switch=0
 
 So what *do* you get?
 
  In the displayMenu() function it is  (1) supposed to print out a link
  to get an Attendance Sheet for the SID and  (2) check if an attendance
  report exists using the isAttendance Report() function... if there is
  it prints out a link to it (ahrc_programleader.php with SID=$SID and
  get_switch = 1. Otherwise it prints out No Attendance Report
  Available.  the function isAttendanceReport() is supposed to return
  either a 0 if no report or invalid session id or 1 for is a report.
 
  function displayMenu($SID){
  echo a href=\ahrc_programleader.php?SID=.$SID.get_switch=2\Print
  Attendance Sheet /abr /\n;
  if(isAttendanceReport($SID))
   echo a href=\ahrc_programleader.php?SID=. $SID .
  get_switch=1\ Print Attendance Report /a br\n;
  else
 
 Note that it is good practice to use { } around your statement(s).
 
 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Make me look like LINDA RONSTADT again!!
 */
 
 --
 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] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread GH
Ok here is what I get... 

 The isAttendanceReport() fails... so in the displayMenu() function I get
 
  Print Attendance Sheet
  No Attendance Report Available1
 
 OK, so why does isAttendanceReport() return 0?
 
 When debugging it's always a good idea to plugin absolute values where
 possible, ie instead of using isAttendanceReport($SID), use
 isAttendanceReport(1).

When using 1 in the fuction... no change 

During the code... it gets to the following point... 

[snip]
#
# Check if report report is present or not  #
#
if(!mysql_num_rows($dba['results']['attendance_report'])){
#report is not present
return 0;
}
else {
#report is present
return 1;
#gets here
}
[/snip]

it gets to the return 1 section
however the calling statement just does not seem to work

using SID = 1, mysql_num_rows($dba['results']['attendance_report'])
evaluates to 8

Dunno if that helps

 Isolate the problem, just run isAttendanceReport() on its own and plugin
 various values to see what comes back.

How can I do that... I have tried but how do you see what the output
is? I have tried just echo  ing it, print_r, var_dump ...

 
   Note that it is good practice to use { } around your statement(s).
 
  I am under the opression that it is only for when you have
  multistatement groups and not just a one statement after a condition?
  Please correct me if I am wrong.
 
 You're not wrong, like I said it's _good practice_. Say you revise your code
 to add more statements, it is all too easy to forget to put in the braces as
 well thus resulting in faulty logic in your code and you pulling your hair
 out trying to figure what the problem is. PHP's flexibility also means that
 there is more than one way to shoot yourself in the foot (TIMTOWTSYITF (TM)).
 
 BTW PHP is not an oppressive language at all :)
 
 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 The wind doth taste so bitter sweet,
  Like Jaspar wine and sugar,
 It must have blown through someone's feet,
  Like those of Caspar Weinberger.
   -- P. Opus
 */
 
 --
 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] not gettingg desired results... is my programming logic run amuck...

2004-12-28 Thread GH
Ok... Here we go 

 On Tuesday 28 December 2004 23:43, GH wrote:
 
 
  During the code... it gets to the following point...
 
  [snip]
  #
  # Check if report report is present or not  #
  #
  if(!mysql_num_rows($dba['results']['attendance_report'])){
   #report is not present
   return 0;
  }
  else {
   #report is present
   return 1;
   #gets here
  }
  [/snip]
 
  it gets to the return 1 section
 
 Just to be sure, how are you determining that your code does indeed goes to
 the 'else' branch and return 1? Because if it does indeed return 1 then:
 
   echo isAttendanceReport(1); // should display 1
 
 For debugging something like this I would put in echo statements (or
 trigger_error()) all over the place to indicate which part of the code is
 being executed.
 
  however the calling statement just does not seem to work
 
 If isAttendanceReport() did indeed return 1 then the if-clause in
 displayMenu() would be obviously be true and would obviously execute (unless
 you have uncovered a bug in PHP). So the most likely explanation is that
 isAttendanceReport() is NOT returning 1.
 
  using SID = 1, mysql_num_rows($dba['results']['attendance_report'])
  evaluates to 8
 
  Dunno if that helps
 
 How does $dba['results']['attendance_report'] get assigned? What variables
 does it rely on? What variables are present/not present in the case that
 succeeds/fails?

$dba['query']['attendance_report'] = Select A.AttID, P.Part_ID,
P.LastName, P.FirstName, A.Present FROM Attendance A, Participants P,
Sessions S Where P.Part_ID = A.Participant  AND  S.SessionID =
A.Session AND A.Session = .$sd . ' ORDER BY P.LastName ASC';

# attendance_report -- Query is written above.
$dba['results']['attendance_report'] =
mysql_query($dba['query']['attendance_report']) or
die('$dba[\'query\'][\'attendance_report\']: '.mysql_error());

 
   Isolate the problem, just run isAttendanceReport() on its own and plugin
   various values to see what comes back.
 
  How can I do that... I have tried but how do you see what the output
  is? I have tried just echo  ing it, print_r, var_dump ...
 
 By not running unnecessary code. In this case you seemed to have determined
 that isAttendanceReport() is not returning what you think it should be
 returning. Hence running displayMenu() to test for the return value of
 isAttendanceReport() is unnecessary, particularly when the execution of
 displayMenu() is itself subject to a switch construct. So cut through the
 crap and just run isAttendanceReport() direct as in:
 
   echo isAttendanceReport(SOME_VALUE_FOR_SID);
 
 If you still don't get any joy then dig deeper. What isAttendanceReport()
 returns is solely dependent on:
 
   mysql_num_rows($dba['results']['attendance_report'])

This return 8 for some the SID value of 1


 
 As I have hinted above you have to find out what code is setting
 $dba['results']['attendance_report'], what factors (variables) will affect
 that code, and even try running that bit of code direct instead of going
 through isAttendanceReport() (which itself is adding another layer of
 unnecessary complexity).

Most of isAttendanceReport() comes directly from the code of
AttendanceReport() -- the function that fulls the report... the only
thing that it does does diffrently is is check to see if the data is
there instead of displaying the data.

When I was doing the DEBUGGING I had put  echo 'got here(line
number)';  statements during the code and it displayed going through
out the isAttendanceReport().

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



[PHP] Arrays

2004-12-28 Thread GH
Would it be possible in a form fields name to make it an array? 

This way it would be i.e. att[$part_id] 

Now is there a way to iterate through the array when I submit the form
to process it, being that the ID numbers are not going to be
sequential and that there will be some numbers not included?

I.E. the id's would be 1, 5, 6, 7, 20, 43

and how would I refence it? would it be $_POST['att']['[partIDhere}'] ?

Thanks
G

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



[PHP] not gettingg desired results... is my programming logic run amuck...

2004-12-27 Thread GH
Greetings:

I am having a problem with some php that I have written...  In an
attempt to clearly state the problem and how it is supposed to work
the following may be lengthy, to which I appologize for.

I am not getting the results that I am expecting.  I am using the
following url  to access my page.

http://localhost/AHRC_PL/ahrc_programleader/ahrc_programleader.php?SID=1get_switch=0


the ahrc_programleader.php file is supposed to use  switch/case
statement to determine what action to take:

switch ($_GET['get_switch']){
case 0:
displayMenu($_GET['SID']);
break;
case 1:
attendanceReport($_GET['SID']);
break;
case 2:
attendanceSheet($_GET['SID']);
break;
default:
// Return Error Message ## TO BE CODED LATER
// Reprint Menu 
}

In the displayMenu() function it is  (1) supposed to print out a link
to get an Attendance Sheet for the SID and  (2) check if an attendance
report exists using the isAttendance Report() function... if there is
it prints out a link to it (ahrc_programleader.php with SID=$SID and
get_switch = 1. Otherwise it prints out No Attendance Report
Available.  the function isAttendanceReport() is supposed to return
either a 0 if no report or invalid session id or 1 for is a report.

function displayMenu($SID){
echo a href=\ahrc_programleader.php?SID=.$SID.get_switch=2\Print
Attendance Sheet /abr /\n;
if(isAttendanceReport($SID)) 
echo a href=\ahrc_programleader.php?SID=. $SID .
get_switch=1\ Print Attendance Report /a br\n;
else
{
echo No Attendance Report Available; 
echo $SID; // DEBUG CODE 
}

#echo Enter Attendance br \n;## TO BE CODED LATER
#echo Print Progress Notes br\n; ## TO BE CODED LATER
#echo Print Progress Notes with Attendance br\n;  ## TO BE CODED LATER
#echo View Participantsbr\n;  
}

I know for a fact that an attendance report exists for the given SID.
Because when I manually put in the URL with the get_switch value = 1
(http://localhost/AHRC_PL/ahrc_programleader/ahrc_programleader.php?SID=1get_switch=1)
it displays the report.

When I was testing the code after it not returning results, I had
attempted to make sure that it was going through the logic and was
reaching the return 1; statement and it was... so I am perplexed...

Below I have placed links to the full code for both pages.



Additional code file: isAttendanceReport.php code is available at
http://pastebin.com/133993

Additional code file: ahrc_programleader.php code is available at
http://pastebin.com/134014


Thank You in advance
Gary

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



Re: [PHP] Mandrake 10.1

2004-12-25 Thread GH
I want to know before I upgrade to it... i am running 10.0 communty right now


On Sat, 25 Dec 2004 13:48:43 +0530, Zareef Ahmed [EMAIL PROTECTED] wrote:
 its so simple run phpinfo() in a simple script, you will get the version of 
 both
 
 zareef ahmed
 
 
 On Sat, 25 Dec 2004 00:27:54 -0500, GH [EMAIL PROTECTED] wrote:
  This may be off topic.. but does anyone know what versions of PHP and
  MySql Mandrake is shipping with 10.1 Offical?
 
  Thanks
  
  --
  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] MP3s

2004-12-24 Thread GH
Thank you will look at these after the holidays when I get back to
the project


On Thu, 23 Dec 2004 08:44:20 -0800, Robby Russell [EMAIL PROTECTED] wrote:
 .m3u does this
 
 For example:
 
  $ cat the_vacant_-_live_10192004_full_show.m3u
  http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_01_-_ladders_to_the_moon.mp3
  http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_02_-_rooftop_rocketship.mp3
  http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_03_-_perception.mp3
  http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_04_-_song_1.mp3
  http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_05_-_the_cure_got_in_her_head.mp3
  http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_06_-_red_light.mp3
  http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_07_-_bliss.mp3
 
 Cheers,
 
 Robby
 
 On Thu, 2004-12-23 at 11:18 -0500, David Dickson wrote:
  I think if you generate a .m3a file with just the full url of your mp3
  and send that to download in the browser this will launch the users mp3
  player which will then stream the mp3 that was contained in the file.
 
  GH wrote:
   I appologize in advanced if this is an off topic discussion...
  
   I am working on a PHP based website and would like to offer media to
   my visitors... I have the Audio in WMA and MP3 formats... I would like
   to know how I could get them to Stream? inline... using PHP any
   advice would be greatfully appreciated
  
  
   Thanks in advance
  
   Happy Holidays
   Gary
  
 
 -- 
 /***
 * Robby Russell | Owner.Developer.Geek
 * PLANET ARGON  | www.planetargon.com
 * Portland, OR  | [EMAIL PROTECTED]
 * 503.351.4730  | blog.planetargon.com
 * PHP/PostgreSQL Hosting  Development
 *--- Now supporting PHP5 ---
 /
 
 --
 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] Mandrake 10.1

2004-12-24 Thread GH
This may be off topic.. but does anyone know what versions of PHP and
MySql Mandrake is shipping with 10.1 Offical?

Thanks

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



[PHP] MP3s

2004-12-23 Thread GH
I appologize in advanced if this is an off topic discussion...

I am working on a PHP based website and would like to offer media to
my visitors... I have the Audio in WMA and MP3 formats... I would like
to know how I could get them to Stream? inline... using PHP any
advice would be greatfully appreciated


Thanks in advance

Happy Holidays
Gary

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



[PHP] IDE recommendation-- (Free?)

2004-12-17 Thread GH
Hi...

 I am looking for a FREE PHP IDE that uses syntax highlighting and
code completion amongst other features...

Do any of you have any recommendations... again I am looking for FREE
(not much budget for me)?

I use BOTH Linux and Windows

Thanks
Gary

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



[PHP] Scope issue

2004-12-17 Thread GH
Hi I am having an issue with I think it is the scope of variables:

I have a file that I am including which has the following

?php
// +--
// | PHP Source   
// +--
//

echo got language.phpbr /;

global $langauge;
$language['project_name'] = P.L.I.M.S;
$language['sub_project_name'] = DCR CC;
?

In my main file, I am attempting to from with in a function call
$language['project_name'] and i am failing... can you offer any
advice?

Thanks

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



Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread GH
I will try this when i get back to my other computer where development
takes place the script format was originally started by an IDE
that I am starting to add my code to ... so I will look at.


On Thu, 16 Dec 2004 18:19:43 -, Ford, Mike [EMAIL PROTECTED] wrote:
 To view the terms under which this email is distributed, please go to 
 http://disclaimer.leedsmet.ac.uk/email.htm
 
 
 On 16 December 2004 17:39, GH wrote:
 
  Hi All...
  Got a problem...  here is the error: Parse error: parse error,
  expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
  /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
  am not sure on how to fix it...
 
  line 42 is: TITLE $language['program_name'] /TITLE\n .
 
 TITLE {$language['program_name']} /TITLE\n .
 
 But:
 
 
  function printHeader(){
echo !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\\n
 .
  \http://www.w3.org/TR/REC-html40/loose.dtd\;HTML\n .
  HEAD\n .
  meta name=\description\ content=\\ \n .
  meta name=\author\ content=\Gary H\\n .
  meta name=\keywords\ content=\\ \n .
  meta http-equiv=\Content-Type\ content=\text/html;
 charset=iso-8859-1\\n .
  TITLE $language['program_name'] /TITLE\n .
  /HEAD\n.
  BODY\n;
 
 This is messy and somewhat unreadable.  I would suggest either a heredoc:
 
 function printHeader(){
   echo HEAD
 !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN
 http://www.w3.org/TR/REC-html40/loose.dtd\;
 HTML
 HEAD
 meta name=description content= 
 meta name=author content=Gary H
 meta name=keywords content= 
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 TITLE {$language['program_name']} /TITLE
 /HEAD
 BODY
 HEAD;
 }
 
 or escaping from PHP into raw HTML:
 
 function printHeader(){
 ?
 !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN
 http://www.w3.org/TR/REC-html40/loose.dtd\;
 HTML
 HEAD
 meta name=description content= 
 meta name=author content=Gary H
 meta name=keywords content= 
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 TITLE ?php echo $language['program_name'] ? /TITLE
 /HEAD
 BODY
 ?php
 }


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



Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread GH
Ok... thank you.



On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote:
 GH wrote:
  Hi All...
  Got a problem...  here is the error: Parse error: parse error,
  expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
  /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
  am not sure on how to fix it...
 
  line 42 is: TITLE $language['program_name'] /TITLE\n .
 
 
 either one:
 
 1. TITLE $language[program_name] /TITLE\n .
 
 2. TITLE {$language['program_name']} /TITLE\n .
 
 3. TITLE . $language['program_name'] . /TITLE\n .


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


Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread GH
However, I can not get any results into the title tags all three
options are not displaying


On Thu, 16 Dec 2004 13:03:57 -0500, GH [EMAIL PROTECTED] wrote:
 Ok... thank you.
 
 
 On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote:
  GH wrote:
   Hi All...
   Got a problem...  here is the error: Parse error: parse error,
   expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
   /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
   am not sure on how to fix it...
  
   line 42 is: TITLE $language['program_name'] /TITLE\n .
  
 
  either one:
 
  1. TITLE $language[program_name] /TITLE\n .
 
  2. TITLE {$language['program_name']} /TITLE\n .
 
  3. TITLE . $language['program_name'] . /TITLE\n .
 


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


[PHP] Parse Error... how to fix?

2004-12-16 Thread GH
Hi All... 
Got a problem...  here is the error: Parse error: parse error,
expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
/var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
am not sure on how to fix it...

line 42 is: TITLE $language['program_name'] /TITLE\n .


The language.php file only has: $language['program_name'] = AHRC
Computer Club Program Leader Information Managment;


Thank you for any and all assistance provided 

This is the entire ahrc_computerclub.php file:

?PHP

#AHRC Program Leader Information Management#
#Copyright (C) 2004 by Gary H  #
#EMAIL INFORMATION HERE   #

#   This project is intended for Gary's use only and not to be distributed #


# include language file
include_once(language.php);


#  DOCUMENT OUTPUT   ##START   #


printHeader();
echo $language['program_name'];
printFooter();


#  DOCUMENT OUTPUT   ##END #



#  FUNCTION DEFINITIONS SECTION#


function printVersion(){
$version = 0.1;
return $version;
}

function printHeader(){
  echo !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\\n .
\http://www.w3.org/TR/REC-html40/loose.dtd\;HTML\n . 
HEAD\n .
meta name=\description\ content=\\ \n .
meta name=\author\ content=\Gary H\\n .
meta name=\keywords\ content=\\ \n .
meta http-equiv=\Content-Type\ content=\text/html;
charset=iso-8859-1\\n .
TITLE $language['program_name'] /TITLE\n .
/HEAD\n. 
BODY\n;
}

function printFooter(){
  echo \n/BODY/HTML;
}

?

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


Re: [PHP] Web Development Overnight!!!

2004-12-13 Thread GH
Supprisedly, Register.com still charges alot

 $35/1 year
$70/2 years
$150/5 years
$299/10 years



On Mon, 13 Dec 2004 22:16:00 -0500, Josh
[EMAIL PROTECTED] wrote:
 $70 for a domain name registration?   A domain name only costs $6 or $7 US
 dollars per year...
 
 
 
 --
 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] Need Help

2004-12-02 Thread GH
Basically 

They are the same... some servers might not have ? enabled... all the
demos I have seen and tutorials use ?PHP ? That seems to be the
standard



On Fri, 3 Dec 2004 09:32:34 +0530, suneel [EMAIL PROTECTED] wrote:
 Hi to all
 
any one Could tell me any diffrence between ?php ?  and ? ?. 
 And which one is better to use and in which situations.
 
 Byee


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



[PHP] Automatically Escape?

2004-11-16 Thread GH
Is there a function that can automatically escape special characters
before putting them into mySQL?

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



[PHP] Automatically Escape?

2004-11-16 Thread GH
-- Forwarded message --
From: GH [EMAIL PROTECTED]
Date: Tue, 16 Nov 2004 08:45:08 -0500
Subject: Re: [PHP] Automatically Escape?
To: Jordi Canals [EMAIL PROTECTED]


What is the Diffrencce between mysql_escape_string and mysql_real_escape_string?




On Tue, 16 Nov 2004 14:34:43 +0100, Jordi Canals [EMAIL PROTECTED] wrote:
 On Tue, 16 Nov 2004 12:33:15 +, Richard Davey [EMAIL PROTECTED] wrote:

  G Is there a function that can automatically escape special characters
  G before putting them into mySQL?
 
  See magic_quotes to have it done for you. Although this isn't a
  recommend approach if you plan to distribute your application, in
  which case mysql_escape_string() is the one.

 Just a comment :

 Note:  This function (mysql_escape_string) has been deprecated since
 PHP 4.3.0. Do not use this function. Use mysql_real_escape_string()
 instead.

 So, if you're coding new scripts is better to use mysql_real_escape_string().

 Best regards,
 Jordi.



 --
 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] Auto Form Fill on option select

2004-11-08 Thread GH
prado? Hunh?


On Sun, 7 Nov 2004 14:56:36 -0600 (CST), Jonel Rienton [EMAIL PROTECTED] 
wrote:
 This can be done with javascript or you can use an  event-driven solution
 like PRADO
 
 
 
  Hi all,
  I have a question that I can't get my head around and was hoping
  someone
  could answer for me.
 
  I have a form with a number of fields.
 
  Field one is a tdselect name=thisSteamField/td
  The option fields are built from an sql statement and a where clause
  builds the options fields
  ...
  option value=? echo $teamname; ?? echo
  $teamname;
  ?/option
  
  etc...
 
  When I select one of the options, the form automatically goes off and
  does another sql select a with the WHERE value of the selected
  $teamname,  and then populates the next field, but I can't think how.
 
  Any pointers?
 
  TIA
  K
 
 
 --
 
 --
 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] November 2, 2004

2004-11-01 Thread GH
Greetings:

  This is just a friendly reminder that if you are registered in the
United States to VOTE on November 2, 2004 (TOMORROW)

  Need to know where you vote?

 Please see the attached file (it is an image) that contains some information

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

[PHP] Getting Information From Another Page

2004-10-31 Thread GH
I would like to know how to extract the following from the website
http://www.state.ny.us/security/

The Values for

New York State is currently at:   

New York City is currently at:  

I would like to store this information into my database and check it
every half hour to see if it has been updated?

How can I do this?

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



Re: [PHP] Re: Best way to allow a user to indicate formatting to be displayed but stored.

2004-10-20 Thread GH
I guess this means I do not have pear... right?


Warning: main(): open_basedir restriction in effect.
File(/usr/share/pear/PEAR.php) is not within the allowed path(s):
(/var/www/garyhotko.com) in /var/www/garyhotko.com/html/Test/test.php
on line 2

Warning: main(PEAR.php): failed to open stream: Operation not
permitted in /var/www/garyhotko.com/html/Test/test.php on line 2

Warning: main(): open_basedir restriction in effect.
File(/usr/share/pear/PEAR.php) is not within the allowed path(s):
(/var/www/garyhotko.com) in /var/www/garyhotko.com/html/Test/test.php
on line 2

Warning: main(PEAR.php): failed to open stream: Operation not
permitted in /var/www/garyhotko.com/html/Test/test.php on line 2

Fatal error: main(): Failed opening required 'PEAR.php'
(include_path='.:/usr/share/pear') in
/var/www/garyhotko.com/html/Test/test.php on line 2


On Thu, 30 Sep 2004 18:17:05 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote:
 GH wrote:
  Thank you all for the information... however at a second look I
  realized that I failed to better describe my needs...
 
  My current plan is to have a series of articles and information stored
  in my database...
 
  The table will have a ID, Title, Author, Image, Content, Date/Time
 
  What I would like to have is say someone needs to do a sub heading...
  I would like to have it automatically be the same subheading format
  for all of the content... in addition to the formatting...
 
 The answer is CSS.
 
 
  Also... I saw one refer to PEAR, since I am on a shared server is
  there a way to test if pear is available... (never worked with it and
  am still new to PHP sorry)
 
 ?php
 require('PEAR.php');
 ?
 
 If that does not give you error, PEAR is installed. Not necessarily all
 packages.


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



Re: [PHP] Square brackets tags

2004-10-19 Thread GH
I am thinking in theory include() the file in to a wrapper php file
that can then do as Marco says evaluate or do a series of
str_replaces?

[quote from previous emails]

I'm sure there are. For example you can convert the string using
htmlspecialchars, and then convert only allowed tags back:

$text = htmlspecialchars($_POST['text']);

$replace_to = array('b', '/b');

$replace_from = array();
foreach($replace_to as $tag) {
  $replace_from[] = htmlspecialchars($tag);
}

$text = str_replace($replace_from, $replace_to, $text);


Or you can install pear in your account, just unpack the archive and set
include_path.


 Matthew Fonda  to GH, php-general 
  More options  Sep 29 

Typically people use BBCode to do this.
This mean the user will enter something like
[b]this is bold[/b] or [i]italic[/u] and the BBCode will be parsed and
transformed into HTML when the page is displayed. There are many parsers
already written to do this, or you could make your own, or use PEAR:
http://pear.php.net/package/HTML_BBCodeParser




[/quote]


On Tue, 19 Oct 2004 22:09:31 +0200, Marco Bambini [EMAIL PROTECTED] wrote:
 
 On 19/ott/04, at 20:34, Greg Donald wrote:
 
  On Tue, 19 Oct 2004 20:13:23 +0200, Marco Bambini
  [EMAIL PROTECTED] wrote:
  I need to write a PHP extension or a PHP template system (this is the
  question) to parse some commands enclosed in square brackets inside
  web
  pages. Please note that the commands are in the form [command1] and
  not
  ?php [command1] ?.
  I want use PHP because these commands needs to be remapped with a web
  oriented language.
 
  Is it technically possible to remap these square brackets tags to php?
  And if yes, what is the best way? A custom template system or a C PHP
  extension?
 
  Why not just write PHP code normally and use eval() to parse it out?
 
 I can't alter the code. I need PHP to execute these commands but I
 can't write PHP code inside that pages.
 
 Any help?
 
 Thanks,
 Marco Bambini
 
 
 
 --
 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] Is there a way to...

2004-10-16 Thread GH
Is there a way to make sure that a page is only loaded via a 

require or include statement? or other type of SSI? 

I would like to make sure that a 'parent document'  (namely
admin_template.php) only calls the php file?

Thanks

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



Re: [PHP] Is there a way to...

2004-10-16 Thread GH
Your right, this is not what I was expecting, I was thinking there was
another way...  Sounds good.. but any other suggestions?




On Sat, 16 Oct 2004 21:40:56 -0400, Minuk Choi [EMAIL PROTECTED] wrote:
 well, this is probably not what you were expecting... but you can try this
 
 admin_template.php
 --
 $parent = true;
 include('important.php');
 --
 
 important.php
 --
 if (!isset($parent) || !$parent)
 exit();
 
 //important stuff here.
 --
 
 Of course, this only works assuming that the would-be hacker doesn't know
 HOW you are authenticating the file.  If you are going to try this method,
 mix it up, use a rather unique variable name and or use a value that is hard
 to guess.
 
 -Minuk
 
 
 
 
 - Original Message -
 From: GH [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Saturday, October 16, 2004 9:15 PM
 Subject: [PHP] Is there a way to...
 
  Is there a way to make sure that a page is only loaded via a
 
  require or include statement? or other type of SSI?
 
  I would like to make sure that a 'parent document'  (namely
  admin_template.php) only calls the php file?
 
  Thanks
 
  --
  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] PHP App User Permissions Tecnique

2004-10-16 Thread GH
However I would think that using the db would allow for you to change
the persons while they are using the site and would not make them have
to  relog in

suggestions?


On Fri, 15 Oct 2004 10:52:53 +0200, Ian Firla [EMAIL PROTECTED] wrote:
 
 Definitely store them in a session. A db lookup will mean a much heavier
 and process intensive procedure.
 
 Ian
 
 
 
 On Fri, 2004-10-15 at 09:41, Brendon wrote:
  I am building a web based community forum type software using PHP. I am
  currently working on how different user privelages are handled. Each
  user is part of a group and each group has varying degrees of privelages.
 
  I need to add in functionality which at the begginning of every script
  check the permission level of the user accessing the page. There are
  about 15 different permissions.
 
  I am debating whether i should store all the permission abilities into
  session variables and they can quickly be checked throughout the script,
  or whether i should query the database to check to see if the user has
  adequate group permissions to perform a certain function.
 
  Could someone give me some advice as to which would be more advisable?
 
 --
 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] Tutorials for Maintenance of State

2004-10-14 Thread GH
I found it interesting... you did a good job. 

However I am running confused laps in my brain on what do I do to
actually set it up...  I know about sessions... but I am even more
concerened now about the use of cookies but I am not 100% sure on how
to accomplish this

when I was dabbling in ColdFusion a few years ago... this was my main
co(ld)nfusion...  I know i am probably rambiling so

Any advice or starting points would be great



On Tue, 12 Oct 2004 14:12:37 -0700 (PDT), Chris Shiflett
[EMAIL PROTECTED] wrote:
 
 
 --- GH [EMAIL PROTECTED] wrote:
  I would like to know if someone out there has or knows of a tutorial
  on Maintenance of State that allows only users who have logged in to
  successfully visit view pages?
 
 You might find this helpful, if I'm interpreting your question correctly:
 
 http://shiflett.org/articles/the-truth-about-sessions
 
 Hope that helps.
 
 Chris
 
 =
 Chris Shiflett - http://shiflett.org/
 
 PHP Security - O'Reilly HTTP Developer's Handbook - Sams
 Coming December 2004http://httphandbook.org/


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



[PHP] Tutorials for Maintenance of State

2004-10-12 Thread GH
I would like to know if someone out there has or knows of a tutorial
on Maintenance of State that allows only users who have logged in to
successfully visit view pages?

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



Re: [PHP] Tutorials for Maintenance of State

2004-10-12 Thread GH
I will look into the into all of the items discussed and probably will
be sending in some questions


On Tue, 12 Oct 2004 16:17:37 -0500, Greg Donald [EMAIL PROTECTED] wrote:
 
 
 On Tue, 12 Oct 2004 16:43:42 -0400, GH [EMAIL PROTECTED] wrote:
  I would like to know if someone out there has or knows of a tutorial
  on Maintenance of State that allows only users who have logged in to
  successfully visit view pages?
 
 You can store most anything in a PHP session, variables, objects, etc.
 
 --
 Greg Donald
 Zend Certified Engineer
 http://gdconsultants.com/
 http://destiney.com/
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] Lost in PHP (part 1) ---- Sequle to Lost in Query

2004-10-11 Thread GH
How can I convert it to an integer aslong as it is only a number in the string?



On Mon, 11 Oct 2004 13:19:40 -0400, John Holmes
[EMAIL PROTECTED] wrote:
 GH wrote:
 
  Now I m perplexed time 10!
 
 I run the code that follows this time providing a query string
  of admin_template.php?api=101
 
  I have an if statement that tests if $_GET['api'] == 0  if it is
  true I have it listing options, else it queries the database with that
  ID and loads the associated file.
 
 You have a lot more tests than that...
 
  However it does not seem to execute the else
 
  I: thought that the value may of been wrong so I usedecho
  $_GET['api']; and it returned 101
 
 use var_dump($_GET['api']) and it may give you a clue. Your is_int()
 test is going to fail each time because anything passed through $_GET or
  $_POST is a string.
 
 FYI, you could essentially replace all of those tests you do on
 $_GET['api'] with
 
 if(empty($_GET['api']))
 {
   echo 'bad value';
   //or select everything from table ?
 }
 else
 {
   $input['api'] = (int)$_GET['api'];
   $query = SELECT * FROM yourtable WHERE api = {$input['api']};
   ...
 }
 
 --
 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals  www.phparch.com
 


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



Re: [PHP] Lost in PHP (part 1) ---- Sequle to Lost in Query

2004-10-11 Thread GH
Re: Does it _really_ matter if only a number is passed? 
 I would think so since if someone is trying to pass a string that is
not proper it should be treated as such and not as if they are just
take the first set of numbers and Throw away all the rest.

 Maybe I am over thinking this or I am being paranoid

  I am trying to make this work good and hope to design it to be
secure since this is my first PHP endevor

Thanks
G


On Mon, 11 Oct 2004 14:02:08 -0400, John Holmes
[EMAIL PROTECTED] wrote:
 GH wrote:
 
  How can I convert it to an integer aslong as it is only a number in the string?
 
 Does it _really_ matter if only a number is passed? If someone passes
 abcd and it's converted to an integer, it'll be zero. Then your query
 will not return any rows (which you're already testing for, anyhow,
 right?) and be handled accordingly. Who cares if they pass 104abcd?
 It'll just be converted to 104 and see if a matching record exists.
 
 I think you're getting caught up in too many tests. If you're expecting
 an integer, MAKE it an integer, then run your query. 99.9% of your
 values are going to come through correct if they are coming from your
 program, right? Just silently ignore the rest because it's someone
 screwing around.
 
 If, however, you _really_ want to ensure $_GET['api'] is _only_ numbers,
 then you can use
 
 if(!isset($_GET['api']) || preg_match('/[^0-9]/',$_GET['api']))
 { echo 'API is not all numbers'; }
 
 or
 
 if(isset($_GET['api'])  preg_match('/^[0-9]+$/',$_GET['api']))
 { echo 'API is a number only'; }
 
 
 
 --
 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals  www.phparch.com
 


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



[PHP] Lost in query... Trying to get output from query....

2004-10-11 Thread GH
Greetings:

 I am having a problem with trying to get data out of my mySql database.

I run my query which works fine and everything... 

I use: 

$admin_get_options_query_text = Select * from adminpage;

$admin_get_options_results_reference =
mysql_query($admin_get_options_query_text,$db_access) or die(Admin
Get Options: . mysql_error());

$admin_get_options_result =
mysql_fetch_assoc($admin_get_options_results_reference);


-

When I run the query in mysql directly the results are. 

mysql Select * from adminpage;
+-++--+
| adminpageid | file_name  | description  |
+-++--+
| 101 | nycalertstatus.php | Change New York City Threat Alert Status |
+-++--+
1 row in set (0.00 sec)



my problem is that I would like to get that output into my php
codeI would like to have something that goes like this for each
record..

The api# $adminpageid allows you to $description, and uses the file #file_name


can anyone please assist.

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



Re: [PHP] Lost in query... Trying to get output from query....

2004-10-11 Thread GH
Thank You Murray's suggestion worked


On Mon, 11 Oct 2004 11:20:57 -0400, John Nichel [EMAIL PROTECTED] wrote:
 GH wrote:
  Greetings:
 
   I am having a problem with trying to get data out of my mySql database.
 
  I run my query which works fine and everything...
 
  I use:
 
  $admin_get_options_query_text = Select * from adminpage;
 
  $admin_get_options_results_reference =
  mysql_query($admin_get_options_query_text,$db_access) or die(Admin
  Get Options: . mysql_error());
 
  $admin_get_options_result =
  mysql_fetch_assoc($admin_get_options_results_reference);
 
 If the query is going to return multiple rows, you need to loop thru the
 result set...
 
 while ( $admin_get_options_result =
 mysql_fetch_assoc($admin_get_options_results_reference) ) {
// do stuff with each row returned
 }
 
 --
 John C. Nichel
 ÜberGeek
 KegWorks.com
 716.856.9675
 [EMAIL PROTECTED]
 
 
 
 --
 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] Lost in PHP (part 1) ---- Sequle to Lost in Query

2004-10-11 Thread GH
Now I m perplexed time 10!

   I run the code that follows this time providing a query string
of admin_template.php?api=101

I have an if statement that tests if $_GET['api'] == 0  if it is
true I have it listing options, else it queries the database with that
ID and loads the associated file.

However it does not seem to execute the else 

I: thought that the value may of been wrong so I usedecho 
$_GET['api']; and it returned 101

what am i doing wrong?




CODE-
html
head
titleCB12M CERT TEAM ADMINISTRATION SCREEN/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body

?PHP 
require 'mod/db_access.php';

echo 'this is a test of the system br'. $_GET[api] ;

if(!isset($_GET['api']) || (isset($_GET['api']) 
((strlen(trim(urldecode($_GET['api']))) == 0) ||
(!is_int($_GET['api'])
$_GET['api']=0;

if((isset($_GET['api'])  ((strlen(trim(urldecode($_GET['api']))) ==
0) || (!is_int($_GET['api'])
echo 'strong ERROR: /strong the page identifier provided is not
valid. Please try again.';


if($_GET['api'] == 0)
{
$admin_get_options_query_text = Select * from adminpage;
$admin_get_options_results_reference =
mysql_query($admin_get_options_query_text,$db_access) or die(Admin
Get Options: . mysql_error());

if(mysql_num_rows($admin_get_options_results_reference)0)
{   
?

table width=600
TR TD Link /TD TD DESCRIPTION /TD/TR
?PHP
while($admin_get_options_result =
mysql_fetch_assoc($admin_get_options_results_reference)){
echo 'TR TD';
echo 'a 
href=?api='.urlencode($admin_get_options_result['adminpageid']).'
Click Here /a /td';
echo 
'TD'.$admin_get_options_result['description'].'/TD/TR';
}

Mysql_free_result($admin_get_options_results_reference);

?

/table

?PHP 
}
}
else
{
  $admin_get_page_query_text = Select * from adminpage Where
adminpageid =. $_GET['api'].  LIMIT 1;
  $admin_get_page_results_reference =
mysql_query($admin_get_page_query_text,$db_access) or die(Admin Get
Page: . mysql_error());
  $admin_get_page_result = mysql_fetch_row($admin_get_page_result_reference);

  if (mysql_num_rows($admin_get_page_results_reference)  0)
  {
require mod/admin/.trim(strtolower($admin_get_page_result[1]));
  }
  else
  {
echo ERROR: Invalid Admin Page Requested br;
echo 'Please Try Again ... a href=admin_template.php?api=0 Click
Here /a';
  }
  
}   
?
/body
/html

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



[PHP] If statement question...

2004-10-10 Thread GH
I would like to know how I can code the the following conditional
check if the $_GET['api'] does not exist, or is either set and has
no length or is set and is not an integer.


I am drawing a blank on the if statement to use

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



[PHP] Parse Error --- can not solve at this time... please assit

2004-10-10 Thread GH
With the following code, I am getting the following message
Parse error: parse error, expecting `')'' in
/var/www/html/cert/admin_template.php on line 30


Line 30 Reads as follows:

 foreach($admin_get_options_result as $api = $file, $desc)

Can any one please assist.

***ENTIRE CODE STARTING AT LINE 1 FOLLOWS *
html
head
titleADMINISTRATION SCREEN/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body

?PHP 
require 'mod/db_access.php';

echo 'this is a test of the system';

if(!isset($_GET['api']) || (isset($_GET['api']) 
((strlen(trim(urldecode($_GET['api']))) == 0) ||
(!is_int($_GET['api'])
$_GET['api']=0;

if($_GET['api'] == 0)
{
$admin_get_options_query_text = Select * from Adminpage;
$admin_get_options_results_reference =
mysql_query($admin_get_options_query_text,$db_access) or die(Admin
Get Options: . mysql_error());
$admin_get_options_result =
mysql_fetch_assoc($admin_get_options_result_reference);

if(mysql_num_rows($admin_get_options_results_reference)0)
{   
?

table width=600
TR TD Link /TD TD DESCRIPTION /TD/TR
?PHP
foreach($admin_get_options_result as $api = $file, $desc)
{
echo 'TR TD';
echo 'a href=#?api'.urlencoded($api).' Click Here 
/a /td';
echo 'TD'.$desc.'/TD/TR';
}
?

/table

?PHP 
}
}
else
{
  $admin_get_page_query_text = Select * from Adminpage Where
adminpageid = $_GET['api'] LIMIT 1;
  $admin_get_page_results_reference =
mysql_query($admin_get_page_query_text,$db_access) or die(Admin Get
Page: . mysql_error());
  $admin_get_page_result = mysql_fetch_row($admin_get_page_result_reference);

  if (mysql_num_rows($admin_get_page_results_reference)  0)
  {
require mod/admin/.trim(strtolower($admin_get_page_result[1]));
  }
  else
  {
echo ERROR: Invalid Admin Page Requested br;
echo 'Please Try Again ... a href=admin_template.php?api=0 Click
Here /a';
  }
  
}   
?
/body
/html

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



[PHP] Image Manipulation

2004-10-01 Thread GH
I would like to know if there is a way to have PHP determine the
dimensions of an image (i.e. JPG or PNG) and if it more than Xpx wide
or height have it scale it down proportionally to that width or
height?

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



[PHP] READ BEFORE REPLYING TO : Re: [PHP] UNSUBSCRIBE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2004-10-01 Thread GH
Dear EVERYONE WHO HAS POSTED OR WANTS TO POST IN THIS THREAD...

If Ms. Holland managed to get herself off of this list she is not
seeing any of this... however you seem to be FLAMING the rest of the
board with information that is NOT PHP related NOR is it relevant to
ANY DISCUSSION that pertains to a PHP related topic... i.e.
PEAR/DataBase/Servers etc...

CAN WE PLEASE CONSIDER THIS MATTER TO BE CLOSED?
Twenty Four Messages (not counting this #25)  of which almost 18 of
them have been not relavent to this subject. Yes, yesterday it could
be said that it was nice to have a joke at her blatent inability to
not read the unsubscribe instructions even if they are at the end of
each message! However, these messages have been either (1) Beating
around the same bush again and again... or (2) Personal and Rude
attacks at an individual.

Can we please move on to more PHP related discussions... 

Thank You
Gary


On Fri, 1 Oct 2004 19:22:26 -0700 (PDT), Mag [EMAIL PROTECTED] wrote:
 Prick.
 
 =
 --
 - The faulty interface lies between the chair and the keyboard.
 - Creativity is great, but plagiarism is faster!
 - Smile, everyone loves a moron. :-)
 
 
 __
 Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.
 http://promotions.yahoo.com/new_mail 
 
 
 
 --
 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: Best way to allow a user to indicate formatting to be displayed but stored.

2004-09-30 Thread GH
Thank you all for the information... however at a second look I
realized that I failed to better describe my needs...

My current plan is to have a series of articles and information stored
in my database...

The table will have a ID, Title, Author, Image, Content, Date/Time

What I would like to have is say someone needs to do a sub heading...
I would like to have it automatically be the same subheading format
for all of the content... in addition to the formatting...

Also... I saw one refer to PEAR, since I am on a shared server is
there a way to test if pear is available... (never worked with it and
am still new to PHP sorry)

thanks


On Wed, 29 Sep 2004 13:51:41 -0400, GH [EMAIL PROTECTED] wrote:
 I am looking for the best way to have a user enter information and
 format it ... i.e. Bold, Italics, etc... with out havng to use the
 HTML commands...
 
 Using PHP4.
 
 Any suggestions...


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



Re: [PHP] UNSUBSCRIBE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2004-09-30 Thread GH
did anyone call?


On Thu, 30 Sep 2004 10:26:08 -0500, Jay Blanchard
[EMAIL PROTECTED] wrote:
 [snip]
 Can we start mass flaming this guy? Ok one nice one...
 
 Denise Holland
 ITM - Network Support
 703-358-1823
 [/snip]
 
 I vote we all call her
 
 
 
 --
 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] Re: Best way to allow a user to indicate formatting to be displayed but stored.

2004-09-30 Thread GH
On Thu, 30 Sep 2004 18:17:05 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote:
 GH wrote:
  Thank you all for the information... however at a second look I
  realized that I failed to better describe my needs...
 
  My current plan is to have a series of articles and information stored
  in my database...
 
  The table will have a ID, Title, Author, Image, Content, Date/Time
 
  What I would like to have is say someone needs to do a sub heading...
  I would like to have it automatically be the same subheading format
  for all of the content... in addition to the formatting...
 
 The answer is CSS.

from what I understand it phpBB works only for BBcode... so how would
I be able to make is so that they do not manually have to change the
CSS or apply the CSS?

 
 
  Also... I saw one refer to PEAR, since I am on a shared server is
  there a way to test if pear is available... (never worked with it and
  am still new to PHP sorry)
 
 ?php
 require('PEAR.php');
 ?
 
 If that does not give you error, PEAR is installed. Not necessarily all
 packages.


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



Re: [PHP] Session Variable Security

2004-09-30 Thread GH
Brian: 

What way should you not reference session variables? I seem to have
missed that part of the discussion... Sorry.

Gary


On Thu, 30 Sep 2004 10:17:51 -0500, Brian [EMAIL PROTECTED] wrote:
 Along with the other tips people gave, make sure that if you have
 register globals turned on, do not ever reference a session variable
 that way, always use $_SESSION
 
 
 
 
 On Thu, 30 Sep 2004 08:39:42 -0400, Aaron Todd [EMAIL PROTECTED] wrote:
  Can anyone tell me how secure a session variable is.  I realize that if
  someone wanted to take the time to break into my site they will eventually
  succeed, but I dont want to make it too easy.  I have a database that stores
  a username and an encrypted password which both are verifyed when the user
  logs in to the site.  Then I have a session variable that I am checking for
  on all other pages that tells the page that they are logged in.  I also have
  a session variable that holds the users ID in the database.  Certain pages
  reference that ID to show the user there data.  Mainly used for a My Account
  page.  But If I'm logged in, how easy would it be, if its even possible, to
  change the session variable that holds my ID to someone elses ID so I can
  get their data.
 
  I hope I have explained myself enough for someone to know what I am talking
  about.  If anyone has some good web sites on session security I'd really
  like to read them.
 
  Thanks,
 
  Aaron
 
  --
  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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Images in PHP and MySQL

2004-09-30 Thread GH
HEre is a question that I have been wondering about:

   - Does the image file use more space in the db or as a file itself
(Do Not count the extra data that one would store in the db along with
the image... ie. ID number)

Thanks


On Thu, 30 Sep 2004 09:55:30 -0700, Jasper Howard [EMAIL PROTECTED] wrote:
 If you're uploading a file then you can make a script that reads the
 temp file into the database (otherwise you need to muck around with
 image functions and I'm not the one to ask about that), something
 like:
 
 $image = mysql_escape_string(fread(fopen($_FILES['file']['tmp_name'],
 r), filesize($_FILES['file']['tmp_name'])));
 
 Then you just put $image in the db under a BLOG field type. This is
 what I did when I needed to save some images to a db and it seemed to
 work fine. Make sure you save the file type to the database so you can
 display the image properly. When you are ready to display an image,
 just create the html for an image and set the source to a php script
 that will output the image:
 
 img src=scripts/display_image.php?id=1
 
 And in the display_image.php script do something like this:
 
 ?
 ...DB QUERY...
 
 $type = $row['file_type'];
 $dfile = $row['file_data'];
 header(Content-Type: $type);
 header(Content-Disposition: filename=.basename($dfile).;);
 header(Content-Length: .filesize($dfile));
 readfile($dfile);
 exit;
 ?
 
 That code was modified a bit from its origional function (forcing
 download of the file) but I think it should just work, but there's
 always the chance I messed it up somehow.
 
 hope that works for someone,
 -Jasper Howard
 
 
 
 
 On Mon, 27 Sep 2004 19:05:16 -0500, Jim Grill [EMAIL PROTECTED] wrote:
   1) there is no need to fiddle with directory permissions to write images.
   2) if the content is sensitive you have the added security of the database
   password (and the fact that the database is ususally not directly
   accessible).
   3) a mysqldump gives a backup of all images along with other persistent
  data
  
   Other disadvantages follow:
   1) excessive load on the server for loading each image
   2) the load mentioned above causes a slow down in the script
   3) images usually need to be written to file before using GD for
   manipulation, inclusion in PDFs, etc.
  
  That's a very good list.
 
  I just wanted to pipe in on this one thing:
 
  3) images usually need to be written to file before using GD for
  manipulation, inclusion in PDFs, etc.
 
  There is actually a function for this: imagecreatefromstring()
 
  I'll don't want to touch the rest of this topic though. :-)
 
  Jim Grill
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 --
 
 Jasper Howard - Database Administration
 ApexEleven.com
 530 559 0107
 ---
 
 
 
 --
 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] Best way to allow a user to indicate formatting to be displayed but stored.

2004-09-29 Thread GH
I am looking for the best way to have a user enter information and
format it ... i.e. Bold, Italics, etc... with out havng to use the
HTML commands...

Using PHP4.

Any suggestions...

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



Re: [PHP] Re: how to retrieve path to web server files

2004-09-28 Thread GH
does that work for sub directories ... i.e. I have multiple mini
sites that I run on my domain and they are just folders underneath...

I.E. mydom.com
  --- mydom.com/123
  --- mydom.com/ahr
  --- mydom.com/subsite4




On Sat, 25 Sep 2004 14:17:50 -0700, Jasper Howard [EMAIL PROTECTED] wrote:
 $base_dir = $_SERVER['document_root']
 
 
 On Sat, 25 Sep 2004 14:17:16 -0700, Jasper Howard [EMAIL PROTECTED] wrote:
 
 
  On Sat, 25 Sep 2004 14:29:27 +0200, M. Sokolewicz [EMAIL PROTECTED] wrote:
   $path = getcwd();
  
  
   Amc wrote:
Hi,
   
How can I get the string that is the path to the directories on my web
server? I need to upload some files, but don't know what to supply for the
destination path. In asp I used server.mappath, but I'm new to php.
   
Thanks,
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
  --
  
  Jasper Howard - Database Administration
  ApexEleven.com
  530 559 0107
  ---
 
 
 -- 
 
 
 
 Jasper Howard - Database Administration
 ApexEleven.com
 530 559 0107
 ---
 
 --
 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] Images in PHP and MySQL

2004-09-27 Thread GH
I was wondering how to get images into and out of a Mysql database
with in php... I do not have anything in my book... but was told it
was possible.

I have PHP 4.3.4 and mysql 4.0.18

Thanks

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



Re: [PHP] Images in PHP and MySQL

2004-09-27 Thread GH
I hope that there are others out there that could weigh in on this topic please 

The more information and perspective I have the better as it would
help me build the most informed decision as posible.


On Mon, 27 Sep 2004 23:49:33 +0100, Graham Cossey
[EMAIL PROTECTED] wrote:
 I'm no certified expert, but preference would be storing a URL to an image
 in the database rather than the image itself.
 
 If however you do want to store them in the db try using a blob column type.
 
 This article is PHP3 but shows the basics:
 http://www.phpbuilder.com/columns/florian19991014.php3
 
 HTH
 
 Graham
 
 -Original Message-
 From: GH [mailto:[EMAIL PROTECTED]
 Sent: 27 September 2004 23:19
 To: php-general
 Subject: [PHP] Images in PHP and MySQL
 
 I was wondering how to get images into and out of a Mysql database
 with in php... I do not have anything in my book... but was told it
 was possible.
 
 I have PHP 4.3.4 and mysql 4.0.18
 
 Thanks
 
 --
 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Need help... getting information from external xml document

2004-09-23 Thread GH
I am new to php and xml and would like to know how I can set a
variable (i.e $terror_threat_level) equal to the value of
Threat_Advisory's Condition in the following that is available at
http://www.dhs.gov/dhspublic/getAdvisoryCondition ...

  ?xml version=1.0 encoding=UTF-8 ? 
  THREAT_ADVISORY CONDITION=ELEVATED / 

can anyone help?

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



[PHP] Re: Need help... getting information from external xml document

2004-09-23 Thread GH
Also, forgot to ask if there are any specific settings that need to be
set within php for it to work.


On Thu, 23 Sep 2004 09:55:32 -0400, GH [EMAIL PROTECTED] wrote:
 I am new to php and xml and would like to know how I can set a
 variable (i.e $terror_threat_level) equal to the value of
 Threat_Advisory's Condition in the following that is available at
 http://www.dhs.gov/dhspublic/getAdvisoryCondition ...
 
  ?xml version=1.0 encoding=UTF-8 ?
  THREAT_ADVISORY CONDITION=ELEVATED /
 
 can anyone help?


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



Re: [PHP] Re: Need help... getting information from external xml document

2004-09-23 Thread GH
As John noted at the end... I do not have control over the format of
the XML... but thanks I will try... BTW i am using PHP4 is
SimpleXML able to be used and if so how?

Sorry for the newbie question


On Thu, 23 Sep 2004 10:44:31 -0400, John Holmes
[EMAIL PROTECTED] wrote:
 From: GH [EMAIL PROTECTED]
 
  I am new to php and xml and would like to know how I can set a
  variable (i.e $terror_threat_level) equal to the value of
  Threat_Advisory's Condition in the following that is available at
  http://www.dhs.gov/dhspublic/getAdvisoryCondition ...
 
   ?xml version=1.0 encoding=UTF-8 ?
   THREAT_ADVISORY CONDITION=ELEVATED /
 
 Hmmm... I couldn't get SimpleXML to work with this data; maybe it doesn't
 pick up attributes or that XML could be better formed???
 
 I'm sure there's an XML way to do it, but if you don't find anything, here's
 a quick way to match it with regular expressions.
 
 ?
 $str =
 file_get_contents('http://www.dhs.gov/dhspublic/getAdvisoryCondition');
 preg_match('/CONDITION=([^]+)/',$str,$match);
 echo $match[1];
 ?
 
 Off topic, I was thinking this XML would be better formed XML as:
 
 THREAT_ADVISORY_CONDITIONELEVATED/THREAT_ADVISORY_CONDITION
 
 and then you can use:
 
 $str =
 file_get_contents('http://www.dhs.gov/dhspublic/getAdvisoryCondition');
 $xml = simplexml_load_string($str);
 
 but simplexml simply has one element, [0] = ELEVATED. You can't do $xml[0]
 or $xml-0 (since $xml  is an object), etc and you have to do
 
 $threat = current($xml);
 echo $threat;
 
 You can cast $xml to an array, but that still doesn't seem very intuitive:
 
 $a = (array)$xml;
 echo $a[0];
 
 I'm not an XML wiz by any means... is this just bad XML that SimpleXML is
 handling the best it can or is SimpleXML acting up?? If it's bad XML put out
 by DHS, then I can pass some messages up the chain... :)
 
 ---John Holmes...
 


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



Re: [PHP] Re: Need help... getting information from external xml document

2004-09-23 Thread GH
Sounds good... from that RegExpression what exactly is that returning?
just the value in the quotes?

Thanks 
Gary


On Thu, 23 Sep 2004 11:11:16 -0400, John Holmes
[EMAIL PROTECTED] wrote:
 From: GH [EMAIL PROTECTED]
  BTW i am using PHP4 is
  SimpleXML able to be used and if so how?
 
 No, SimpleXML is for PHP5 only. You're probably better off using the regular
 expression method rather than loading an entire XML solution for such a
 small bit of code...
 
 ---John Holmes...
 


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



Re: [PHP] Using '

2004-09-22 Thread GH
Just remember to make sure that the closing EOD; is flush with the
left margin an that there are NO spaces and NO other characters to the
left of it or PHP will give you a PARSE error


On Wed, 22 Sep 2004 11:56:54 -0400, François Moreau
[EMAIL PROTECTED] wrote:
 Hi Juan,
You might consider using the Heredoc syntax, as presented here :
 http://www.php.net/manual/en/
 language.types.string.php#language.types.string.syntax.heredoc
 
 Your code snippet would look like this and do exactly what you had
 intended :
 
 $html = EOD
HTML
YOUR HTML
/HTML
 EOD;
 
 François
 
 Le 04-09-22, à 11:55, Juan Pablo Herrera a écrit :
 
 
 
  Hi!
  i have:
  $html = '
   html
 MY HTML
   /html
   ';
  Inside of my html i used ', this produced a parse error, how can i
  solved
  it?.
  Regards,
  JP
 
 
 
  --
  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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] External Files

2004-09-20 Thread GH
Hi

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



[PHP] External Files (take 2)

2004-09-20 Thread GH
Hi... 

Sorry about the last post... did not realize i hit the wrong button

Here is my question. Sorry if it is a basic answer... new to php

I have PHP/mySQL and would like to know how i can set use an external
file to prevent myself for having to code everytime the
connection/login to mysql.



I was thinking of making an external file but was not sure if it
should have just variables or should it have more?

also, does the content of the external file need to be enclosed in
?PHP   ?'s

Thanks for your help


Gary

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



Re: [PHP] External Files (take 2)

2004-09-20 Thread GH
So i would not need to use ?PHP / ? correct...

Also as to the other question I asked: 

WHat should I use in the other file? the complete connection code or
just the values as variables?


On Mon, 20 Sep 2004 13:23:20 -0700, Daniel Kushner [EMAIL PROTECTED] wrote:
 Hi Gary,
 
 Look up http://php.net/include
 
 It's just like copy and pasting the code in the external file in the
 one your including it into.
 
 Best,
 Daniel Kushner
 
 __
 Director of Education
 Zend Technologies Ltd.
 
 [EMAIL PROTECTED]
 http://www.zend.com
 
 ==
 Learn PHP from the experts, sign up for Zend's
 online training starting October 11th
 http://www.zend.com/store/education/zend-online-training.php
 
 ==
 
 
 
 
 On Mon, 20 Sep 2004 16:14:07 -0400, GH [EMAIL PROTECTED] wrote:
  Hi...
 
  Sorry about the last post... did not realize i hit the wrong button
 
  Here is my question. Sorry if it is a basic answer... new to php
 
  I have PHP/mySQL and would like to know how i can set use an external
  file to prevent myself for having to code everytime the
  connection/login to mysql.
 
  
 
  I was thinking of making an external file but was not sure if it
  should have just variables or should it have more?
 
  also, does the content of the external file need to be enclosed in
  ?PHP   ?'s
 
  Thanks for your help
 
  Gary
  
  --
  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] Multiple External Files with DB calls

2004-09-20 Thread GH
I have a question, what happens if there are multiple 'required' and
'included' files that have calls to the same DB via the same username
and password (they even use the same variable to call)?

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



[PHP] Re: E-mail account security warning.

2004-03-17 Thread Serban Gh. Ghita
I guess this is a hoax or spam.

Serban

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Dear user  of e-mail server Php.net,

 Your  e-mail account will be disabled because of  improper using in next
 three  days, if you are  still wishing to use  it, please, resign  your
 account information.

 For further details see the  attach.

 In order to read the  attach you  have to use the following password:
85324.

 The Management,
 The  Php.net team  http://www.php.net


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