Re: [PHP] Time keeping in DB

2009-08-05 Thread Wolf

 Shawn McKenzie nos...@mckenzies.net wrote: 
 So, obviously not PHP related, but I'm looking for thoughts on the best
 way to record time sheets in a DB.  A time sheet for hours worked per
 day, not like a time clock where you start and stop.
 
 The two possibilities that I have thought of are (these are simplistic,
 of course I'll be storing references to the user, the project code etc.):
 
 1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
 d6, d7) where the dX field holds the hours worked
 2. One record for each day (date, hours)
 
 -- 
 Thanks!
 -Shawn
 http://www.spidean.com

Depends on what you are looking to do..

Are you also needing to keep whether or not a specific project?  
If it is regular time/Overtime? 

It may be easier to set the database up: user,week,day,project,hours,type

Then you can query the info/user off that, it should allow you to expand as 
needed.

HTH,
Wolf

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



Re: [PHP] Clean break.

2009-08-04 Thread Wolf
Paul Halliday wrote:
 Whats the cleanest (I have a really ugly) way to break this:
 
 [21/Jul/2009:00:00:47 -0300]
 
 into:
 
 date=21/jul/2009
 time=00:00:47
 
 Caveats:
 
 1) if the day is  10 the beginning of the string will look like 
 [space1/...
 2) the -0300 will differ depending on DST or TZ. I don't need it
 though, it just happens to be there.
 
 This is what I have (it works unless day  10):
 
 $theParts = split([\], $theCLF);
 
 // IP and date/time
 $tmpParts = explode( , $theParts[0]);
 $theIP = $tmpParts[0];
 $x = explode(:, $tmpParts[3]);
 $theDate = str_replace([,, $x[0]);
 $theTime = $x[1]:$x[2]:$x[3];
 
 the full text for this part looks like:
 
 10.0.0.1 - - [21/Jul/2009:00:00:47 -0300] ... more stuff here
 
 Anyway, any help would be appreciated.
 
 thanks.
 

unset ($STRING,$pos,$pos2,$pos3,$L,$D,$T,$pos4,$NString);
$STRING=10.0.0.1 - - [21/Jul/2009:00:00:47 -0300] ... more stuff here
$pos=strpos($STRING,[);
$pos2=strpos($STRING,]);
$L=$pos2-$pos;
$NString=substr($STRING,$pos,$L);
$pos3=strpos($NString,:);
$D=substr($NString,0,$pos3);
$pos4=$pos3++;
$T=substr($NString,$pos4,8);
echo date=$D;
echo time=$T;

untested, but that should be pretty much all you need.

HTH,
Wolf


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



Re: [PHP] Re: Dan Brown

2009-08-04 Thread Wolf
Congratulations Dan!

On a side note, next time you go down the glorious path to having a
munchkin, go and get a puppy.  Between the labor pains and the morning
sickness, the wife can break you in on getting up at night with the
puppy.   :)

Glad to hear that the family is doing well.  Always a good thing.

Wolf


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



Re: [PHP] What is this called?

2009-07-06 Thread Wolf

 Miller wrote: 
 Ok, say you have a database with 16000 records in it, but you only want to
 call out say 2000 records at a time as the search/query is performed, then
 store the first 2000 in a session and then retrieve the next 2000 etc etc as
 a way to minimize server strain?
 
 (I'm tasked to do this and )
 1. don't know what this is called to google it...partioning results/data ???
 
 2. Is there a better way to deal with retrieval of large amounts of data
 from a large table without choking the server.
 
 3. Is it possible at all
 
 Basically I need to know what it is I'm looking to do, it's not getting
 explained in an understandable way herewhich makes google useless
 

Basically, go smack whomever told you to load all that stuff into a session.  
It's a paging query that you want to do, but I'd not recommend doing it to 
store it in a session.

You can store all that stuff into a session, but you risk putting a greater 
load on the users session then you would be putting on the database server.

If you are running MySQL, go get a 486, put Fedora on it and use it for the 
heavy queries.  

HTH,
Wolf

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



Re: [PHP] Can this be done?

2009-05-05 Thread Wolf

 Miller wrote: 
 Ok I have a script that grabs data from a page and puts it in a db, I need
 to run this script 26 times on 26 different pages on the same site, is there
 a way to do this without making 26 different scripts load? Should I post the
 script?
 
 Thanks, 
 T.Miller
 

Sure it can be done...

Change your script so that it has the following:
1. array with the page names/urls in it
2. foreach loop right after the array to parse it
3. in the current place of the file name, but the variable
4. Make sure to close the foreach loop

IE:
?php

$pages=array(page1.php,page2.php,,page26.php);
foreach ($pages as $page)
{
// do all the grabbing and db throwing
}

?

HTH,
Wolf

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



Re: [PHP] Can this be done?

2009-05-05 Thread Wolf
 Miller wrote: 
 
 
 
 On 5/5/09 9:23 AM, Wolf lonew...@nc.rr.com wrote:
 
 
 
  Miller wrote:
  Ok I have a script that grabs data from a page and puts it in a db, I need
  to run this script 26 times on 26 different pages on the same site, is there
  a way to do this without making 26 different scripts load? Should I post the
  script?
 
  Thanks,
  T.Miller
 
 
 Sure it can be done...
 
 Change your script so that it has the following:
 1. array with the page names/urls in it
 2. foreach loop right after the array to parse it
 3. in the current place of the file name, but the variable
 4. Make sure to close the foreach loop
 
 IE:
 ?php
 
 $pages=array(page1.php,page2.php,,page26.php);
 foreach ($pages as $page)
 {
 // do all the grabbing and db throwing
 }
 
 ?
 
 HTH,
 Wolf
 
 
 Hi this is what I'm working with as of now but still getting the blank page 
 of death...clues please:
 
!-- SNIP CODE --

To find your reasons for blank pages:
1) check the php_error log if you have set it up
2) run the file via the command-line (php $filename) and see what happens, what 
errors you are getting back...
3) add the following to the top of your script after the ?php
ini_set('display_errors', 1);

then when you run it, it should barf out the errors, if not, you need to look 
at either your php error log, or the web server error logs

You seemed to have accurately opened and closed your brackets.

HTH,
Wolf

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



Re: [PHP] Couple of beginner questions

2009-01-09 Thread Wolf

 Gary gwp...@ptd.net wrote: 
 I've done a number of sites in html and am now venturing into php.
 
 Can I create a page in html and insert php code that will work? (for 
 example, take an existing page and insert a date command)
Yup

 
 Can I create a page with the php extension that contains only contains html 
 and no php?  If so are there advantages/disadvantages?
Yujp
 
 Can I mix and match file formats (php/html) in a single site?
Yup

 Thanks for any input.
 
 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



Re: [PHP] Couple of beginner questions

2009-01-09 Thread Wolf

 Eric Butera eric.but...@gmail.com wrote: 
 On Fri, Jan 9, 2009 at 12:22 PM, Wolf lonew...@nc.rr.com wrote:
 
   Gary gwp...@ptd.net wrote:
  I've done a number of sites in html and am now venturing into php.
 
  Can I create a page in html and insert php code that will work? (for
  example, take an existing page and insert a date command)
  Yup
 
 Um... if the file ext is .html and php isn't set to run that then nope.

That's a very good point  Getting PHP up and running will require the OP to 
read and follow the documentation.

But after that, you can mix and mingle at will, however good programming 
practices dictate that you become smart about your coding instead of dumping 
things in the original HTML and just playing.

Gotta be smart about things.

Wolf

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



Re: [PHP] RSS Feed on my PHP site

2009-01-05 Thread Wolf

 DanBarker85 danbarke...@hotmail.co.uk wrote: 
 
 Hi
 
 i'm new to RSS Feeds, but how would it be possible to have a BBC News Feed
 added to my website?
 
 I've searched for some kind of tutorial but haven't found anything.

You STFW but haven't found anything?  Wow... Google sure had a number of 
responses...

http://www.google.com/search?q=adding+RSS+feeds+to+siteie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a

HTH,
Wolf

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



Re: [PHP] First record not diplaying

2008-12-22 Thread Wolf
 Gary Maddock-Greene g...@maddock-greene.co.uk wrote: 
 Hi, I seem to have a bug in my code but can't see why. My first record does 
 not display when I run a search. Can anyone spot what I have done wrong? 
 Thanks
 
 if (0 == $totalRows_rsSearch) {
 echo h3Sorry no products were found/h3;
 } else {
 echo h3Please click on a product for further information./h3;
 while ($row_rsSearch = mysql_fetch_assoc($rsSearch)){
 echo div class=\productitem\img src=\products.
 $row_rsSearch['product_image'].\
 
 - Gary Maddock-Greene 

Is this another one of your classes?  I see your email address links to a web 
page created for a class.

Without the rest of the code (the code above what you have placed) and the end 
of the echo line you have provided, all any of us can do is a guess.

However one thing to note, this list was not created to help you with your 
homework and with the previous postings you have written, it is pointedly 
answering different places you have stumbled in your work and haven't checked 
your book, the online resources, or a TA.

Wolf

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



Re: [PHP] Require error

2008-12-19 Thread Wolf
Bottom Post

 sean greenslade zootboys...@gmail.com wrote: 
 No. The file is called testing.php and it is trying to include sql.inc
 
 On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote:
 
 
 
  On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade 
  zootboys...@gmail.comwrote:
 
  So, I have this code in a php file called testing.php:
  $incl = '/webs/www.zootboy.com/sl/sql.inc';
   if(!is_readable($incl)) die('ERROR: MySQL Include file does not
  exist??!?');
   require $incl or die('MySQL page not found. Unable to continue.');
 
 
  When I run the code in command line, it outputs this:
 
  [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php
  PHP Warning:  require(1): failed to open stream: No such file or directory
  in /webs/www.zootboy.com/sl/testing.php on line 13
  PHP Fatal error:  require(): Failed opening required '1'
  (include_path='/var/php/inc/') in /webs/www.zootboy.com/sl/testing.php on
  line 13
 
  I have no idea what's going on. All the files have 777 perms.
 
  --
  --Zootboy
 
 
  Are you trying to require itself?

Change your line to:
require('$incl') or die('File not found');

Require can be dork about things like this, I normally wind up handling to 
fiddle with the coding for them.

Wolf

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



Re: [PHP] Require error

2008-12-19 Thread Wolf

 sean greenslade zootboys...@gmail.com wrote: 
 On Fri, Dec 19, 2008 at 12:43 PM, Wolf lonew...@nc.rr.com wrote:
 
  Bottom Post
 
   sean greenslade zootboys...@gmail.com wrote:
   No. The file is called testing.php and it is trying to include sql.inc
  
   On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote:
  
   
   
On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade 
  zootboys...@gmail.comwrote:
   
So, I have this code in a php file called testing.php:
$incl = '/webs/www.zootboy.com/sl/sql.inc';
 if(!is_readable($incl)) die('ERROR: MySQL Include file does not
exist??!?');
 require $incl or die('MySQL page not found. Unable to continue.');
   
   
When I run the code in command line, it outputs this:
   
[r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php
PHP Warning:  require(1): failed to open stream: No such file or
  directory
in /webs/www.zootboy.com/sl/testing.php on line 13
PHP Fatal error:  require(): Failed opening required '1'
(include_path='/var/php/inc/') in /webs/
  www.zootboy.com/sl/testing.php on
line 13
   
I have no idea what's going on. All the files have 777 perms.
   
--
--Zootboy
   
   
Are you trying to require itself?
 
  Change your line to:
  require('$incl') or die('File not found');
 
  Require can be dork about things like this, I normally wind up handling to
  fiddle with the coding for them.
 
  Wolf
 
 
 Sorry, GMail defaults to top post. Also, I had tried that before. Same
 errors.
 

Keep replies on the list too, in case someone else stumbles in...  :)

Did you try switching it from require to include?

Did you try just using the full path to the file?

Wolf

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



Re: [PHP] Require error

2008-12-19 Thread Wolf

 Kyle Terry k...@kyleterry.com wrote: 
 On Fri, Dec 19, 2008 at 9:43 AM, Wolf lonew...@nc.rr.com wrote:
 
  Bottom Post
 
   sean greenslade zootboys...@gmail.com wrote:
   No. The file is called testing.php and it is trying to include sql.inc
  
   On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote:
  
   
   
On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade 
  zootboys...@gmail.comwrote:
   
So, I have this code in a php file called testing.php:
$incl = '/webs/www.zootboy.com/sl/sql.inc';
 if(!is_readable($incl)) die('ERROR: MySQL Include file does not
exist??!?');
 require $incl or die('MySQL page not found. Unable to continue.');
   
   
When I run the code in command line, it outputs this:
   
[r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php
PHP Warning:  require(1): failed to open stream: No such file or
  directory
in /webs/www.zootboy.com/sl/testing.php on line 13
PHP Fatal error:  require(): Failed opening required '1'
(include_path='/var/php/inc/') in /webs/
  www.zootboy.com/sl/testing.php on
line 13
   
I have no idea what's going on. All the files have 777 perms.
   
--
--Zootboy
   
   
Are you trying to require itself?
 
  Change your line to:
  require('$incl') or die('File not found');
 
  Require can be dork about things like this, I normally wind up handling to
  fiddle with the coding for them.
 
  Wolf
 
 
 Actually, single quoted will be string literal. He would need to encase them
 in double quotes so the parser knows it might be looking for a variable.
 require($incl) is what he wants.
 

See!  I told you I always have problems with those!  :)

Normally I'm not so literal though. 

so yeah:
require($incl);
include($incl);

I prefer the includes over the requires, but that is personal preference.

Wolf

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



RE: [PHP] php client

2008-12-14 Thread Wolf

idan72 wrote:
 Hi,

 I am new to PHP.
 I want to write a web client in PHP that will data to a server written in
 Java.
 I want that the client will send an object to the server.

 What is the best way to do that?
 Where can I find an example for doing that ?
   
JAVA is on the client side. That is, it runs in the users browser.

PHP is on the server side, and there is no direct interaction between 
PHP and the user.

It seems from what you write that you need a form in a web page, and a 
PHP script to process the data the user enters and submits from the 
form. You may not need JAVA at all.

If this is what you want to go, Google, PHP forms

Stephen
-- 

For that, you don't even need PHP!  You can do that directly with HTML.  Forms 
are html and css, php would only be needed to process the data received from 
the forms.

But then, you can do that with CGI/Perl as well...

But at this point, stfw and go for forms.  Htmlgoodies.com is a good tutorial 
place to go..

Wolf

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



Re: [PHP] Downloading file from local network machine

2008-12-05 Thread Wolf
!-- SNIP -- 
 I  would like to present users to our internal intranet with a link to
 download a file from a folder on a different machine on our local
 network (such as \\computername\folder\file)
!-- SNIP -- 

Map the drive to the server so that it is accessible as /folder/file on the 
website.

Voila, no more problem.

HTH,
Wolf

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



Re: [PHP] Poll of sorts: Javascript Form validation or PHP

2008-12-05 Thread Wolf
 Terion Miller [EMAIL PROTECTED] wrote: 
 I have a huge form to validate and wonder which is better javascript
 validation or php, the page is a php page, I actually put js validation on
 it but then it stopped working (stopped inserting into the db) not sure if
 that had anything to do with it
 What does everyone prefer?
 
 Terion who is actually finally learning stuff to her surprise!!

Never trust users to give you the data you expect.

Javascript/Ajax is a nicety but even when adding more things it can be broken.  
Always double-check and validate everything on the server side.

Wolf

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



Re: [PHP] Will not report errors what can I do

2008-12-04 Thread Wolf


Jim Lucas wrote:
 Johny John wrote:
 HI Terion,
 Please put the error reporting on top of the page and try. If you have
 any
 errors in the include file, it won't execute the rest of commands.
 Make the
 changes to code as follows.

 ?php
 error_reporting(E_ALL);
 ini_set('display_errors', '1');
 include(inc/dbconn_open.php);

 ?

 Regards,

 Johny John

 
 This still doesn't address his possible parse error problem.  If he has
 a parse error, it makes no difference where he places the above lines.
 Nothing is going to work.
 
 It should be done via one of the three methods that mention in my other
 email.

Putting it in the file is ideal if he can't set up his server to do it
via one of the other methods, however if he HAS set it up via other
methods, you normally HAVE to restart the server processes so that they
re-read the PHP.ini file so they actually will DO the changes that you
have made to them.

Otherwise you are just wasting more time.

HTH,
Wolf


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



RE: [PHP] $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Wolf
-Original Message-
From: Alex Kirk 

I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD  
6.2. It's worked quite well for over a year now. However, as of some  
time last night, phpBB broke; upon investigation, I realized that the  
problem was that $_POST was never getting populated, even on properly  
formed HTML forms.

Testing this to try to find the issue, I used the following script:

?php
  print Testvar:  . $_POST['testvar'] . br/\n;
?

form method=POST action=http://www.newmars.com/test.php  
name=formname enctype=multipart/form-data
input type=text name=testvarbr/
input type=submit value=Submitbr/
/form

It works like a charm on a different machine with an essentially  
identical config (it's a newer version of FreeBSD, but that's about  
it); however, it never displays the contents of $_POST['testvar'] on  
the machine that suddenly quit functioning right last night.

Meanwhile, the rest of PHP seems to be working fine, as the phpBB  
forum is accessible in a read-only fashion.

I've searched all over, and done things like restarting Apache;  
checking phpinfo() for the POST data (it's not there on the broken  
server, but it is on the functional one); writting a quick Perl script  
that took POST input to verify that my browser was sending such data  
properly (it is); and scouring the Apache/PHP error logs. The worst  
part is, I didn't touch the config at all between when it worked and  
when it didn't. So now I'm at a total loss as to what could be causing  
this, or how I should go about troubleshooting...

==

Did you check the apache logs or the php error logs?

How about disk space on the server location where it is storing it's temp files 
for the server?

I've seen something similar when disk space was nil after some scripts ran 
amok.  

HTH, 
Wolf

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



RE: [PHP] question about corrupt db?

2008-12-01 Thread Wolf


-Original Message-
From: Terion Miller [EMAIL PROTECTED]
Sent: Monday, December 01, 2008 4:23 PM
To: Micah Gersten [EMAIL PROTECTED]
Cc: PHP General php-general@lists.php.net
Subject: Re: [PHP] question about corrupt db?

On Mon, Dec 1, 2008 at 3:12 PM, Micah Gersten [EMAIL PROTECTED] wrote:

 Terion Miller wrote:
  could a corrupt db make php pages stop functioning?
  My pages no longer go anywhere, I went back found the original scripts
 and
  still it didn't fix the problem (thought I had messed the code up) so it
 has
  to be something external of the code its doing this locally on my box and
 on
  the live server.
 
  thanks
  terion
 
 
 Have you checked the PHP error logs?

 Thank you,
 Micah Gersten
 onShore Networks
 Internal Developer
 http://www.onshore.com

   I put this:



 ini_set('error_reporting', E_ALL);
 ini_set('display_errors', true);

in the top of the pages but no errors are showing
--

Then that answer would be no

You need to actually look at your error logs as if the server is set up right 
it won,'t allow ini bypasses.

Wolf

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



Re: [PHP] Help with understanding an error

2008-11-24 Thread Wolf

 Terion Miller [EMAIL PROTECTED] wrote: 
 Can anyone help explain what I need to do to fix this:
 
 Error: *Warning*: mysql_fetch_object(): supplied argument is not a valid
 MySQL result resource in *
 C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *57*
 
 *Warning*: mysql_num_rows(): supplied argument is not a valid MySQL result
 resource in *C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *
 65
 
 
 Code:
 line 57: $row = mysql_fetch_object ($result);
 line 65: if (mysql_num_rows($result) == 0) {
 ?
 *

STFW as Google has the answer..

But... you need to actually provide MORE of the code, since the error pretty 
much tells you that you don't have a connection to your database.  Not a PHP 
issue really.

Wolf

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



Re: [PHP] Help with understanding an error

2008-11-24 Thread Wolf
Bottom POST when mailing the list.

My responses inline and at the bottom

 Terion Miller [EMAIL PROTECTED] wrote: 
 this was the code I posted that accidentally only went to Wolf:
 
 what does  STFW mean?

http://www.google.com/search?q=STFWie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a

 ?php
 include(inc/dbconn_open.php);
Change the include to require (should barf faster)

!-- SNIP -- 
 $result = mysql_query ($sql);
change this to:
$result = mysql_query ($sql) or die(mysql_error());

 $row = mysql_fetch_object ($result);
 
 $sql2 = SELECT Date_FORMAT(CreatedDate,'%m/%e/%Y %h:%i %p') AS OrderDate,
 Location, WorkOrderName, Status FROM workorders ;
 $sql2 .= WHERE WorkOrderID='$WorkOrderID';
 $result2 = mysql_query ($sql2);
Change this one as well to add the die statement
 $row2 = mysql_fetch_object ($result2);
 
!-- SNIP --

And as I said before, your error code tells you that the connection to the 
database is invalid.  Making the changes to the code I wrote above should point 
you in the right direction to get it figured out.

Wolf

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



Re: [PHP] PostTrack Reminder

2008-11-24 Thread Wolf

 Daniel Brown [EMAIL PROTECTED] wrote: 
 Folks;
 
 Just as a reminder, the PostTrack/ListWatch system is back to
 recording and reporting data on the list for the Friday summary
 reports and list metrics.  If you do not want your email address to
 show up in the reports and have not already told me, please let me
 know ASAP and I will permanently remove you from the reports.  Note
 that this will *NOT* unsubscribe you from the list, just keep you from
 showing metrics in the weekly reports.
 
 Thanks, all.  And a happy upcoming holiday to my fellow US Americans.
 
 Everyone stay safe.
 

Sure Dan, just pad your metrics with yet another post...  :)

Have a good Thanksgiving as well!  Make sure to eat lots of turkey so you sleep 
through the list emails!

Wolf

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



RE: [PHP] while-question

2008-11-17 Thread Wolf
 Dabbling?
 
 I think that making a living from it isn't dabbling, so I may not be 
 qualified to speak for the dabblers.
 
 But for me, I was writing code before there were such courses. Later, 
 when I went to college I was taught adventures in keypunching and 
 received several next to worthless degrees.
 
 I say next to worthless only because what they taught really wasn't 
 applicable to real world programming. As for management, clients, and 
 hr types, the degrees mattered, but not for much more than that.
 
 In any event, I doubt if any college courses are keeping up with 
 current web technology -- there has always been a lag between what's 
 practiced and what's taught. What I've seen of college web sites, 
 seems to support that claim.
 
 If I was taught in college all I needed to know, then what am I doing 
 with these dozens of web books scattered about my office? I probably 
 read a new book every other week.

I don't dabble in it either, unless you consider making my living from being 
a dabbler, in which case I'll continue to dabble and see the pay for it.  My 
alma-mater tried to stay current to some degree, but when they let someone who 
wrote the C++ book try to teach it, well they gave that person more rope then 
they needed.

Tedd, glad you got hooked on Phonics.  One of these days I hope from graduating 
from just looking at the pictures, but right now the pictures are oh so 
enticing!. ;)  

Wolf

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



RE: [PHP] It's Sunday, and I'm bored...

2008-11-09 Thread Wolf
Ni, he works for ACORN...

Oh wait, that would have vote early, vote often...

-Original Message-
From: Jay Blanchard [EMAIL PROTECTED]
Sent: Sunday, November 09, 2008 12:33 PM
To: Ólafur Waage [EMAIL PROTECTED]; php-general@lists.php.net
Subject: RE: [PHP] It's Sunday, and I'm bored...

[snip]
Commit Early Commit Often. :P
[/snip]

Are you from Louisiana? 

-- 
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 - Web/list Question...

2008-11-09 Thread Wolf
  Accumulate them in the session. When done, and before final action you
 could let them view a summary of selected items and allow deletion of
 any entries they don't want.

You session purest!  :-P


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



Re: [PHP] PHP - Web/list Question...

2008-11-08 Thread Wolf

 bruce [EMAIL PROTECTED] wrote:
 Hi.

 I've got a question/issue that I want to bounce off the list.

 I have a list that extends over multiple pages. there might be 200 items,
 and i don't want to have the items listed on the same page as it would be
 too long. i can break the list up, so i can have it be displayed over
 multiple pages. however, i want the user to select different items
from the
 list. given that the selected items might be over different pages, what's
 the best way of keeping a running track of the items that have been
 selected??

 I could have each page be a form, and do a post/get where i then keep
track
 of the selected items from page to page, but that would appear to get
ugly.
 i'm looking for pointers to other sites/code that might have already
 implemented this kind of scenario.

You use a database, form on each page adds to a temp table on the
database, when they have verified them all (if that is something they
can do) OR have finished whatever form/survey you have them doing, then
you write the temp table info to the one you want to keep.

You could do some of that with ajax as well, but if you want to break up
a 200 item list, you are looking at a database to store the info in the
most efficient manner possible.

You could also do it with sessions, but if they get stuck and need to
come back, then if they had to login their session might be different
and they'd have to start over again.

HTH,
Wolf


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



Re: [PHP] I have a problem with dynamicly updating files...

2008-11-06 Thread Wolf
 satinder singh [EMAIL PROTECTED] wrote: 
 I got a lot through a tutorial, but problem is when i tried to insert,
 problem occured using following code:
 
 $query = INSERT INTO contacts VALUES
 ('','$first','$last','$phone','$mobile','$fax','$email','$web');
 mysql_query($query);

!-- SNIP --

Your query looks fine.  You need to look at the error codes you receive.

change:
mysql_query($query); 
TO: 
mysql_query($query) or die(mysql_error());

The resulting error message should help you find your MySQL issue.

Wolf

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



Re: [PHP] removing text from a string

2008-11-05 Thread Wolf
  1. Some Text here
  2. Another Line of Text
  3. Yet another line of text
  340. All the way to number 340
 
  And I want to remove the Number, period, and blank space at the
  begining
  of each line.  How can I accomplish this?
 
  Opening the file to modify it is easy, I'm just lost at how to
  remove
  the text.:
 
  ?php
  $filename = results.txt;
 
  $fp = fopen($filename, r) or die (Couldn't open $filename);
  if ($fp)
  {
  while (!feof($fp))
  {
  $thedata = fgets($fp);
  //Do something to remove the 1. 
  //print the modified line and \n
  }
  fclose($fp);
  }
  ?
 
  I'd go with a regular expression any day for something like this.
 *groan*

?php 
 $filename = results.txt; 

 $fp = fopen($filename, r) or die (Couldn't open $filename); 
 if ($fp) 
 { 
  while (!feof($fp)) 
  { 
   $thedata = fgets($fp); 
   //Do something to remove the 1.  
   $findme= ;
   $pos=strpos($thedata,$findme);
   $thedata_fixed=trim(substr($thedata,$findme));
//print the modified line and \n 
   echo $thedata_fixed.\n;
  } 
  fclose($fp); 
 } 
? 

See, no regex needed and no matter the size of the '##. ' it will always 
find the first   and then chop it from there to the end, then you trim it up 
and you get the text.

Wolf

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



Re: [PHP] basic php question...

2008-11-04 Thread Wolf
 hi guys...foo
 
  i've got a button that i want to select, and i want the app to  
  process
  some
  logic, and then return the user to the page. my question is how??
 
  something like
 
  base page:
 
  a href=foo.phpbutton link/a
 
  foo.php
  -process logic
  -return the user to the base page, with the same querystring that
   was initially used to generate the initial base page
 
 
  foo.php doesn't have any display function, just the logic
 
  thoughts/sample php pages/psuedo code chunks...

Where's your code breaking?

what have you written already that has failed to work right?

Sounds like you aren't even using PHP...

As for the redirects, there are a host of ways, even some which can have output 
on the page yet still redirect flawlessly using the META tags.

Wolf

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



Re: [PHP] basic php question...

2008-11-04 Thread Wolf
 Richard Heyes [EMAIL PROTECTED] wrote: 
  users who browse without Javascript enabled,
 
 Heretics!

lynx works great!

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



Re: [PHP] basic php question...

2008-11-04 Thread Wolf

 Richard Heyes [EMAIL PROTECTED] wrote: 
  users who browse without Javascript enabled,
 
 Heretics!

Also remember, all US based sites have to be in compliance with ADA as well, 
otherwise you'll spend a lot of time re-writing your stuff if it doesn't work 
for someone to use a disabilities enabled browser to surf your site.

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



RE: [PHP] basic php question...

2008-11-04 Thread Wolf
 Boyd wrote: 
  -Original Message-
  From: Wolf [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, November 04, 2008 2:30 PM
  To: php-general@lists.php.net
  Subject: Re: [PHP] basic php question...
  
  
   Richard Heyes [EMAIL PROTECTED] wrote:
users who browse without Javascript enabled,
  
   Heretics!
  
  Also remember, all US based sites have to be in compliance with ADA as
  well, otherwise you'll spend a lot of time re-writing your stuff if it
  doesn't work for someone to use a disabilities enabled browser to surf
  your site.
 
 All U.S.-based GOVERNMENT and GOVERNMENT-RELATED sites (i.e., funded, 
 regulated, etc.) have to be in compliance. If I'm making a version of Simon 
 Says using PHP at my own leisure and putting it up for my friends and others 
 to play, or if I'm designing a website management system for a company in the 
 audiovisual industry, those without Javascript/Flash/Whatever can sit and 
 spin. :)

True, but how many people you want to send you email saying your site blew up 
their browser?  I've had a number of sites that weren't Gov' funded or Gov' 
related that were still ADA because even private citizens can be said to be 
discriminating...  Never know when someone will get upset and wanna sue.

1,000,000 lawyers in the laurential abyss...  A good start!

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



Re: [PHP] Mailing lists

2008-10-30 Thread Wolf

 Ok, other then mailman, anyone know of a free (other than
 freelists.org) hosted discussion list management service?
 

I take it that Google Groups is out as well?

Wolf

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



Re: [PHP] Mailing lists

2008-10-29 Thread Wolf

 Richard Heyes [EMAIL PROTECTED] wrote: 
 Hi,
 
 Anyone know of a good (as opposed to a bad) mailing list manager,
 other than freelists.org (which I can't seem to get working).
 
 Thanks.

What's wrong with Mailman?

Wolf

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



Re: [PHP] Politics

2008-10-21 Thread Wolf

 Nathan Rixham [EMAIL PROTECTED] wrote: 
 Robert Cummings wrote:
  On Tue, 2008-10-21 at 08:01 -0700, Jim Lucas wrote:
  Chrome wrote:
  -Original Message-
  From: Amy [mailto:[EMAIL PROTECTED]
  Sent: 21 October 2008 11:58
  To: php-general@lists.php.net
  Subject: [PHP] Politics
 
 
  representations emphasizing leksr matching thirds painfully wakesleep
  ekswiezeezeewie accompanied
  Have you tried restarting Apache? :)
  no, no, no, she said painfully, she must be using IIS... :)
 
  Try upgrading all your drivers and then restarting...
  
  Hmmm, I'm not so sure. I think it's a php.ini problem where
  register_globals=on is required to make the code work.
  
 I think they need a new dictionary / word list or at least some form of 
 lexicographic analysis.
 
 Oh yeah and a point.
 

http://www.youtube.com/watch?v=IF2RYhNhBdwfeature=related

And...

http://www.youtube.com/watch?v=B_kvgD_Mv-M

:)


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



Re: [PHP] Microsoft China to Punish private windows users

2008-10-15 Thread Wolf
  This is extremely off-topic. Please don't abuse this list in an attempt 
  to drive traffic to your blog.
  
  -Stut
  
 
 It *is* powered by PHP, Stut.  :P
 

True, but that's the ONLY PHP thing about it...  OK, and the URL has PHP in 
it...

;)

Wolf

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



Re: [PHP] Re: 1 last error to fix before the application is done!

2008-10-14 Thread Wolf
!-- SNIP --
 Does the ! reverse the empty in this case? such as !empty = not empty?

You definitely have to go walk the plank now...  You have to go back and
re-write code and make it more compact now, right?  tsk, tsk.  I thought
we taught you better then that.

! is the NOT operator in many languages.

So instead of something like this:
if ($employee_login == true || $employee_loggin == break)
You could do:
if ($employee_login != off)

Don't worry, it should be quick, we've been chumming the water.  ;)

HTH,
Wolf


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



Re: [PHP] New to PHP

2008-10-13 Thread Wolf

 Gary [EMAIL PROTECTED] wrote: 
 Well...thank you all for the warm and friendly welcome, I will probably try 
 to steer one of my projects to php (or at least a portion of) in a short 
 while.
 
!-- SNIP --

Gary, one thing to keep in mind is to BOTTOM POST and TRIM your posts.

By Bottom Posting (common when on a mailing list or NG) it gives greater 
context as you read through the previous posts and by the time of getting to 
where the new response is, it is in sync.  No skipping back and forth to read 
to get the context.

Trimming is appropriate when addressing a specific entry or when cutting off 
Dan's 12 line signature block to reply to a message.  ;)

And yeah, you'll find a number of us aren't as serious as others may like.  :)

Welcome to the list.  I also keep www.php.net handy and a general rule of thumb 
when using Firefox if you have the google search plug-in running is to use 
php: question where question is what you are looking to do.  By prefacing 
the search with php: google tends to give greater responses since it looks for 
PHP first and then the question.

HTH.
Wolf

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



Re: [PHP] New to PHP

2008-10-13 Thread Wolf

 Micah Gersten [EMAIL PROTECTED] wrote: 
 The problem with bottom posting is that if you follow the conversation,
 you have to scroll to find the new content.  I guess if you trim and
 bottom post it's not so bad.
 
 Thank you,
 Micah Gersten
 onShore Networks
 Internal Developer
 http://www.onshore.com
 
 
 
 Wolf wrote:
  By Bottom Posting (common when on a mailing list or NG) it gives greater 
  context as you read through the previous posts and by the time of getting 
  to where the new response is, it is in sync.  No skipping back and forth to 
  read to get the context.
 
 

Until very recently, everyone was up to speed and trimmed/bottom posted.  It 
does make for better contextual understanding.  Otherwise you have to scroll to 
the bottom and read UP to make sense of the whole of a Post.

Wolf

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



Re: [PHP] New to PHP

2008-10-13 Thread Wolf
 Daniel Brown [EMAIL PROTECTED] wrote: 
 On Mon, Oct 13, 2008 at 11:45 AM, TG [EMAIL PROTECTED] wrote:
  I don't want to get into a bottom vs top posting debate.  Just know that 
  some
  of us prefer top posting.   There's no right/wrong answer to this.
 
 There is no debate.  There is a right and wrong answer.  Sometimes
 people just need a refresher.
 
 http://www.php.net/reST/php-src/README.MAILINGLIST_RULES
 
 QUOTE:
 3. Do not top post. Place your answer underneath anyone you wish to
 quote and remove any previous comment that is not relevant to your
 post.
 
 This is also addressed in the Netiquette RFC (1855).

See, and when you reply, make sure to cut the 10 lines of dan's sig file off.  

Well said Dan!  :) 

Wolf

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



Re: [PHP] New to this group....a continuation

2008-10-13 Thread Wolf
 Gary [EMAIL PROTECTED] wrote: 
 I posted that I was new to php and had a nice warm responce, however I am 
 now getting these responses in my email box.  Is this something that I am 
 doing? I read and contribute to other news groups on a daily basis and this 
 is a first Can I change this?

Nope, you post and pretty much people will respond to the list and sometimes 
include the other posters to that message.

If you are just going to read this group through the web or another interface, 
set up your email to filter the messages.

HTH,
Wolf

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



Re: [PHP] Project Tracking / Charting Tool OT

2008-10-09 Thread Wolf

 Jay Blanchard [EMAIL PROTECTED] wrote: 
 Does anyone here know of a project tracking tool that will allow me to
 import multiple project files into one project tracking too w/Gantt
 charts, resources, etc. ? An added bonus would be true collaboration
 where updates to a single project are reflected in the larger project
 tracking entity.
 
 I have looked at OpenProj, MS Project, and some others and none offer
 this functionality.

Have you checked out Tutos?

I played with it a few years ago, not sure how it works these days.

Wolf

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



Re: [PHP] Login

2008-10-09 Thread Wolf
 Shawn McKenzie [EMAIL PROTECTED] wrote: 
 Richard Heyes wrote:
  Unless that was the business you were in ;)
  
  True enough, but what kind of business would that be...? :-)
  
 
 Rating poo, of course...

It's a crappy job, but someone's got to do it...  ;)

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



Re: [PHP] Login

2008-10-08 Thread Wolf
!-- SNIP --
 Redirects make sense IMO. IIRC the Yahoo guidelines say not to
 redirect after a form POST, but unless you have a ka-jillion page
 views a second (or, a lot), then I don't think it's a concern.

Wait, Yahell has guidelines?!?!?

You always have to look at the User Experience.  You don't want to annoy or 
p!ss off your users or they will find a site like yours that doesn't p!ss them 
off.  If it makes sense to re-direct the user after a successful login, then go 
ahead and do it.

Of course, I don't care if I p!ss off someone who is trying to run malicious 
code on my site or find a hidden piece.  Then a redirect to ratemypoo seems 
like a good idea to me!

Wolf

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



Re: [PHP] AJAX and PHP

2008-10-06 Thread Wolf
!-- SNIP --
 yes, flex is flash for developers; the main language is AS3 and it 
 outputs swf's; flex is basically a program which allows you to use mix 
 of pre-made ui elements  classes, css and AS3 to quickly make great RIA's.

Yup, but you have to have flash enabled.  But some of us don't except for 
specific sites due to ads being swfs as well.

Wolf

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



[PHP] Mailing List fun

2008-10-01 Thread Wolf
Subject:OT: Mail service Restored 

Who'd have thunk that a person who messes up a Time Warner account and WORKS in 
Time Warner can disable your email accounts. 
 
Not only that, but when they finally figure out what happened (3 phone calls, 
over an hour on the phone with them), they are unable to restore the email 
accounts until you drive home, reboot the router, call and WAIT ON HOLD for 
their customer service reps and then another 10 minutes later get the email 
accounts restored. 
 
Sorry for the bounces everyone. 
 
Wolf 

Of course, after I sent that, I got an immediate failure message
=
This Message was undeliverable due to the following reason: 
 
Your message was not delivered because the destination computer refused 
to accept it (the error message is reproduced below).  This type of error 
is usually due to a mis-configured account or mail delivery system on the 
destination computer; however, it could be caused by your message since 
some mail systems refuse messages with invalid header information, or if 
they are too large. 
 
Your message was rejected by pair1.php.net for the following reason: 
 
 Apparent off-topic email rejected. 
 
The following recipients did not receive this message: 
 
 php-general@lists.php.net 
 
The following websites may contain more information to assist you: 
 
http://help.rr.com/HMSLogic/rrmail.aspx 
 
http://security.rr.com/help.htm 
 
http://security.rr.com/contact.htm 
 
Please do not reply to this message, as it will go to an unread 
mailbox 

Open Attachment 2 Open

--- Forwarded Message ---
Date:   
[Wed, 1 Oct 2008 12:35:23 -0400]
From:   Wolf [EMAIL PROTECTED] 
To: php-general php-general@lists.php.net 


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



Re: [PHP] Wanted PHP Developers LogicManse

2008-09-30 Thread Wolf
 Nathan Rixham [EMAIL PROTECTED] wrote: 
 Jim Lucas wrote:
  Nathan Rixham wrote:
  Jim Lucas wrote:
  Nathan Rixham wrote:
  Richard Heyes wrote:
  Thanks for quoting the whole message then!  :P
  Maybe he just wanted to make sure you got it...
!-- SNIP --

I just wish you guys would stop giving them ideas!  And then copying it back on 
the list and explaining...  Sheesh!  :-P

Is it 5 yet?

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



Re: [PHP] Wanted PHP Developers LogicManse

2008-09-30 Thread Wolf
!-- SNIP -- *Lightbulb*... I could make money 

*snatches lightbulb down and replaces it with burned out one*

Must resist fist of death

:)

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



Re: [PHP] Robert Cummings

2008-09-30 Thread Wolf
 Daniel Brown [EMAIL PROTECTED] wrote: 
 All:
 
 What was pointed as a passing mention in one thread I thought was
 worth note in a thread of its own.  As quoted by Rob:
 
  BTW, while we're off topic... my wife delivered our third child (second
  boy) 3 minutes after midnight yesterday :)
 
 I'd say that deserves a round of congratulations.  Many - most,
 probably - of you know Rob from here, and have seen his help and
 dedication - as well as his annoying wit ;-P - offered to any and all
 on this list.  Quite often, it's offered when you don't especially
 want it.  Nonetheless, it's great news, and I think we should all take
 a moment and wonder: why the hell aren't you at the hospital with your
 wife and newborn son, Rob?  ;-P
 
 Congrats to the Cummings family!

He's just on Wi-Fi there while she's sleeping!  And playing with the kids.  :)



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



Re: [PHP] Passing variables between pages

2008-09-19 Thread Wolf
!-- SNIP --
 Main page, login, $_SESSION gets set.

!-- SNIP --

What Dan says, Sessions is the way to go with anything where you have logins 
and need to do more stuff with the person.  Easy to set up, easy to handle...

Of course, if you want to do it without sessions, you could get the session ID 
when they login to the server, store it in a DB table that they are logged in, 
then if the session ID goes away, then you log them out and push them to the 
login page.

But why go around your elbow to blow your nose?

Wolf

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



Re: [PHP] SESSIONS vs. MySQL

2008-09-19 Thread Wolf

 Philip Thompson [EMAIL PROTECTED] wrote: 
 Hi all.
 
 Let me start out by saying, I have STFW and read through the list  
 archives. Now that that's out of the way.
 
 To speed up our application, we want to implement using SESSIONs in  
 some locations. Beforehand, on every page, we would run approximately  
 30-40 queries just to get the page setup - user information and other  
 stuff. Now while we can't take away all of the setup queries, we would  
 like to reduce the startup number.
 
 Ok, so I've implemented this in several places where information  
 basically does not change from page to page. Jumping to the point/ 
 question... when does it become more inefficient to store lots of  
 information in SESSION variables than to run several more queries?  
 Note, we are actually storing sessions in the database - so a read/ 
 write is required on each page load - it's not file sessions.
 
 Now I know this can depend on the complexity of the queries and how  
 much data is actually stored inside the sessions... but initial  
 thoughts? To give you a number, the strlen of the _SESSION array is  
 325463 - which is equivalent to the number of bytes (I think).
 
 Thanks,
 ~Philip

We carry a sh!tload of information in our session, without slowing anything 
down.  In fact, it takes the servers longer to run a full query then to use the 
session information.

But we use the $_SESSION information.  Our first query sets everything up in 
the session and we take on from there, and use stuff from the $_SESSION to 
actually make the rest of the pages faster.

30-40 queries just to set up a page?  That's an abomination that shouldn't see 
the light of day.

Anything slower then 2 seconds without any interaction back to the users will 
be short-lived

Wolf

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



Re: [PHP] ftp_pasv - question

2008-09-17 Thread Wolf

 jogisarge [EMAIL PROTECTED] wrote: 
 
 hello @all,
 
 i have to change my ftp connection in passive mode.
 now i am not sure, where i have to place the ftp_pasv statement.
 do i have to place it after ftp_connect or after ftp_login, or ...
 
 i hope somebody can help me !
 
 by jogi

Sure, RTFM as it has examples right there!

http://us2.php.net/ftp_pasv

HTH,
Wolf

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



Re: [PHP] Why MS Won't Retire Browsers -- was: Interntet Explorer 8 beater 2

2008-09-11 Thread Wolf
 Micah Gersten [EMAIL PROTECTED] wrote: 
 The problem is that if you're running on older hardware, IE7 might be
 too CPU intensive to run correctly.  That's why MS won't set Sunset
 Dates for an old browser.  They instead set the Sunset Dates for the OS
 and that's how they make things out of date.  They say upgrade the OS. 
 Matter of philosophy.  The problem is that the new OS won't run on the
 old hardware and costs lots of money so people don't upgrade.  Remember,
 MS is for profit.  If you can just upgrade your browser, they don't make
 any money.  If you upgrade your OS, they do.

My last upgrade was from XP to Ubuntu.  :)

And believe it or not, if you want to test your test on Ubuntu there is an IE 
for it or you can just WINE things.  :)

Wolf

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



Re: [PHP] Securing pages sections

2008-09-11 Thread Wolf

 Dan Joseph [EMAIL PROTECTED] wrote: 
 Hi All,
 
 This is more of a logic/opinion question...  I want to get some fresh ideas.
 
 I am working on a system to manage quotes and orders.  I have many users,
 all different levels, and want to secure pages based on active session, user
 level, and then go as far as putting access keys on a given page to only
 give it access to those people with the key can access the page.
 
 I'd like to know what others are doing from a logic stand point.
 
 I've gone as far as creating a couple tables:
 
 SecurityKeys
 
 - SecurityKeyID
 - KeyName
 - KeyLevel
 - IsActive
 
 SecurityKeysAssigned
 - AssignedID
 - EmployeeID
 - SecurityKeyID
 
 Would anyone suggest a different strategy to the database portion?  Maybe
 additions or subtractions to the tables?
 
 Also, how would go about implementing them the key system?
 
 Again, I am looking for some opinions or experiences anyone has had doing
 this.

I have a quote system I developed many years ago.

It uses Sessions and sets the pricing per other defined rules in the table on 
the products.  I have set percentages so that someone who doesn't get the deals 
gets the full price and each deal after that gets tweaked.  When updating the 
product you can either set the price point for the rest, or set the percentages 
and the forms do the work.

You use the sessions and check to see if active.  You have a temp table that 
runs while people are shopping and the quotes/orders are saved with the 
date,time,userID and tied in the DB to the user so that I easily get a set of 
links to them.

HTH,
Wolf

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



Re: [PHP] Mysqli issue

2008-09-11 Thread Wolf
 Jason Pruim [EMAIL PROTECTED] wrote: 
 No political undertones in this one I promise! :)
 
 Attempting to setup a prepared statement in php that will update a  
 record in a mysql database using mysqli
 
 Here is the relevant code:
   $stmt = mysqli_stmt_init($link);
   mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName, email,  
 phone, record, subscribed, date, IPAddress, Business, Address1, City,  
 State, Zip, Coffee, Meeting, areaPlans) VALUES  
 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));
   
   mysqli_stmt_bind_param($stmt, 'ss',  
 $_POST['txtFName'], $_POST['txtLName'], $_POST['txtEmail'],  
 $_POST['txtPhone'], $_POST['txturl'], $_POST['record'],  
 $_POST['subscribed'],$date, $_SERVER['REMOTE_ADDR'],  
 $_POST['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'],  
 $_POST['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'],  
 $_POST['rdoTime'], $_POST['areaPlans']) ;//or die(mysqli_error($link));
   echo BRDump of stmt:BR;
   
   mysqli_stmt_execute($stmt) or die(mysqli_error($link));
 
 Here is my error message:
 
 You have an error in your SQL syntax; check the manual that  
 corresponds to your MySQL server version for the right syntax to use  
 near '(FName, LName, email, phone, record, subscribed, date,  
 IPAddress, Business, Addr' at line 1
 
 Now I may just be being dense but I can't figure out the problem...  
 Migraines are not helping right now though
 
 Can anyone see my stupid mistake? :)

OK, you asked for it...

You aren't checking your stuff before dumping it.  None of it...

So, you should be taking the post variables and slapping them into a checker.

Then, your statement should be more along the lines of:
mysqli_stmt_bind_param($stmt, 
'ss','$txtFName','$txtLName','$txtEmail','$txtPhone','$txturl','$record','$subscribed',$date,
 
'$REMOTE_ADDR','$txtBusiness','$txtAddress1','$txtCity','$txtState','$txtZip','$rdoCoffee','$rdoTime','$areaPlans')
 ;

HTH,
Wolf

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



Re: [PHP] Mysqli issue

2008-09-11 Thread Wolf
!-- SNIP --
  Attempting to setup a prepared statement in php that will update a
  record in a mysql database using mysqli
 
  Here is the relevant code:
 $stmt = mysqli_stmt_init($link);
 mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName,  
  email,
  phone, record, subscribed, date, IPAddress, Business, Address1, City,
  State, Zip, Coffee, Meeting, areaPlans) VALUES
  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));
 
 mysqli_stmt_bind_param($stmt, 'ss',
  $_POST['txtFName'], $_POST['txtLName'], $_POST['txtEmail'],
  $_POST['txtPhone'], $_POST['txturl'], $_POST['record'],
  $_POST['subscribed'],$date, $_SERVER['REMOTE_ADDR'],
  $_POST['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'],
  $_POST['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'],
  $_POST['rdoTime'], $_POST['areaPlans']) ;//or die(mysqli_error 
  ($link));
 echo BRDump of stmt:BR;

!-- SNIP --
  Then, your statement should be more along the lines of:
  mysqli_stmt_bind_param($stmt,  
  'ss','$txtFName','$txtLName','$txtEmail','$txtPhone',' 
  $txturl','$record','$subscribed',$date,  
  '$REMOTE_ADDR','$txtBusiness','$txtAddress1','$txtCity','$txtState','$ 
  txtZip','$rdoCoffee','$rdoTime','$areaPlans') ;
 

Double DOH here...

I was looking at my MySQL not MySQLi stuff, and there is some differences...  
Must be the cold drugs/

'$var' definitely should have been $var since you want the contents, but 
according to the php site, the prepare is for the query, so my guess is you'll 
want the query put in the line instead of what looks to be the pieces of the 
insert?
http://us2.php.net/manual/en/mysqli-stmt.prepare.php

mysqli_stmt_prepare($stmt, 'SELECT District FROM City WHERE Name=?')

Of course, you could do the 
Query=insert into TABLE values($var,$var.);
mysqli_stmt_prepare($stmt, $Query);

I'm gonna go drink more cold drugs now...

Wolf

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



Re: [PHP] tedd's back from vacation

2008-09-10 Thread Wolf
 Shawn McKenzie [EMAIL PROTECTED] wrote: 
 tedd wrote:
  At 10:05 PM -0400 9/9/08, Dan Joseph wrote:
 
  Look, just because we let you out of your cage, doesn't mean you have 
  to go
  breaking your bones!  No more vacations!
 
  BTW, was that dance in response to MSU winning 2 games in a row?
 
  -- 
  -Dan Joseph
  
  Dan:
  
  I only root for two schools: One is MSU and the other is any school who 
  plays against U of M.
  
  However, when I go on vacation there is no communication with the 
  outside world whatsoever. No radio, no TV, no Internet, no email, no 
  cell phone, absolutely nothing. I vacation on Beaver Island in the 
  middle of Lake Michigan -- yes really, Beaver Island. :-)
  
 
 No phones? No lights?  No motorcars?  Not a single luxury!?!?

He said Beaver Island, so there were lots of DAMs to check out and sites to 
see!  :-D

Wolf

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



Re: [PHP] tedd's back from vacation

2008-09-10 Thread Wolf
 Jason Pruim [EMAIL PROTECTED] wrote: 
 
 On Sep 10, 2008, at 1:10 PM, Jochem Maas wrote:
 
  Jay Blanchard schreef:
  [snip]
  OK, this is getting ridiculous. I think we need a new PHP list.  
  Something like [EMAIL PROTECTED] sounds about right.
  [/snip]
  I knew jealousy would rear its ugly head eventually.
 
  what's a pen?
 
 
 
 www.jibjab.com/view/103211
 
 Probably not totally work safe ;)
 

It's OK, someone removed it!  :(

Bad Jason, sending a bad link to the group...

No donuts for you!

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



Re: [PHP] The Best PHP Editor.

2008-09-10 Thread Wolf
jmatt wrote:
 Hi, I was using NVU to edit PHP but when I upload the index.php file back
 there will always be a slight error in disorientation.
 Example using NVU I edited the text just a bit then bam..The webpage became
 really funny
 
 What is the best to edit my PHP file?
 Thanks

Vi, nedit, pico, nano

Read the list archives, this topic is covered extensively there...


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



Re: [PHP] translations for PHP app

2008-09-08 Thread Wolf
Shawn McKenzie wrote:
 Hi All,
 
 I'm looking for professional translations from English of the following:
 - admin.php lang file just under 150 PHP defines
 - user.php lang file just under 30 PHP defines
 - a javascript file with about 25 single word defines
 - about 19 PHP files with 2 defines in each
 
 Most defines are 1 or 2 words with a few being sentences.
 
 I need translations from English into the most common languages of my
 users: Spanish, French, Italian, Chinese, Indian, Russian.  Also, anyone
 having expertise in other languages, I would love to have them, please
 contact me.
 
 I also have a 30+ page user guide for using my software.  Many pages
 contain large graphics, but the English text I woul love to have
 translated.
 
 Of course I will pay.  PayPal only.

Have you tried blowfish or the Google Translator?  The last time I tried
the google one, it did a whole page on the fly and seemed to be pretty
good at it.

Wolf


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



Re: [PHP] CSV output.

2008-09-08 Thread Wolf
Tom Shaw wrote:
 I'm outputting a bunch of numerical values for a spreadsheet to calculate
 total sales among other things on a client shopping cart. I'm running into
 problems with values that contain zeros after the decimal. If a value is
 234.55 the value outputs fine to the CSV file but if the value is 234.00
 only 234 shows up. Is there any way to force the zeros into the spreadsheet?

If your code is written correctly, the .00 will be in the CSV file

However the program you are using to view the CSV file probably
auto-hides them without you knowing it.

POST YOUR Code
POST your CSV output

Without Code and without Output, you don't really show the problem.

Wolf


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



Re: [PHP] Header() - POST

2008-09-05 Thread Wolf
!-- SNIP --
 scrubbing them, and rebuidling the post string and trying to resubmitt it
 using headers().  I'm getting this error:

Why do you want to re-submit it?

Why not just parse it in the same page?

If not that, then use sessions and set the information, do a meta-refresh to 
redirect to the processing page, then use the processing page to pull the 
session information and make sure it came from the correct page.

HTH,
Wolf

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



Re: [PHP] Sending username/password

2008-09-05 Thread Wolf
Jay Moore wrote:
 Greetings list!
 
 Is it possible (and if so, how) to send username and password
 information to a website with PHP?
 

In one word...

CURL


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



Re: [PHP] Sending out mass emails

2008-09-04 Thread Wolf
!-- SNIP --
 Also what is the best way about going around being black listed due to spam
 issues. 
 
 I know that the headers need to be set to avoid being detected as spam.
!-- SNIP --

Check the list archives for these answers.  Someone asked about this within the 
last 14 days even.

As for the spamming, you spam me and I send the spam to the national DBs 
(ftc.gov) and other spam reception/cleaning points.  Either way, you spam 
people and the users who report will report you.  Those who don't want it will 
report it as spam, and others will set up mail filters to just auto-delete at 
the mail server so they never see it.

Wolf

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



RE: [PHP] Google Chrome

2008-09-04 Thread Wolf
!-- SNIP --
 You can at least track memory + cpu usage through the Task Manager
 (Ctrl-Alt-Del + T on most distros). In the Task Manager, I also noticed
 that GoogleUpdate.exe is running even when Chrome.exe is not. This made
 me a bit curious, so I went into msconfig (the Microsoft GUI utility for
 modifying startup programs, services, and system INI files) and saw that
 GoogleUpdate.exe had been added to the list of programs to run on
 Windows startup.
 
 I hate, hate, HATE it when programs install resident agents that eat my
 memory and perform background network activity. Rrgh! Points taken away
 from Google for this app's EULA and its methods. Slick otherwise, though
 (aside from the lack of XMLDOM instantiation support for Javascript)...

startup monitor - sure it runs at startup, but that little bugger keeps an eye 
on my startup and asks me if I want to allow my startup to be modified.

:-)

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



Re: [PHP] unset($_GET['i'])

2008-09-04 Thread Wolf

 Bill [EMAIL PROTECTED] wrote: 
 Dan Shirah a écrit :
  How about just adding a simple counter on your page.
  
 
 That's what I do but that counter resets when you press F5 and is not 
 functionnal.
 
 Why $_GET['i'] doesn't unsets ?

Because you get a new i from the URL, hence the GET

What you can do is set a session variable when you GET the first i, then just 
check and if the session variable is present, you don't process the next time 
you GET i.

Wolf

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



Re: [PHP] Assign things to users

2008-08-26 Thread Wolf
 Dan Joseph [EMAIL PROTECTED] wrote: 
 Hi,
 
 This is more of a logic question than a PHP question.  I wanted to get some
 opinions on how some of you are doing things like this.
 
 I have a set of employees in our quote management system.  We get thousands
 of quotes per hour, and every 15 minutes I have a cron that goes out and
 grabs the unassigned and goes in a round robin fashion assigning the quotes
 to the employees.  I have the table setup like:
 
 User ID, Username, AssignTolken
 
 What I've been doing is grabbing the user who has AssignTolken = 1, and
 giving them the next quote.  Then I change them to 0, pull up the next user
 in line, and set them up to get the next quote with AssignTolken = 1.
 
 My question is:  How do you all do handle similar situations like this?
 I've been thinking there has to be a better way to do it, but I have not
 been able to think of a good way to do it.  I'd like to see how if I'm doing
 it like everyone else, or what else is out there.  Any ideas would be
 appreciated!
 

The only thing I don't see is a current total count setup, meaning if John has 
the AssignTolken=1 then he'll get the next unassigned one.  HOWEVER if John has 
3000 quotes and Jim only has 1500, then you really want to assign Jim the next 
quote as it would be done sooner.  

You might also want to track who is in the office or on vacation as well so 
that you assign only to Active people.

My $.02

Wolf

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



Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-25 Thread Wolf
!-- SNIP --
 I'm using Eudora for the Mac and the first 32 lines of all my emails 
 are the header and if I click the Blah Blah button (that's supposed 
 to show the header information), then I get another 25 lines of 
 header. That's 57 lines in total to get to the contents of the email 
 -- far more than what I need/want.

Really, they still make Eudora?  Or is this an old copy on the MacIntosh IIe 
that you are running.  ;)

Wolf

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



Re: [PHP] RE: Sale 79% OFF !!!

2008-08-21 Thread Wolf
Because there is 1 or more out there who don't know any better and get sucked 
in.

And when you look at it as being able to use a name book or dictionary (readily 
available mind you) along with a list of domains.Once you add them 
together, the resources needed for sending the emails is tiny.  

So it takes no investment to send out a million emails.  And every valid 
response after the first one is bonus.

 Ashley Sheridan [EMAIL PROTECTED] wrote: 
 I don't understand how people can fall for this kind of thing, all those
 Nigerian scams and the like. For every person that falls for it, a
 million more emails get sent, making everyone elses lives hell :(
 
 Ash
 www.ashleysheridan.co.uk


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



Re: [PHP] Ejecutar comando con php con otro usuario.

2008-08-21 Thread Wolf

 CanihoJR [EMAIL PROTECTED] wrote: 
 Como puedo ejecutar un comando de sistema con otro usuario que no sea
 www-data??? si realizo un exec(sh miscript.sh); se ejecuta con www-data y
 me gustaria ejecutarlo con mi usuario. (linux)
 
 Gracias d antemano

Check your permissions.

Wolf

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



Re: [PHP] Developing a game using Ming

2008-08-20 Thread Wolf

 Yasir Malik [EMAIL PROTECTED] wrote: 
  You should probably try asking a Flash or Actionscript list.
  This is a
  PHP list...
  
 I'm not asking how to do something in Flash or ActionScript; I'm asking 
 whether it is possible to do somethings using Ming, a PHP extension.

You know, I STFW and came up with some pretty good information for your 
questions...

http://www.google.com/search?q=php%3A+mingie=utf-8oe=utf-8aq=trls=com.ubuntu:en-US:unofficialclient=firefox-a

So, where is your code that you have written and having an issue with it doing?

Wolf

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



RE: [PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread Wolf
 Jay Blanchard [EMAIL PROTECTED] wrote: 
 [snip]
 PS - for those that know, I'm back ... with a vengeance.
 [/snip]
 
 That explains why I didn't sleep well last night. :)
 
You kidding, I don't think any of us regulars did...  

Glad to see you back Jochem.

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



Re: [PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread Wolf
 tedd [EMAIL PROTECTED] wrote: 
!-- SNIP --
 I've freelanced longer than most these guys have been alive.
 
 Cheers,
 
 tedd

See, I knew you were one of the wise ancient ones!  Kluthluu!!  ;)

Wolf

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



Re: [PHP] phpguru.org back up

2008-08-13 Thread Wolf
 Richard Heyes [EMAIL PROTECTED] wrote: 
 Hi,
 
 You'll be pleased to know (I'm sure) that phpguru.org is back up and
 working (for the most part I would imagine).

Glad to hear it!

So, which backup solution are you using?  Or should I say which 12 backup 
solutions?  ;)

Wolf

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



Re: [PHP] phpguru.org back up

2008-08-13 Thread Wolf

 Richard Heyes [EMAIL PROTECTED] wrote: 
  So, which backup solution are you using?  Or should I say which 12 backup 
  solutions?  ;)
 
 Lol. Not that sophisticated actually, trusty old tar and gzip, along
 with regular downloads to my desktop so that they're in two locations.

Before I got smart in locking down my forms, someone tried to hack my site.  
They got some of the files but not all.  Luckily the ones they got were ones 
that I had backups of.  Only it took me a couple of days to FIND them.  Now my 
DBs back themselves up hourly and my full site goes tar as well.  And the forms 
are fully secured out.  :)

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



Re: [PHP] Code works alone but not with other code.

2008-07-25 Thread Wolf

 Ed Curtis [EMAIL PROTECTED] wrote: 
 I've got this chunk of code (included) that used to work fine in a 
 script up until a couple of weeks ago. Nothing has changed in the php 
 page at all, it just quit working. If I take this chunk of code and 
 place it alone in a php script it works just fine, but only by itself. I 
 don't understand what's going on and don't see anything that would make 
 the script seem like it's just skipping this chunk of code, without 
 errors, when I run it. I'm using PHP 4.4.4-8 mand MySQL 5.0.32 on Debian 
 Etch.
 
 The code does use nested MySQL queries, it worked before but I thought 
 maybe something changed in PHP or MySQL recently in updates that might 
 have broken it, but there is another chunk of code in the script that 
 uses nested queries as well that works fine just as it had been.
 
 I also have another script that has recently broke and seems to skip a 
 section of code as well without errors. There are no real similarities 
 between the two that I can see.
 
 Thanks,
 
 Ed
!-- Snip --

Doesn't work seems plenty bland, have you tried doing the following:
1.  Putting in die statements
2.  Verified the tables exist and have data in MySQL
3.  Checked the PHP error log
4.  Checked the MySQL error log

Just guessing I'd say your data was empty, but without more information, it's a 
pretty big shot in the dark.

Wolf

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



Re: [PHP] Code beautifier

2008-07-25 Thread Wolf
 tedd [EMAIL PROTECTED] wrote: 
 At 8:10 PM +0100 7/24/08, Richard Heyes wrote:
(and anal retentive) when you code :)
 
 I am; the problem is no one lives up to my standards... :-)
 
 Anyone else find the two sentences above used together disturbing? 
 Something about anal and up that doesn't sound good. :-)
 
 tedd

So disturbing that it would be nice if I could add an appropriate image to 
it...  ;)

Wolf

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



Re: [PHP] Code beautifier

2008-07-25 Thread Wolf
 Daniel Brown [EMAIL PROTECTED] wrote: 
 On Fri, Jul 25, 2008 at 12:56 PM, tedd [EMAIL PROTECTED] wrote:
  At 8:10 PM +0100 7/24/08, Richard Heyes wrote:
 
(and anal retentive) when you code :)
 
  I am; the problem is no one lives up to my standards... :-)
 
  Anyone else find the two sentences above used together disturbing? Something
  about anal and up that doesn't sound good. :-)
 
 This coming from a guy who, two messages prior, started a sentence
 with but.
 
 Reader's Digest-standard English aside, Tedd, Freud might have
 been right with you.  ;-P

True, but but and butt are two very distinct words...  ;)  I know Dan, it's 
that grammar thing..  Even using the Queen's English makes it a tush for the 
push. ;)

Wolf

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



Re: [PHP] Help with an error...

2008-07-24 Thread Wolf

 [EMAIL PROTECTED] wrote: 
 Well all the insight were great, I am not getting and errors but I am not
 getting mail. I am looking but php -e isn't telling me anything, and php
 -l says there no syntax. What else can I do for debugged.
 
 Payne
!-- SNip --

1.  BOTTOM POST

2.  mailq - this should display if you have any mail queued up to send on the 
server and possibly if it errored out

3.  check your php error log.  If you don't have one, modify your php.ini to 
create one, restart webserver if running via that, CLI should read it on the 
fly.

Wolf

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



Re: [PHP] Help with an error...

2008-07-24 Thread Wolf
!-- SNIP --

Here is the updated code 
 

Notice!! 
 $message doesn't contain any PHP code within it
$query only has a single ; within the whole line, right at the end of the ; to 
complete the PHP assignment string.  Placing one inside it will barf the script 
typically.

$headers are all concactenated together, you were overwriting them all with 
your last statement.


?php 
//VAR Are set here 

$hostname = `hostname -f`; 

//This is a simple email to give me the status from yester day. 
//This connect the script to the db 

//To use ',' between e-mail address for multiple recipents 
$to = '[EMAIL PROTECTED]'; 

//Set the Subject here... 
$subject = The IPs that Attacked .$hostname. report from Fyre; 

//Database Set is here... 
require_once('mysql_connect.inc'); 

$query = Select ip, date, time, CONCAT(city, ', ',country) as location from 
ips where country !=' ' and date = current_date() order by date,time,country 
asc; 
$result = mysql_query($query) ; 

if ($result) //if that ran ok, display the record 
{
 $data = table width='150'trth Country /thth # of Attacks 
/th/tr;
 //fetch and print the records 
 while ($row = mysql_fetch_array($result,MYSQL_NUM))
 { 
  $data.= trtd align=left$row[0]/tdtddiv 
align=right$row[1]/div/td/tr; 
 } 
 $data.= /table; 

 mysql_free_result ($result); //free up the resources 
}
else //if did not run ok 
{
 $data=pThis could not be display due to a system error. We apologize fore 
any incovenience./pp.mysql_error()./p; 
} 
mysql_close(); //Close the database connection. 



//The Message goes here 
$message = html 
head 
 titleAttack's on $hostname/title 
/head 
body;
$message .=$data;
$message .=/body 
/html; 

//To Send HTML Mail; The Content-type header must be set 
$headers = 'MIME-Version: 1.0' . \r\n; 
$headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; 
$headers .= 'From: FYRE REPORT [EMAIL PROTECTED]'; 

// Mail it 
mail($to, $subject, $message, $headers); 
? 
 

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



Re: [PHP] CONFIGURE IONCUBE LOADER WITH SELINUX

2008-07-17 Thread Wolf
 Kapil Kapil [EMAIL PROTECTED] wrote: 
 Hi!
 
 Do anybody have any idea - how to configure ioncubeloader with SELinux on
 linux?
 
 Currently  SELinux logs says - SELinux is preventing /usr/sbin/httpd
 (httpd_t) execmem access to
 Unknown (httpd_t).
 
  apache error log says permission denied.
 
 Thanks
 Kapil

Sure we do!  It's even in the manual on how to fix it!

Ohhh, and Google has info on it too!

RTFM and STFW and you should be fine.

Wolf


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



Re: [PHP] mkdir permission errors

2008-07-15 Thread Wolf
 Daniel Brown [EMAIL PROTECTED] wrote: 
 On Tue, Jul 15, 2008 at 7:05 AM, Wei, Alice J. [EMAIL PROTECTED] wrote:
 
  Do I really have to reinstall the entire Fedora?
 
 You may be a prime candidate for Windows.

Well, you *could* load Fedora on another machine, fully update it, and then go 
into / and do an ls -alF.
THEN, on the machine that you have completely messed up the permissions on, you 
would go to / and do an ls -alF

Then traverse the directory structures simultaneously on both machines and make 
sure the one you messed up matches the pristine installed one.

Once you have done that, you should be OK.

Wolf

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



RE: [PHP] mkdir permission errors

2008-07-15 Thread Wolf
 Nope, I have set mine to 755, and it does not seem to be giving me any 
 errors. This is the safer way to do it, right?
 
 Alice

Alice,

At this point, you need to re-install the OS or prepare to get your machine 
completely hacked and trashed.  With your permissions that badly screwed up, it 
is only a matter of time before someone finds it and has their own ghost server.

First, go pick up a System Admin book for Redhat

Second, READ IT, Especially the parts on permissions and changing users

Third, Re-install the OS

Fourth, read the CLI vs. HTTP differences on programming languages you are 
using.  Obviously Perl and PHP are going to give you the same errors when using 
the HTTP and will operate differently from the CLI unless running as the same 
user.

This might even help your schooling.  Hopefully your classroom exercises are 
further along then these basic principles, but if not I have severe doubts in 
anyone graduating with an MIS from Indiana University.

Wolf

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



RE: [PHP] Math Weirdness

2008-07-14 Thread Wolf
 Robert Cummings [EMAIL PROTECTED] wrote: 
 On Mon, 2008-07-14 at 14:12 -0500, Jay Blanchard wrote:
  [snip]
  So again... from whence do you conjure $endingBal? :)
  [/snip]
  
  $endingBal is conjured from the database tracking the account balance.
  For any 24 hour period the beginning and ending balance for subsequent
  days is the same unless adjustments or payments have been made to the
  account in that period.
  
  2:35 AM balance becomes the ending balance for the previous day and
  becomes the beginning balance for the day we are beginning.
 
 Isn't it possible then that your data is out of synch between the
 current balance and the previous day's ending balance?
 
 Cheers,
 Rob. 


See!!!  I told you he was skimming the profits!  Better check his desk for the 
other set of books! ;)

I'd suggest the int approach.

Wolf

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



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wolf
 Wei wrote: 
 Hi, Rob:
 
   I forgot to mention that I have been using yum install.
   I have reinstalled the entire thing, put back all the packages, and then I 
 went to /var and did a chmod -R 777 var, and then did a
 
[EMAIL PROTECTED] var]# chown -R apache:apache .
 
 Interestingly, I do not see anything different, and I still get this error 
 that says my permission is denied. Here is my
 
 Obviously, my last one has already changed the owner to apache 
 already.Nevertheless, I am still denied even when I am now logged in as root. 
 Is this anything with firewalls?
 
 Thanks for your help.

Alice,

$whoami=system('whoami');
echo $whoami;

$pwd=system('pwd');
echo $pwd;

That should tell you what ID you are and the path you are in.

Make sure that the path you are in has the correct permissions.

Wolf


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



RE: [PHP] mkdir permission errors

2008-07-14 Thread Wolf
Alice: Bottom post like everyone else...

 Wei wrote: 
 Hi, Wolf:
 
   Like I guessed, I am still defined as the root user.
 
 [EMAIL PROTECTED] html]# php test.php
 root
 root/var/www/html
 /var/www/html
 
 This is the output I have got from using your script.
 I have made a following quick change:
 
 [EMAIL PROTECTED] var]# chown -R root:root .
 
 Not surprisingly, I am still not able to make a new directory using PHP with 
 the HTTP.
 Could there be anything else I missed?
 
 Alice

You are testing from the CLI but trying to run it via HTTP.  There IS a 
difference and continued testing using a different method is going to give you 
different results...

like the following script acts differently depending on where you use it.

?php

$command= rm -rf / *.php.bak;
exec ($command,$output);

print_r($output);
?

Wolf

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



Re: [PHP] Freelance PHP development in India

2008-07-13 Thread Wolf



Denis L. Menezes wrote:

Dear friends.

I am looking for freelance web developers in India.

Can contact me?

Thanks
Denis


Why just in India?  There are a number of us available via the world.

Wolf


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



Re: [PHP] Most popular per month

2008-07-12 Thread Wolf

snip
..
.
$perc50=(img50 int)/$total;

You can do it per day, per month, per year, per 28 days, per PMS cycle, 
per anything you want provided you have the data to do it.

/snip

:) this is the part where i am a bit confused actually, can you give me one or 
two examples and i'll work from there?



What you have to do is get all the pictures viewed for a specific 
day/time frame (you said this was all tracked in a DB anyways) and then 
add up all the totals and perform the same calculations using the views 
all added over the days all added.


$img1=img1 int day1 +img1 int day2 +img1 int day3  img1 int day30
$total= img1 int day1 +img2 int day 1+img3 int day1 +...img50 int day30

$img1perc= $img1/$total


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



Re: [PHP] apache/vhosts wuestion...

2008-07-11 Thread Wolf

bruce wrote:

Hi..

I recognize that this might be off base!! I've got an apache/vhosts question
that i'm grappling with. I've got a linux/apache system, and I'm trying to
get multiple vhosts to work. If this is an appropriate place, I'll provide
additional information on the issue.

I've looked/researched via the 'net but my issues are still with me!

Thanks



You guess it, this isn't an appropriate place.  What pieces are you 
struggling with as the Apache documentation works great for this stuff. 
 I've got 6 hosts on a single server with no issues using the Apache 
documentation.


Wolf


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



Re: [PHP] Most popular per month

2008-07-11 Thread Wolf

Ryan S wrote:

Hey!

The client has a set of 50 images that keep rotating everyday and when a user 
clicks one of those images he is taken to that images site, in the background 
(database) i maintain a counter _for the day_ and then display the top ten 
images everyday in this format: 1-10

before the next days counter starts this data is stored in a table which has a 
simple structure like this
img_id1 int,img_id2 int  (etc till img_id10) 



Now the client wants a little extra functionality, and with me sucking at maths 
I need some help please, basically he now wants to have a chart with all the 50 
images there and showing _via percentages_ instead of the present 1-10 display 
which ones are the most popular till date.

example:
1. image name: (percentage here)
2. image name: (percentage here)
3. image name: (percentage here)
etc
any ideas on where i can start/ code tips/ urls etc would be most appreciated.
Also, if i am not mistaken there was some charting software to display this 
kind of data in pie and line charts... anybody know what i am talking about? 
because i cant find such a link in my bookmarks.

Thanks in advance,
Ryan


percentages:
$total=img1 int + img2 int + img3 int + img50 int;
$perc1=(img1 int)/$total;
$perc2=(img2 int)/$total;
.
..
.
$perc50=(img50 int)/$total;

You can do it per day, per month, per year, per 28 days, per PMS cycle, 
per anything you want provided you have the data to do it.


Google had an pie chart thingie, check the archives of this list.

HTH,
Wolf


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



Re: [PHP] phpmyadmin

2008-07-10 Thread Wolf

 Ronald Wiplinger [EMAIL PROTECTED] wrote: 
 I would like to use this time phpmyadmin (2.11.3) to setup for a new
 user a database, which he can use to setup his own tables for his web site.
 
 User abc should get his own database xyz.

Yup, you can do this.  Depending on how you are setting this up, you could 
theoretically put a separate phpmyadmin folder in each of the web folders of 
the users who use your services.

Have you RTFM and set it up as the documentation stated and then tested it by 
logging in as the new user?

http://www.phpmyadmin.net/home_page/docs.php

Wolf

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



Re: [PHP] Keeping POST values when paging

2008-07-07 Thread Wolf
 Mayer wrote: 
 Hiya all,
 
 I have coded a PHP site on an intranet which forms a MySQL query based on
 multiple inputs on a large form. The form results are POSTed back to itself,
 and query is formed, and the results are returned from the database and
 echoed.
 
 I am looking to set up a basic paging system (back/next, jump to page 3,
 etc) in order to limit results for efficiency.
 
 The problem I get is that my next link - something like
 href='resultspage.php?page=2' - naturally reloads the page without all the
 POST variables it needs to recreate the query.
 
 Is there some way of forcing the page to remember and reload the POST
 variables when clicking next? Or, if that's difficult, can anyone suggest
 a good way of addressing this problem without too much recoding? I'm sure
 there must be a neater way of doing it then simply passing 30 or so
 variables using GET.
 
 Many thanks in advance.
 Jon.


Set session variables, have the script check the session variables.

That'll keep the pages rolling, shouldn't take much coding, and you can change 
some things on-the-fly.

HTH,
Wolf

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



Re: [PHP] Question before I end up writing alot of extra code...

2008-07-07 Thread Wolf
 Jason Pruim [EMAIL PROTECTED] wrote: 
 Hi everyone!
 
 So it's been a nice long weekend, I come in to work and try and mess  
 with a project that I'm working on to get some new features added. All  
 was going well until I realized that now my application is breaking...
 
 Here's the details...
 
 PHP 5.2
 MySQL 5.2
 
 I store the info in the database which is submitted from a HTML form..  
 Some of it text boxes, some check boxes, some radio buttons... I  
 $_POST the info from the form into the processing script.
 
 The problem I'm running into though, is when a value has not changed  
 it doesn't get $_POSTed back and my update script erases the info in  
 the database... I'm trying to avoid using $_GET since it can be quite  
 a few variables.
 
 Is there anyway I can do it without comparing the original field to  
 what I am displaying?

Gone for a weekend and we have to retrain, at least I'm not the only one...  ;)

POSTed variables are ALWAYS posted back, changed or not.

More then likely you are forgetting a piece of code, but since you didn't post 
the offending code, I can't point out where you forgot the $ or to restate a 
variable.  :-P

Have you tried echoing the mysql query to verify it is correct?  Have you 
checked the logs?

Wolf

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



Re: [PHP] Question before I end up writing alot of extra code...

2008-07-07 Thread Wolf
Oh, and make sure you bottom post too so you actually follow everything!  ;)

 mike [EMAIL PROTECTED] wrote: 
 doh - and mysql_escape_string or equivalent.
 
 
 
 On 7/7/08, mike [EMAIL PROTECTED] wrote:
  please oh please also run that through filter_input() before throwing
  a $_POST directly into the db query ;p
 
 
  On 7/7/08, Shawn McKenzie [EMAIL PROTECTED] wrote:
   Jason Pruim wrote:
   
MAIN PAGE:
?PHP
   
  
   echo $row['Tab'];  //what do you get?
  
if($row['Tab'] == done){
   $Tchecked1 = CHECKED;
   $Tchecked2 = NULL;
}else{
   $Tchecked1 = NULL;
   $Tchecked2 = CHECKED;
}
   
echo
fieldsetTabBR
input type=radio name=rdoTab value=done $Tchecked1Done BR
input type=radio name=rdoTab value=on $Tchecked2Not DoneBR
/fieldset;
?
PROCESSING:
?PHP
   
  
   print_r($_POST);  //what do you get?
  
   $tab = $_POST['rdoTab'];
   $record = $_POST['txtRecord'];
   $updateQuery = UPDATE `current` SET Tab='$tab'  WHERE
   Record='$record';
  mysqli_real_query($link, $updateQuery);
?
   
  
   You're saying now that that record now has field Tab=''?
  
   -Shawn
  
   --
   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] first e-shop

2008-07-05 Thread Wolf

Alain Roger wrote:

Hi,

I need to create an e-shop in PHP.
this is for me the first time that i need to do that and i think the way how
to approach such topic is different that creating a simple corporate web
site.



STFW:  php: open source e-commerce

http://www.google.com/search?q=php%3A+open+source+e-commerceie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a


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



Re: [PHP] Simple array problem

2008-07-01 Thread Wolf

Brian Dunning wrote:

I'm trying to add a number to a value in an array. Pretend I have this:

$new_value = array('orange', 2);
$arr = array(
array('blue', 4),
array('orange', 5),
array('green', 6));

I want to add the new value to the existing matching array element, so I 
end up with this:


$arr = array(
array('blue', 4),
array('orange', 7),
array('green', 6));

Seems like it should be really simple but all the ways I can figure out 
to do it are too kludgey.



What have you tried so far?

Wolf


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



Re: [PHP] V4 Vs V5 Issue

2008-07-01 Thread Wolf

 Neil [EMAIL PROTECTED] wrote: 
 Hi
 
 First Post here, I hope this is the right place for this post.
 
 This is probably not a php problem,  I think it may a configuration 
 issue, but sorry I just dont know where to look

Configuration issue of what?

 
 I have a V4 site the calls an on line editor and part of the process 
 is by window.onload. If I had to explain how it all works I could'nt 
 JS is not my thing and this is a fairly old piece of code.
 
 anyways
!-- SNIP --

 Line: 68
 Char: 21
 Error: Syntax error
 Code: 0

It's probably all JS, but if this is a PHP page that you've actually cut/pasted 
from, look at lines 67 and 68 and check to make sure you have a ; at the end of 
line 67.  Or a ) or a } or some other closing brace that you could be using 
previously.

Otherwise, check with a javascript list to see what the javascript errors are.

HTH,
Wolf

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



Re: [PHP] String to date

2008-06-30 Thread Wolf

 Mark Bomgardner [EMAIL PROTECTED] wrote: 
 I need to convert a date retrieved from user input to a mysql date.  Here
 the problem, I need to convert one of three possible combinations, either
 01/01/2008,01-01-2008 or 01.01.2008.  I can't use explode because it's
 limited to one character to explode on.  I would prefer not to use regexp,
 but think I am going to have to.  The one part of the code that works below
 is using 01/01/2008 format.  Any suggestions
 
 echo $olddate = '06/06/2008';
 echo br /;
 echo $olddate2 = '06-16-2008';
 echo br /;
 echo $olddate3 = '06.26.2008';
 echo br /;
 echo $newdate = date(Y-m-d,strtotime($olddate));
 echo br /;
 echo $newdate2 = date(Y-m-d,strtotime($olddate2));
 echo br /;
 echo $newdate3 = date(Y-m-d,strtotime($olddate3));
 
 markb

You've given us no code you are actually using (we can all write dummy test 
code).  

IMO, you need to either change your input form to give you the results in a 
certain way (split up the M,D,Y or only accept it in a specific format or any 
other way)

OR

You run the strpos and look for / . or - or   or ? and then use the 
data on that field.

Wolf

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



Re: [PHP] fwrite() Append Files

2008-06-27 Thread Wolf

Wei, Alice J. wrote:

Hi,

  I wonder if anyone on the list could tell me how to append the files as I am 
writing in them. I have a file that has no more than five characters per line, 
and I would like to keep its spacing between the lines. Right now I have the 
set up so that it could write in the first line, but the problem is that all 
the lines after it never get written in to the desired file.

  Is there some sort of command that I could use to append files as I am 
writing them? I would provide the code if this is not clear enough.

Thanks in advance.

 Alice


Alice,

ALWAYS POST CODE.  It gives us an example that you have done your 
assignment to begin with and aren't continuing to ask this list to do 
your work for you.


RTFM as the fwrite module is pretty clear on its usage.

But start with posting your current code (and not pseudo code) so that 
we can point you in a better direction.


Wolf


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



Re: [PHP] fwrite() Append Files

2008-06-27 Thread Wolf

Wei, Alice J. wrote:

Hi,

  Right now I enforced the file to read in through HTTP-Request and output it 
to a local file.
  Looks like this functioned perfectly after I used append functions after I 
attempted to write to the file!

Thanks to everyone who contributed to this.

Alice


Are you making sure to credit the work and suggestions in your code as 
required by your class documentation standards?



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



  1   2   3   4   5   >