[PHP] iteration of $GLOBAL

2004-01-12 Thread Chris Sherwood
hello everyone

I feel a little stupid asking this but I have tried multiple searches on google and on 
php.net and cant seem to find the snippet of code that will iterate through all the 
global variables for the session

thanks in advance

Re: [PHP] or return problem

2003-10-07 Thread Chris Sherwood
Well Unfortunately pat
You are going to have to be an unlazy man and use an if statement

Chris
 
 Calling the following retor_test() function causes a Parse error: parse
 error, unexpected T_RETURN message when the script is run:
 
 function istrue() {
   return true;
 }
 function retor_test() {
   istrue() or return( False );
   return True;
 }
 
 The problem is with the or return part.  Any ideas why?  I realize that
 I could use an if statement instead, but I'm a lazy, lazy man and I don't
 want to.
 
 
 Pat Carmody
 
 -- 
 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] File read and sort question

2003-10-06 Thread Chris Sherwood
Susan

It appears that you will want to use a database. and update it when the
files are removed. (possibly provide a page to do uploading, modifications
and deletions with .. this way you can automate the db)

other than that you will have to recreate everything each time you process
or display the file list.
and dont read the file into the db unless your gonna do the modifications
there
just store a reference link in the db that way your overhead stays small.

Chris


 The problem with using a database is the files within the directory are
 changing on, sometimes, a minute by minute basis. I think reading them
into
 the database then deleting them when they are deleted from the directory
 would be a huge amount of overhead. No?

 Something else which I did not make clear in my previous post; when the
 files are removed from the directory I no longer want them displaying in
my
 web page.

 Susan

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



Re: [PHP] include() problems

2003-10-02 Thread Chris Sherwood

-- snip --
From: Chris W. Parker [EMAIL PROTECTED]
 The address is: http://mydomain.com/forums/ssi.php?a=active
 
 The code I'm trying now is:
 $_GET['a'] = 'active';
 include('forums/ssi.php');

You're including the parent file in itself. This could be the problem.
--SNIP -- 


especially if the ssi.php is not a class

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



Re: [PHP] passing form information.

2003-10-02 Thread Chris Sherwood
Hi Payne

for starters your missing an ? at the last echo
? echo $l_name

secondly I would rewrite the sql statement to read
$sql = INSERT INTO $table_name
 (leads_id, title, f_name, l_name)
 VALUES
 (' .$leads_id. ', ' .$title. ', ' .$f_name. ', ' .$l_name.
');;


but the statement itself shouldnt cause a problem either way.

I am wondering where leads_id comes from however.. is it an auto number?


and finally your processing form is called addlead.php
and the form is posting to a form called addleads.php

hope this helps

chris
-- snip --
From: Payne [EMAIL PROTECTED]
 I am working a form to pass information from it to mysql data.  I am
 able to connect to the database. But nothing is being pass from the form
 to the php page.  This is my php code...
 -form.html

 html
 head
 titleUntitled/title
 /style
 /head
 body
 form name=form1 method=post action=addlead.php
 input name=title type=text size=40
 input name=f_name type=text size=40
 input name=l_name type=text size=40
 input type=submit name=Submit value=Submit Information
 /form
 /body
 /html
 --addleads.php
--
 ?

 include(./config.php);

 $sql = INSERT INTO $table_name
 (leads_id, title, f_name, l_name)
 VALUES
 ('$leads_id', \$title\, \$f_name\, \$l_name\);

 //debug tool

 print $sql;

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

 ?
 html
 head
 titleUntitled/title

 /style
 /head

 body
 ? echo $title ?
 br
 ? echo $f_name ?
 br
  ? echo $l_name

 --
-

 What I am getting this

 INSERT INTO leads (leads_id, title, f_name, l_name) VALUES ('', , ,
)

 *Salutation*
 *First Name*
 *Last Name*
-- snip --

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



Re: [PHP] passing form information.

2003-10-02 Thread Chris Sherwood

Dont apologize. even the best of us make mistakes.

the .$field. is a more reliable way of displaying the information contained
within. as in a few cases I find the variable itself gets printed ie $field
shows up as $field in cases where I didnt use the .$field. just an
observation on my part.

if the form name was a typo then you will want to check your
register_globals in your php.ini file it probably is turned off
in which case you want to use
$l_name = $_POST[l_name];
etc..

this will give you the var values with out having to change your php.ini

its also more secure if what I read is correct.

Chris

 I am LD. I do have the  ? echo ? in my code. The leads_id is an
 autonumber, it the primary key for the table. What do the .$field. gives
 you over $field?
 Also another LD mistake, addlead.php is addlead.php.

 I will try it.

 Payne

 Chris Sherwood wrote:

 Hi Payne
 
 for starters your missing an ? at the last echo
 ? echo $l_name
 
 secondly I would rewrite the sql statement to read
 $sql = INSERT INTO $table_name
  (leads_id, title, f_name, l_name)
  VALUES
  (' .$leads_id. ', ' .$title. ', ' .$f_name. ', '
.$l_name.
 ');;
 
 
 but the statement itself shouldnt cause a problem either way.
 
 I am wondering where leads_id comes from however.. is it an auto number?
 
 
 and finally your processing form is called addlead.php
 and the form is posting to a form called addleads.php
 
 hope this helps
 
 chris

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



Re: [PHP] Read a PDF File using php

2003-10-01 Thread Chris Sherwood
http://ca.php.net/manual/en/ref.pdf.php

check this out you should find what you need
-- snip --
From: Pushpinder Singh Garcha [EMAIL PROTECTED]

I need to allow a user to access a PDF file, only if he/she is logged 
in as a registered user. So here is the code that I am trying to use. I 
have been able to make this work in the past, when I had to read .html 
file, now since the file in question is a .pdf file, I am having 
trouble. The browser shows a long list of weird characters instead of 
the pdf file

-- snip--

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



Re: [PHP] printf....

2003-10-01 Thread Chris Sherwood
well for starters dan I would pass the first element as a string variable
that way I could echo the string and see what it actually says ie

$stringtopass = htmlbody center;

$stringtopass .= form action=\%s\ method=post name=\frmSearch\input
type=hidden name=search value=yes;

$stringtopass .= table width=300 border=1 bordercolor=black cellpadding=2
cellspacing=0 tr style=\font-size: 8pt; font-family: verdana; color:
white;\ bgcolor=#003366;

$stringtopass .= th valign=top align=left colspan=2 width=300Search/th
/tr;

$stringtopass .= tr style=\font-size: 8pt; font-family: verdana; color:
white;\ th valign=top align=right width=275 bgcolor=#336699by
Borrower/th;

$stringtopass .= td valign=top align=left width=25 bgcolor=#CCinput
type=checkbox name=borrower value=1/td;

$stringtopass .= /tr tr style=\font-size: 8pt; font-family: verdana;
color: white;\ th valign=top align=right width=275 bgcolor=#336699by
Loan Number/th;

$stringtopass .= td valign=top align=left width=25 bgcolor=#CCinput
type=checkbox name=loan_number value=1 checked/td;

$stringtopass .= /tr tr style=\font-size: 8pt; font-family: verdana;\
th valign=top align=right width=300 bgcolor=#CC colspan=2input
type=text name=search_info style=\width=100%;\/th;

$stringtopass .= /tr tr style=\font-size: 8pt; font-family: verdana;\
th valign=top align=right width=300 bgcolor=#CC colspan=2input
type=submit value=\SEARCH\/th;

$stringtopass .= /tr /table /form /center ;

what I cant figure out is why your trying to print the serverinfo
($_SERVER['PHP_SELF'])

as the second part is the arguements section ie
printf(hi my name is %s and your name is %s, $myname, $yourname);

maybe you want to use echo if you want it displayed on screen

Chris

-- SNIP --
From: Dan Joseph [EMAIL PROTECTED]

 Hi Folks..

 printf (
 html
 body

 center

 form action=\%s\ method=post name=\frmSearch\
 input type=hidden name=search value=yes

 table width=300 border=1 bordercolor=black cellpadding=2 cellspacing=0
 tr style=\font-size: 8pt; font-family: verdana; color: white;\
 bgcolor=#003366
 th valign=top align=left colspan=2 width=300Search/th
 /tr
 tr style=\font-size: 8pt; font-family: verdana; color: white;\
 th valign=top align=right width=275 bgcolor=#336699by Borrower/th
 td valign=top align=left width=25 bgcolor=#CCinput
 type=checkbox name=borrower value=1/td
 /tr
 tr style=\font-size: 8pt; font-family: verdana; color: white;\
 th valign=top align=right width=275 bgcolor=#336699by Loan
 Number/th
 td valign=top align=left width=25 bgcolor=#CCinput
 type=checkbox name=loan_number value=1 checked/td
 /tr
 tr style=\font-size: 8pt; font-family: verdana;\
 th valign=top align=right width=300 bgcolor=#CC colspan=2input
 type=text name=search_info style=\width=100%;\/th
 /tr
 tr style=\font-size: 8pt; font-family: verdana;\
 th valign=top align=right width=300 bgcolor=#CC colspan=2input
 type=submit value=\SEARCH\/th
 /tr
 /table
 /form

 /center
 , $_SERVER['PHP_SELF']
 );

 I have that code, and I get this error:

 Warning: printf(): too few arguments in
/home/sites/site8/web/index_test.php
 on line 34

 I cannot for the life of me figure out what the problem is.  I've looked
 thru archives, examples, and pages of a book all about printf, and this
just
 doesn't add up to me..  Anyone see the problem?
-- snip --

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



Re: [PHP] add element to an array

2003-09-29 Thread Chris Sherwood

-- snip --
 Hi, I want to add a new element to an array in php, is the following way
the
 correct way? assuming that $chk is an array and $ID contains a value.


 $j = count($chk);
 $j++;
 $chk[$j] = $ID;
-- snip --

Yes that is one method of doing it. another method of adding an element to
an array is by using array_push

syntax is

array_push($array,$vartoadd);

there is also a keyed method but I am not 100% familiar with it and still
getting the hang of it.

Chris

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



[PHP] RE: Add element

2003-09-29 Thread Chris Sherwood
Warning ! Don't add one to your key ($j++) in this case. The count()
method count ( :) ) return the number of existing keys in the $chk
array. You'll make hole in your array if you do this :

$arr[0] = toto;

count($arr) = 1;

$arr[1] = tata;

count($arr) = 2;

$arr[count[$arr]++] = titi; = $arr(0=toto, 1=tata, 3=titi) (no
2=)

Prefer array_push($arr, ...)

Cordialement,
Jean-Philippe BENARD
Consultant STERIA Infogérance
([EMAIL PROTECTED])


Thanks for catching that Jean

:| damn I hate monday mornings

Re: [PHP] Am stuck

2003-09-25 Thread Chris Sherwood
Why dont you trim the string first to ensure that there are no empty spaces
at the end and beginning of it
http://ca3.php.net/manual/en/function.trim.php

and then do your count.


Chris
-- SNIP --
Good day all

I have a txt file that has values from various strings written to it.

What Im looking for is the following

$name = Chris';

I need to do a count on $name so that it returns 5 letters. Then before
writing it to the output file I
know that it has to be 40 charecters long before it gets written.

So I know its 5 now I need automatically add another 35 empty spaces to it
to make it 40 so that it makes the
$name like this

$name = Chris;    if I do a
count on this it should be 40 charecters long


Can anyone help out here???

Chris
-- SNIP --

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



Re: [PHP] Understanding code.. again

2003-09-25 Thread Chris Sherwood
Yes the null is ignored when a var is passed

-- SNIP--
Ok, so if an argument is supplied to the function, the = null is
ignored?

Jeff
-- snip -- 

chris

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



[PHP] Attention: List Administrator

2003-09-19 Thread Chris Sherwood
To Whom it may concern the following users

[EMAIL PROTECTED] 
[EMAIL PROTECTED] 

has been flooding me with viruses. fortunately I have the appropriate safeguards in 
place.

however this does not seem like appropriate activity for users and members of this 
list to attempt on anyone let alone the fellow members of this list as it displays a 
very low maturity level. I would appreciate any appropriate measures taken to stop 
this activity.

[PHP] Murugesan

2003-09-18 Thread Chris Sherwood
Hey Muru your sending viruses disguised as a ms security update

either its accidental which you want to look for the Win32/NewMalware.gen

cause thats what is being sent

or its not which then you kinda want to be a little more inconspicious about it

Re: [PHP] Re: [PHP-DB] Graphs

2003-09-16 Thread Chris Sherwood
I found phpchartdirector to be a nice third party app

http://www.hotscripts.com/Detailed/12237.html


- Original Message - 
From: [EMAIL PROTECTED]
To: Balaji H. Kasal [EMAIL PROTECTED]; [EMAIL PROTECTED]; PHP
List [EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 10:12 AM
Subject: [PHP] Re: [PHP-DB] Graphs


 Hi


 I have been using the utilities from this website with very good results

 http://www.aditus.nu/jpgraph/

 Jack
 
  from: Balaji H. Kasal [EMAIL PROTECTED]
  date: 2003/09/16 Tue PM 06:48:48 CEST
  to: [EMAIL PROTECTED],  PHP List [EMAIL PROTECTED]
  subject: [PHP-DB] Graphs
 
 
  Hi,
 
I have data (in numeric format) stored in MySql. This data I am
  collecting hourly. Now I want to generate the graphs using this data and
  to display them in the browser. Which r the tools/utilities are
available
  to do the same?
 
I am using PHP4.2.2, Apache server and MySQL.
 
  Thanks in advance.
 
  -- 
  Regards,
  --Balaji
 
  -- 
  PHP Database 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] PHP|Con insane pricing

2003-09-15 Thread Chris Sherwood

Yea its not bad if you dont have a life outside of programming and/or
computers

if you have kids or other responsibilities then all of a sudden 500$ becomes
a very large issue as thats a months groceries or what not...

heh yea the average salary is 50K but then when the government takes 40% (if
your canadian) that is not a whole lot


  The pricing seems insane, and geared towards people with lots of
  spare money...
 ::snip::
  but I'm not going to shell out $495 (the cheapest non-student

 If you consider the average salary for a computer programmer is probably
 $40k - $50k (at least in the US) this is not insane.  (Heck, it's less
 then a weeks pay -- even with the plane tickets).  I assume this covers
 hotel rooms (pricey), food (pricey), speakers (very pricey), etc.

 -Dan

 -- 
 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|Con insane pricing

2003-09-15 Thread Chris Sherwood
  Yea its not bad if you dont have a life outside of programming and/or
  computers
 Well most professionals who would go to this conference -- IMHO -- would
 be doing it because it would be worth while.  For instance, I considered
 going because if it reduced the time it takes for me to develop software
 by just 1% it would more then pay itself off.

lol that I agree with

  if you have kids or other responsibilities then all of a sudden 500$
becomes
  a very large issue as thats a months groceries or what not...
 Well there are a number of things to consider.  It is a lot about what
 you value and how you manage your money.  (Pick up a copy of one of the
 Rich Dad's series in your local library / bookstore to see what I mean).

ah like with 4 kids I have nothing better to do than run down and grab a
book and evaluate my parenting skills.

never mind keeping up with the current advances in techniques and technology

  heh yea the average salary is 50K but then when the government takes 40%
(if
  your canadian) that is not a whole lot
 (5 - (.40 * 5) == 3)

umm I take it you dont have kids and only pay part of the rent or what not?

lets see rent is 1200/mo
1200 * 12 = 14400
and umm socialist system.. umm where you been hiding?
at least I dont live in a police state.
 That's a heckuva lot of money.  Especially when you consider you
 canadians have a cradle to grave socialist system that covers major
 expenses for us from the US like healthcare.  Of course, I don't know
 your particular situation.  What would be reasonable to you?

 -Dan



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



Re: [PHP] php editor

2003-09-11 Thread Chris Sherwood
Thanks for starting my day out with a chuckle.. this is one of the better
tongue in cheek items I have seen in a little bit

Chris

 I think the BEST php editor out there is Microsoft's Visual Studio.
 Here's some of the reasons I think Visual Studio is the BEST
 1.  None of that annoying syntax highlighting that you find in many other
 editors
 2.  Unlimited technical support (at only $245 per call)
 3.  At $1000 - $2500 per copy it's has substantially more features than
 other cheaper editors.
 4.  It uses far more memory, so it remembers more stuff.
 5.  I can seamlessly integrate .NET into my PHP code
 6.  I don't have to waste my time with integrated debuggers
 7.  It automatically generates obfuscated code
 8.  I don't have to worry about those annoying GPL or LGPL licenses
 9.  Runs great on SuSE
 10. When it crashes I know I need to take my ergonomic break
 11. When loading large projects I have plenty of time to make myself a cup
 of tea, or if I'm out of tea, to drive to the store to buy some tea,
return,
 brew a cup, read slashdot, take a shower
 12. The outstanding support of PHP at Microsoft.

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



Re: [PHP] Problem with HTML Text box and PHP variable.

2003-09-11 Thread Chris Sherwood
try closing the value sections with single quotes that way the html
processiing can see the value
it was
echo tdinput type=text name=value.$j.$i. size=20
value=.$myString./td;


now is
echo tdinput type=text name=value'.$j.$i.' size=20
value='.$myString.'/td;

- Original Message - 
From: Golawala, Moiz M (IndSys, GE Interlogix) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 10:05 AM
Subject: [PHP] Problem with HTML Text box and PHP variable.


I am having a problem with rendering PHP variables in an HTML text box. If
the value of  $myString is Hello the line below will render it correctly
echo tdinput type=text name=value.$j.$i. size=20
value=.$myString./td;

However if the value of $myString is Hello 1 then the line above will
populate the text box with only Hello and it will loose the 1

If I change the problem line to the following:

echo td.$myString./td;

I don't have a problem. Hello 1 will be rendered correctly. But then I
don't have a text box to edit the value. Please help.

Thanks
Moiz

-- 
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] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Chris Sherwood
check this out dan

It may help

http://www.mysql.com/doc/en/EXPLAIN.html


- Original Message - 
From: Dan Anderson [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Friday, September 05, 2003 8:38 AM
Subject: [PHP] mySQL overhead: Tweaking Scripts for Speed


 I'm trying to figure out ways to tweak my scripts for performance.
 
 I've figured out that all mySQL queries should use indexed ids for
 speed.  (For anyone who doesn't know: mySQL indexes fields with PRIMARY
 KEY, UNIQUE, or AUTO_INCREMENT in them.  This means they're stored in
 binary trees internally, so access time is negligible for an INT PRIMARY
 KEY AUTO_INCREMENT).
 
 But how much overhead is there in:
 
 $link = mysql_connect($hostname,$username,$password) or die();
 $db = mysql_select_db($database,$link) or die();
 
 Would it be beneficial to run a single one at the beginning of every
 script?  Currently I have a bunch of functions each with their own
 calls.
 
 Best Regards,
 
 Dan 
 
 -- 
 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] using fwrite to create PHP files

2003-09-05 Thread Chris Sherwood
this is a sample of what I do when I need to write a php file

$stringtowrite = ?PHP\n// Bulletin Board
forum\n$.ForumId=.$tabletofind.;\n;

$stringtowrite .=
$.ForumActive='1';\n$.ForumName='.$sportname.';\n;

$stringtowrite .= $.ForumDescription='.$sportname. forum';\n;

$stringtowrite .= $.ForumConfigSuffix='';\n;

$stringtowrite .= $.ForumFolder='0';\n;

$stringtowrite .= $.ForumParent='0';\n;

$stringtowrite .= $.ForumLang='lang/english.php';\n;

--- and so on until finally

$fd=fopen($final_destination,w) or die (file won't open);
/*if ($fd===false)
{
echo file create failed;
exit();
//return;
} */
fwrite($fd,$stringtowrite);
fclose($fd);


-- snip --
 Vince LaMonica wrote:

  I wish to use fwrite() to create a small PHP file. So far, when I
attempt
  to do this, php parses the contents of the file that fwrite needs to
  create. Eg, I have this:
 
  $new_id = mysql_insert_id();
  // create brand new file
  $new_file = fopen(/var/www/html/$sitename/$submitted_url, w);
  $new_file_content = \n
  . ?php \n
  . if ($_GET['preview'] == \y\) { \n

 You need to escape the dollar signs in your string.

 . if (\$_GET['preview'] == \y\) { \n

 -- 
 ---John Holmes...
-- snip --

Chris Sherwood

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



[PHP] RE:[PHP] HTML Template, PHP, Javascript PATH_INFO

2003-09-04 Thread Chris Sherwood
-- snip --
I can do
- site.com/info/template.html and get two alerts
- site.com/info/content1.html and see a new text under H1
- site.com/info/slick.php/content1.html and get neither alert nor new text.
  - instead I get 4 browser (IE) 'problem alerts', I presume
  - 1. for not finding js1.js
  - 2. for not finding js2.js
  - 3. for not finding content1.js
  - 4. for not finding helloFromContent1() function

I don't want to change my SRC references to be site absolute, I want them
relative.

Any ideas how I should 'wrap' my content using php and get functioning pages
?
-- snip --


have you thoought about doing an echo on your script tags and do a getenv?
that way you can simulate a relative path

ie
it was


SCRIPT SRC=js1.js LANGUAGE=JavaScript/SCRIPT
  SCRIPT SRC=js2.js LANGUAGE=JavaScript/SCRIPT


now

?
echo SCRIPT SRC='(getenv(document_root)./js1.js)' 
LANGUAGE='JavaScript'/SCRIPT;
echo SCRIPT SRC='(getenv(document_root)./js2.js)'  
LANGUAGE='JavaScript'/SCRIPT;
?


hope this takes care of some of your issues.

Chris

[PHP] RE:[PHP] Can Objects be passed to another page?

2003-09-03 Thread Chris Sherwood
Webmaster.


Yes they can, but you must pass the reference to the object and not simply the value 
per se.

ie 

$newObject = New phpWeb.Class.Sql();

$returnvalue = PerformUserValidation($newObject);


Re: [PHP] Q on Class and EXTEND

2003-09-03 Thread Chris Sherwood

-- snip --
  I dont know much about classes, but dont you want
 
  $a = new THECHILD('walter'); //so you can access $a-abc
 
  instead of
 
  $a = new THEPARENT ('walter');

 No, I'm wanting to EXTEND the orginal class.

 meaning, my THECHILD class efines new methods/properties, and I want it
used
 as if it was part of the orginal THEPARENT Class.

 Me just being picky.

 Walter
-- snip --

walter you want to do a declaration in the class that you want to use the
base class in ie


when you declare your child class

class Web_child extends WEB_parent
{
-- your new and extended code here
}

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



Re: [PHP] if else while statement speed

2003-09-03 Thread Chris Sherwood
have you thought about usiing a switch statement that way all the if or else
if statements are not checked against?

ie
?php
while (something())
{
switch($option)
{
case $option1:
break;

case $option2:
break;

case $... etc
break;
}// end of
}


   if ($option1)
   { do_1(); }
   elseif ($option2)
   { do_2(); }
   // ... continue for 10 or more options...
 }
 ?

- Original Message - 
From: Dan Anderson [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Wednesday, September 03, 2003 10:25 AM
Subject: [PHP] if else while statement speed


 I have a function where I have:

 ?php
 while (something())
 {
   if ($option1)
   { do_1(); }
   elseif ($option2)
   { do_2(); }
   // ... continue for 10 or more options...
 }
 ?

 would it be quicker to do the above code or:

 if ($option1)
 {
   while(something())
   { do_1(); }
 }
 elseif ($option2)
 {
   while (something())
   { do_2(); }
 }
   // ... continue for 10 or more options...

 Thanks,

 Dan

 -- 
 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] Open-source browser-based POS system?

2003-09-02 Thread Chris Sherwood
a quick search on google revealed a few things

http://www.google.ca/search?q=browser+based+POSie=UTF-8oe=UTF-8hl=enmeta=

try that and see if any of those meet your requirements

Chris
- Original Message - 
From: John Almberg [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 02, 2003 9:01 AM
Subject: [PHP] Open-source browser-based POS system?


 Anyone know of an open source, browser-based Point of Sale system?

 -- John

 -- 
 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] New User Script Failing Unexpectedly.

2003-09-01 Thread Chris Sherwood
If this is causing all forms to need to be submitted twice, I would be
suspect of the include files that were found in all the forms documents and
start my debugging process from there.

just cursory glance tells me I would like to see the include files. before I
could say that it was one thing or another.

also you dont have a break on your process case statement so it will carry
out the default and include the apply.inc file again.

only other thing is not having a ; at the end of your error suppressed echos
dont cause a problem?

Chris Sherwood

--- SNIP ---

Okay, this is a tricky one (i think so, anyway!), and rather long but
plase help me!  I don't expect you to spend hours looking at the
problem, but any insight is appreciated.

I am (trying) to create a members only website.  However, I am having a spot
of bother.  It all works perfectly... The second time you fill in any form.

first, the user goes to newuser_process.php (Sample A) (the same thing
happens if the user goes to apply.php, I might add).

Then, the user fills in the form, and submits it to newuser_process.php

the program then checks for blank fields, which it finds none.  it then goes
on to check individual fields, and here it hangs.

it executes the if block (even though the condition is not true), and
re-shows the form, with the error message, but with nothing in the fields.

If you fill in the form again, it works.

help!!!

So far, I have re-arranged the validation order, to see if that makes a
difference, but it always fails on the first if loop.

I have also tried to manually recreate the variables on sample 'B'
(apply.php) (shown in green, if you have html formatting enabled.

Other than that, I am totally clueless.

You can reach me at any of the adresses at the end of the e mail, for any
solutions, queries about my aims/ideals in this script, or anything else.

P.s.  The .inc files and .js files are totally unrelated to the newuser
script.

-- SNIP --

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



Re: [PHP] open php from

2003-08-29 Thread Chris Sherwood
header('Location: ' . $newLocation);
- Original Message - 
From: Alvaro Martinez [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 29, 2003 9:13 AM
Subject: [PHP] open php from


 Hi!
 I'm a beginner. I want to redirect from one php page to another php page
and
 I dont know what method to use.
 How can I do it?
 Thanks

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



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



Re: [PHP] Form Parameters

2003-08-29 Thread Chris Sherwood
depends on whether or not you post or get
 then you use 
$_POST[varname]
or
$_GET[varname]

hope this helps


- Original Message - 
From: Seth Willits [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 29, 2003 11:00 AM
Subject: [PHP] Form Parameters


 This might be staring straight at me, but I can't seem to figure out  
 how to reference form parameters in php code. For example:
 
 
 ?php
 if ($formName[fieldName] == this) {
 // do this
 } else {
 // do that
 }
 ?
 
 
 Thanks,
 
 
 Seth Willits
  
 ---
 President and Head Developer of Freak Software - http://www.freaksw.com
 QA Columnist for REALbasic Developer Magazine -  
 http://www.rbdeveloper.com
 Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
 
 There are 10 types of people in this world - those that understand  
 binary
 and those that don't.
  
 ---
 
 -- 
 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] Approaches to Logging In

2003-08-29 Thread Chris Sherwood
Honestly if you have the users logging in use a session variable to contain
a session id

then verify against that sessionid as they browse the sensitive sections and
use a class to verify that they are a valid user

so yes Ideally sessions are the way to go

Chris
- Original Message - 
From: Seth Willits [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 29, 2003 3:24 PM
Subject: [PHP] Approaches to Logging In


 I'm currently working on a portion of a website for my high school's
 band (though I'm now in college) and one of the sections contains
 contact information for all of the students which should only be
 accessible if you have are a member of band staff and have a password.

 In order to access the band staff section, you are required to enter
 in a username and password and from there you can visit any of the
 pages in the band staff section. So it's fairly straight forward, login
 view the pages, type of system.

 My question is, how should I go about determining whether the user has
 logged in or not? Are sessions overkill or difficult to use? Or is
 there another easier solution? This doesn't have to be maximum security
 or handle a variety of approaches to the pages, I'm just looking for a
 simple, unless you're logged in, you can't see this page.

 Are sessions the way to go?



 Seth Willits
  
 ---
 President and Head Developer of Freak Software - http://www.freaksw.com
 QA Columnist for REALbasic Developer Magazine -
 http://www.rbdeveloper.com
 Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

 One day you'll be wandering through the darkness looking for guidance,
   inspiration, and your purpose in life, and the next you'll turn around
   and realize they've been standing right next to you the whole time.
  -- Seth Willits
  
 ---

 -- 
 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] IS THIS A BUG?

2003-08-28 Thread Chris Sherwood
No its not a bug

basically what you did was assign a value to a value of a variable

a $$ is how you access the value of a variable as a variable


- Original Message - 
From: Steve Todd [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 1:27 PM
Subject: [PHP] IS THIS A BUG?


 Is it possible to define a variable, such as:
 $foo = bar;
  
 and then do as follows to create a totally different variable:
 $$foo =  text here;
  
 this seems to mean $bar = text here;.
  
 Is this a bug or can we legally use it.
  
 Steve
 

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



Re: [PHP] back button and forms

2003-08-20 Thread Chris Sherwood
session.cache_expire

is what your looking for I believe

http://www.php.net/manual/en/ref.session.php


- Original Message - 
From: Tim Winters [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 9:26 AM
Subject: [PHP] back button and forms


 Hello,
  
 I have a series of forms set over a few pages.  The entries are stored
 in session vars and the whole shebang is written to mySQL via PHP at the
 end of the series of forms.  When the user hits the back button an error
 message comes up with the following
  
 Warning: Page has Expired 
 The page you requested was created using information you submitted in a
 form. This page is no longer available. As a security precaution,
 Internet Explorer does not automatically resubmit your information for
 you. 
 
 To resubmit your information and view this Web page, click the Refresh
 button. 
  
  
 Is there any way to avoid this from happening?
  
 Thx
  
 Tim Winters
 Creative Development Manager
 Sampling Technologies Incorporated
  
 1600 Bedford Highway, Suite 212
 Bedford, Nova Scotia
 B4A 1E8
 www.samplingtechnologies.com
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 Office: 902 450 5500
 Cell: 902 430 8498
 Fax:: 902 484 7115
  
 

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



Re: [PHP] back button and forms

2003-08-20 Thread Chris Sherwood
sorry its actually

http://www.php.net/manual/en/function.session-cache-limiter.php


- Original Message - 
From: Tim Winters [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 9:26 AM
Subject: [PHP] back button and forms


 Hello,
  
 I have a series of forms set over a few pages.  The entries are stored
 in session vars and the whole shebang is written to mySQL via PHP at the
 end of the series of forms.  When the user hits the back button an error
 message comes up with the following
  
 Warning: Page has Expired 
 The page you requested was created using information you submitted in a
 form. This page is no longer available. As a security precaution,
 Internet Explorer does not automatically resubmit your information for
 you. 
 
 To resubmit your information and view this Web page, click the Refresh
 button. 
  
  
 Is there any way to avoid this from happening?
  
 Thx
  
 Tim Winters
 Creative Development Manager
 Sampling Technologies Incorporated
  
 1600 Bedford Highway, Suite 212
 Bedford, Nova Scotia
 B4A 1E8
 www.samplingtechnologies.com
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 Office: 902 450 5500
 Cell: 902 430 8498
 Fax:: 902 484 7115
  
 

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



Re: [PHP] bug in code - can't find it!

2003-08-14 Thread Chris Sherwood
INPUT TYPE=checkbox NAME=? echo $search_result2['user_cd'];?
VALUE=?if ($search_result2[a.retired_flag] == 1){?CHECKED?}? ?echo
$search_result2[a.retired_flag]?
}

well for starters checkboxes dont have a size and maxlength
 you may want to try that and see if it works...



- Original Message -
From: Amanda McComb [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 06, 2003 2:47 PM
Subject: [PHP] bug in code - can't find it!


 Ok, after all of the discussion on posting, I'm afraid to post.
 Unfortunately, no one I know is a programmer, and I am a beginner.  I can
 normally figure out what I've done wrong, but I'm missing something here.

 Ok, here is my query and the bit of code I can't figure out:

 $query = SELECT * from apt_user_t a, apt_company_t b ;
 $query .= WHERE a.user_cd = b.user_cd ;
 $query .= ORDER BY a.username;

  $search_results = mysql_query($query) or die(Select
 Failed!);
 while ($search_result2 = mysql_fetch_array($search_results))
 {
 INPUT
 TYPE=checkbox
 NAME=? echo $search_result2['user_cd'];?
 SIZE=20
 MAXLENGTH=50
 VALUE=?if ($search_result2[a.retired_flag] == 1){?CHECKED?}? ?echo
$search_result2[a.retired_flag]?
 }
 Nothing shows up with the echo or the value.  I only included this
 checkbox, but all of the other values show up fine.  Can someone give me a
 hint?




 --
 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] Stop neurotic posting

2003-08-14 Thread Chris Sherwood
Hitler is it?

why is it everytime someone mentions a proper ettiquette, or some common
sense thing that it is immeadiately taken to an extreme..

is this reasonable behaviour? does it portray us as adults, maybe adults who
have a major chip on our shoulders... all I am saying is if you feel nasty
... keep it to yourself

now how does that equate to being like or bringing back hitler?


- Original Message -
From: Robert Cummings [EMAIL PROTECTED]
To: Chris Sherwood [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, August 06, 2003 2:04 PM
Subject: Re: [PHP] Stop neurotic posting


 On Wed, 2003-08-06 at 16:36, Chris Sherwood wrote:
 
  or what does it take to actually give a reasonable answer... if I am
gonna
  be rude I  wont say anything... doesnt any one remember their mother
telling
  them if you dont have anything nice to say dont say anything at all?
 

 That kind of thinking leads to things like Hitler :| If we never say
 anything then it becomes the norm for people to continue their
 behaviour. Currently the question being debated is what constitutes poor
 behaviour/etiquette within this mailing list. While I agree that this
 forum is primarily for answering questions -- I disagree that it is for
 answering silly little questions that would be common knowledge if the
 asker had bothered to read any tutorials or documentation -- most
 especially when it appears that the poster didn't even bother to do any
 kind of searching for themselves. I mean really, questions like does X
 do Y is often as simple as writing 1 to 5 lines of test code which is
 probably shorter than the email itself and doesn't pollute the mailing
 list with 5 to 10 replies of yes or no.

 Cheers,
 Rob.
 --
 .-.
 | Worlds of Carnage - http://www.wocmud.org   |
 :-:
 | Come visit a world of myth and legend where |
 | fantastical creatures come to life and the  |
 | stuff of nightmares grasp for your soul.|
 `-'

 --
 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] bug in code - can't find it!

2003-08-08 Thread Chris Sherwood
silly me

upon further looking

INPUT TYPE=checkbox NAME=? echo $search_result2['user_cd'];?
VALUE=? echo $search_result2[a.retired_flag];?
?if ($search_result2[a.retired_flag] == 1) echo  CHECKED; ?
?echo $search_result2[a.retired_flag]?

- Original Message -
From: Amanda McComb [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 06, 2003 2:47 PM
Subject: [PHP] bug in code - can't find it!


 Ok, after all of the discussion on posting, I'm afraid to post.
 Unfortunately, no one I know is a programmer, and I am a beginner.  I can
 normally figure out what I've done wrong, but I'm missing something here.

 Ok, here is my query and the bit of code I can't figure out:

 $query = SELECT * from apt_user_t a, apt_company_t b ;
 $query .= WHERE a.user_cd = b.user_cd ;
 $query .= ORDER BY a.username;

  $search_results = mysql_query($query) or die(Select
 Failed!);
 while ($search_result2 = mysql_fetch_array($search_results))
 {
 INPUT
 TYPE=checkbox
 NAME=? echo $search_result2['user_cd'];?
 SIZE=20
 MAXLENGTH=50
 VALUE=?if ($search_result2[a.retired_flag] == 1){?CHECKED?}? ?echo
$search_result2[a.retired_flag]?
 }
 Nothing shows up with the echo or the value.  I only included this
 checkbox, but all of the other values show up fine.  Can someone give me a
 hint?




 --
 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] Stop neurotic posting

2003-08-06 Thread Chris Sherwood
well I have been watching this post all morning and now into the afternoon..

personally I think there is differences in responses and well there are
definite persons with an elitist attitude, some of these people are
newbies... under immense amounts of pressure to pull something off... what
does it cost to type strpos()?

or what does it take to actually give a reasonable answer... if I am gonna
be rude I  wont say anything... doesnt any one remember their mother telling
them if you dont have anything nice to say dont say anything at all?

anyways lets let this topic drop and get back to what we all do best and
thats coding..


Chris


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



Re: Re: [PHP] Possible My Website was hacked... with PHP... please tell me what this is???

2003-07-31 Thread Chris Sherwood
I have seen this exact same header before in this list, so I am going to
assume this is a troll

Chris
- Original Message -
From: binc2 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 8:26 AM
Subject: Re: Re: [PHP] Possible My Website was hacked... with PHP... please
tell me what this is???


Hi guys

what does trolling mean? Never heard of it before.

Angelo

-Original Message-
From: Joel Rees [EMAIL PROTECTED]
To: Joe Harman [EMAIL PROTECTED], [EMAIL PROTECTED]
Date: Thu, 31 Jul 2003 16:10:24 +0900
Subject: Re: [PHP] Possible My Website was hacked... with PHP... please tell
me what this is???

Assuming you are not just trolling,

 Fortunatly I don't think they were doing something correctly, cause it
 didn't deface my site like some of the others

Don't count on it. They only deface servers they don't want to use.

 ...
 everyone can execute shell commands via system(); on your server.
 - delete the script ;)

Oh, by all means, delete it if you want. But it's not the hole it came
in through, and it's not the real backdoor.

It's so blatent, I'd guess it's a script kiddy or a decoy. Even if it's
a script kiddy, you _want_ to know how it got on the box.

I'd take the box offline, back up all the data and configuration files,
and re-install the whole system and all programs from scratch. Go over
every configuration file with a fine-tooth comb.

If the machine is on a subnet and I controlled the subnet, I think I'd
take the whole subnet down, including the firewall, and clean every
machine up, not putting any machine back on the subnet until it was
clean and any holes patched. If I didn't control the subnet, I'd make
sure the persons who did know there had been a break-in.

And if you have any valuable data, consider it to have been stolen. If
you have credit card numbers, report the possibility of theft to the
credit card companies. Etc.

If you're trolling, go away.

--
Joel Rees, programmer, Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


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





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




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



Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Chris Sherwood
After reading your problem

this is what I think you should do is dont let the user enter the string
predelimited
have them enter each individual string at which point you can safely search
for the delimiter and replace it with the character of your choice _ is a
favorite of mine.

then rebuild the string and delimit it yourself

Chris
- Original Message -
From: Reuben D. Budiardja [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 18, 2003 11:47 AM
Subject: [PHP] explode and escape character for string separator



Hi all,
Suppose I have a long string like
$myStr = $string1:$string2:$string3;

I can obviously explode them using : as the separator. But what if
$string1 contains the character : by itself?

I was thinking, first I am gonna put an escaping character, so I can do
something like:
$string1 = str_replace(:, \:, $string1);

But that still won't work with explode. So, what can I use instead of
explode?
Anything simple, and fast?

This is a hypothetical situation. The real situation is that I am trying to
have a protocol for data sent by client using Flash. But the basic question
remains.

Thanks for any help.
RDB
--
-
/\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-


--
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 and Mysql Limit

2003-07-02 Thread Chris Sherwood
It looks like your adding 10 to 8 thus getting 18... of course I maybe
looking at this wrong

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 9:23 AM
Subject: [PHP] PHP and Mysql Limit



 I've created a script that reads a sorted mysql query and outputs specific
 results into text files defined by the start and limit of mysql. The
 database holds 178 records. I want to start my output on #9 with 10
 records per page. Should leave me with 17 equal pages right?

 $count = 178
 $start = 8; (Mysql starts at record 0)
 $per_page = 10;
 $page = 1;

 while ($start = $count) {

 $fp = fopen(Page$page.txt, w);

 mysql_connect ($host, $user, $pass);

 mysql_select_db ($database);

 $result = mysql_query (SELECT * FROM internal_listings, agents WHERE
 internal_listings.agent = agents.name AND category = 'Standard' ORDER by
 area,price LIMIT $start, $per_page);

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

 do {

 ##misc ouput to file $fp for 10 records in query

 }

 while($row = mysql_fetch_array($result));

 }

 fclose($fp);

 mysql_close();

 $start = $start + $per_page;

 $page++;

 }


 When I run the script outlined above I get 18 pages. Page number 18 is
 blank as it should be as there should be no more listings to output to a
 text file but why is there a page number 18 to begin with? It should end
 with page number 17.

 Thanks in advance for any insight,

 Ed



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

2003-06-30 Thread Chris Sherwood
you can do it by assigning them to a single string or by adding the second
to the firsst

$youroriginalfirststring .= $thestringyouwanttoadd;
please note the .

Chris
- Original Message -
From: Derick Rethans [EMAIL PROTECTED]
To: Ryan Vennell [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, June 30, 2003 8:32 AM
Subject: Re: [PHP] Concatenate


 On Mon, 30 Jun 2003, Ryan Vennell wrote:

  how can i concatenate two strings?  i cant seem to find the function...
thanks :)

 With .

 Derick

 --
 Interpreting what the GPL actually means is a job best left to those
 that read the future by examining animal entrails.
 -
  Derick Rethans http://derickrethans.nl/
  International PHP Magazine  http://php-mag.net/
 -


 --
 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] mysql split?

2003-06-27 Thread Chris Sherwood
Andrew... I think most likely you will have to pull the information into a
php page and parse it.

you then will be able to get accurate results and I dont know if mysql has
an explode function

it doesnt look like it

http://www.mysql.com/doc/en/Function_Index.html

- Original Message -
From: Andrew McCombe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 27, 2003 9:16 AM
Subject: Re: [PHP] mysql split?


 Does mysql have an explode function?  I suppose this is the wrong place to
 ask...

 Andrew

 - Original Message -
 From: Jay Blanchard [EMAIL PROTECTED]
 To: Andrew McCombe [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Friday, June 27, 2003 5:08 PM
 Subject: RE: [PHP] mysql split?


  use explode()
 
  -Original Message-
  From: Andrew McCombe [mailto:[EMAIL PROTECTED]
  Sent: Friday, June 27, 2003 11:06 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] mysql split?
 
 
  Hi
 
  I have a field in mysql that has paths to files such as:
 
  project/entertainment/andrew/job/1.jpg
  project/corporate/roberts/job/1.jpg
  project/corporate/andrew/job/1.jpg
  project/identity/john/job/1.jpg
 
  The first level is always 'projects'.  What I want to do is get the
  unique
  name for the 3rd level for all entertainment, corporate and identity, so
  from the data above I would get returned:
 
  andrew
  john
  roberts
 
  What's the best way to acheive this? I remember seeing something where
  you
  can split a field in the mysql into parts (ie, split at /)?  or would a
  regex be better ('WHERE REGEX
  ^projects/corporate|entertainment|identity/'
  (this doesnt work))?  Hope someone can help.
 
 
 
 
  Regards
  Andrew McCombe
  Interactive Web Solutions (Stafford)
  Tel: 01785 279921
 
 
 
  
  
  -
  The contents of this e-mail and any attachments are confidential and may
  be legally privileged. If you have received this e-mail and you are not
  a named addressee, please inform us as soon as possible on
  +44 (0) 1785 279920  and then delete the e-mail from your system. If you
  are
  not a named addressee you must not copy, use, disclose, distribute,
  print or rely on this e-mail. Any views expressed in this e-mail or any
  attachments may not necessarily reflect those of Interactive Web
  Solutions'
  management.
  Although we routinely screen for viruses, addressees should scan this
  e-mail and any attachments for viruses. Interactive Web Solutions makes
  no
  representation or
  warranty as to the absence of viruses in this e-mail or any attachments.
  Please note that for the protection of our business, we may monitor and
  read e-mails sent to and from our server(s).
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



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




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



Re: [PHP] PHP-programmers salary

2003-06-27 Thread Chris Sherwood
Alot of it depends on the demand and where you are...

but averages here in Vancouver BC range from 40k a year all the way to 75k a
year

- Original Message -
From: Gladk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 27, 2003 11:20 AM
Subject: [PHP] PHP-programmers salary


 Hi PHPeople!

 Can anybody tell me what is the avarage PHP-programmers salary?

 Thanks


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




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



Re: [PHP] Re: sessions and browser back

2003-06-27 Thread Chris Sherwood
there is a setting you need to make after the session start

http://ca3.php.net/manual/en/function.session-cache-expire.php

check that link out I think that it will resolve alot of problems for you..

however I have noticed forms are a little trickier... usually what I do with
those is create the back link as a hyperlink which allows me to add the info
to the form when returned so it looks like the form hasnt lost its
information.


- Original Message -
From: chris [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 27, 2003 11:22 AM
Subject: [PHP] Re: sessions and browser back


 On Wed, 25 Jun 2003 18:56:13 +0530, Bibhas Kumar Samanta
 [EMAIL PROTECTED] wrote:

  Hi,
 
  I am trying to create restricted pages for my php/mysql/apache
  server with sessions and passing session varibales to other pages for
  validation.
 
  Eventually I am doinng session_start() at the begining and
  checking whether logged in user is authorised to use this page
  by a routine.
 
  Now problem is, if filled in data in the form is incorrect, the forms
  gives an error. But when I press browser BACK button to get the
  filled in form , the form seems to get reset with _no_ data.
 
  When I try without session_start() at the begining  of form , things
  seem to behave normally.
 
  Does session_start() reset the form  and I guess browser should
  have returned be by fiiled in page from cache ?
 
  Please help
 
  -Bibhas
 

 This doesn't happen with every browser.  Opera never forgets the previous
 page's form contents.

 --
 Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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




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



Re: [PHP] Re: quotes

2003-06-26 Thread chris sherwood
 echo input name='company' type='text' value='. htmlentities($company)
.';

this doesnt work cause the engine doesnt like that
try this
 echo input name='company' type='text' value='.( htmlentities($company))
.';

Anthony [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 tough to tell... but it looks like you have the  and ' mixed up before
the
  in the end  :-P

 - Anthony

 Lso . [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  ok i see why i didnt work but i dont know why.
 
  can anyone tell me why this works:
 
 input name=testfield type=text value=? echo
 htmlentities($company)
  ?
 
  but this doesn't:
 
  echo input name='company' type='text' value='. htmlentities($company)
  .';
 
  Lucas Owens
  www.lucasowens.com
  www.technoiraudio.com
 
  _
  Add photos to your e-mail with MSN 8. Get 2 months FREE*.
  http://join.msn.com/?page=features/featuredemail
 



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

2003-06-25 Thread Chris Sherwood
or you would escape the quote by putting a \ in front of it that way the
engine knows to write the quote.

ie input type=\text\

- Original Message -
From: Adam Voigt [EMAIL PROTECTED]
To: Lso . [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 7:47 AM
Subject: Re: [PHP] quotes


 Cause of the quotes around the value, example:

 input type=text value=my nickname is hank or bob

 The HTML parser gets confused by the 's around hank,
 so since the textarea doesn't use quote's to delimit the
 value, it works fine.



 On Wed, 2003-06-25 at 10:37, Lso . wrote:
  Does anyone know why this works this way?  seems kinda odd that a
textarea
  will display it correctly but a normla field will not.
 
  Try a textarea. Example:
 
  Lucas
 
  _
  Tired of spam? Get advanced junk mail protection with MSN 8.
  http://join.msn.com/?page=features/junkmail
 --
 Adam Voigt ([EMAIL PROTECTED])
 Linux/Unix Network Administrator
 The Cryptocomm Group


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

2003-06-25 Thread Chris Sherwood
well thats seems unlikely as I do it all the time..

how ever I am not going to argue p's and q's ...
if it doesnt work for him it doesnt work

- Original Message -
From: Adam Voigt [EMAIL PROTECTED]
To: Chris Sherwood [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 9:04 AM
Subject: Re: [PHP] quotes


 Umm, in his first email, he specifically said all the quotes
 were already escaped with slashes and it didn't help.



 On Wed, 2003-06-25 at 11:50, Chris Sherwood wrote:
  or you would escape the quote by putting a \ in front of it that way the
  engine knows to write the quote.
 
  ie input type=\text\
 
  - Original Message -
  From: Adam Voigt [EMAIL PROTECTED]
  To: Lso . [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Wednesday, June 25, 2003 7:47 AM
  Subject: Re: [PHP] quotes
 
 
   Cause of the quotes around the value, example:
  
   input type=text value=my nickname is hank or bob
  
   The HTML parser gets confused by the 's around hank,
   so since the textarea doesn't use quote's to delimit the
   value, it works fine.
  
  
  
   On Wed, 2003-06-25 at 10:37, Lso . wrote:
Does anyone know why this works this way?  seems kinda odd that a
  textarea
will display it correctly but a normla field will not.
   
Try a textarea. Example:
   
Lucas
   
_
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
   --
   Adam Voigt ([EMAIL PROTECTED])
   Linux/Unix Network Administrator
   The Cryptocomm Group
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 --
 Adam Voigt ([EMAIL PROTECTED])
 Linux/Unix Network Administrator
 The Cryptocomm Group


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

2003-06-25 Thread Chris Sherwood
Steve have you tried to search the entire drive for the php.ini file?


- Original Message -
From: Steve Marquez [EMAIL PROTECTED]
To: PHP eMail List [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 8:59 AM
Subject: [PHP] php.ini


 I am running MacOSX and can not find my php.ini file. Does anyone know
where
 it is located on a mac?

 I looked at my phpinfo file, and it says /usr/lib/ but does not have the
 php.ini file in it.

 Can anyone help?


 Steve Marquez
 Marquez Design
 [EMAIL PROTECTED]

 www.marquez-design.com


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




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



Re: [PHP] quotes

2003-06-25 Thread Chris Sherwood
Jason

I dont know what you were thinking but this is in a php list

when you render html with php and you want double quotes in the html you
MUST escape them

otherwise you dont use double quotes

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 9:58 AM
Subject: Re: [PHP] quotes


 On Thursday 26 June 2003 00:02, Chris Sherwood wrote:
  well thats seems unlikely as I do it all the time..
 
  how ever I am not going to argue p's and q's ...
  if it doesnt work for him it doesnt work
 
  - Original Message -
  From: Adam Voigt [EMAIL PROTECTED]
  To: Chris Sherwood [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Wednesday, June 25, 2003 9:04 AM
  Subject: Re: [PHP] quotes
 
   Umm, in his first email, he specifically said all the quotes
   were already escaped with slashes and it didn't help.
  
   On Wed, 2003-06-25 at 11:50, Chris Sherwood wrote:
or you would escape the quote by putting a \ in front of it that way
the engine knows to write the quote.
   
ie input type=\text\

 HTML doesn't need (indeed, want) slashes in front of quotes.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --

 --
 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] Passing Array to object

2003-06-25 Thread Chris Sherwood
Have you tried to assign the array to a variable then pass the variable to
the function ie

$index = new main();
$yourvar = array('array values');


$index-SetLink ($yourvar);

- Original Message -
From: Daniel J. Rychlik [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 10:46 AM
Subject: [PHP] Passing Array to object


Hello,

I am developing a site that uses classes to reuse code and objects.

I have in my main class a

function SetLinks($newlinks) {

$this-links = $newlinks;

}

And another function that displays them in the same class main {


I have another file called index.php that basically just passes attributes
to the main class and the main class displays them.

Im having a bit of trouble passing an array to the object

in the index.php

I create new.

$index = new main();
$index-SetLink = array ( 'Link1'= 'link1.php',
. );

When I run I recieve Variable passed to each() is not an array or object 

so I tried this

$index-SetLink($newlink = array('link1'= ...);

same error message.  I was wondering if someone could shed some light on
what Im doing wrong.

Thanks
Daniel


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



Re: [PHP] Passing Array to object

2003-06-25 Thread Chris Sherwood
hmmm okay
cause list works by assigning elements in order from an array
each iterates thru each element in a list so you want to pass both elements
at the same time so you need to pass an array to get the effect your looking
for

ie $name being from the first array element, and $url being from the second
array element...

so I am thinking you wish to assign urls and names to a single array you
will want to make it a multidimensional array
ie array (array(name, link),array(name,link))

hope this helps you daniel

- Original Message -
From: Daniel J. Rychlik [EMAIL PROTECTED]
To: Daniel J. Rychlik [EMAIL PROTECTED]; Chris Sherwood
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 11:17 AM
Subject: Re: [PHP] Passing Array to object


 Its erroring at my display links function.  This function is inside my
main
 class.

 function DisplayLinks($links) {

 while(list($name, $url) = each($links) {

 echo :::a href= '$url''$name/a:::\n;

 } //End while

 } // End DisplayLinks function


 I dont see why it wont work...  I even try assigning $links to the array.


 - Original Message -
 From: Daniel J. Rychlik [EMAIL PROTECTED]
 To: Chris Sherwood [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2003 1:08 PM
 Subject: Re: [PHP] Passing Array to object


  yea, I gave that a shot, Same message. Logically it makes sense, but php
  doesnt like it.
 
  by the way, thanks for your help Chris.  You've helped me in the past.
  -Daniel
 
  - Original Message -
  From: Chris Sherwood [EMAIL PROTECTED]
  To: Daniel J. Rychlik [EMAIL PROTECTED];
  [EMAIL PROTECTED]
  Sent: Wednesday, June 25, 2003 1:02 PM
  Subject: Re: [PHP] Passing Array to object
 
 
   Have you tried to assign the array to a variable then pass the
variable
 to
   the function ie
  
   $index = new main();
   $yourvar = array('array values');
  
  
   $index-SetLink ($yourvar);
  
   - Original Message -
   From: Daniel J. Rychlik [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Wednesday, June 25, 2003 10:46 AM
   Subject: [PHP] Passing Array to object
  
  
   Hello,
  
   I am developing a site that uses classes to reuse code and objects.
  
   I have in my main class a
  
   function SetLinks($newlinks) {
  
   $this-links = $newlinks;
  
   }
  
   And another function that displays them in the same class main {
  
  
   I have another file called index.php that basically just passes
 attributes
   to the main class and the main class displays them.
  
   Im having a bit of trouble passing an array to the object
  
   in the index.php
  
   I create new.
  
   $index = new main();
   $index-SetLink = array ( 'Link1'= 'link1.php',
   . );
  
   When I run I recieve Variable passed to each() is not an array or
 object
  
  
   so I tried this
  
   $index-SetLink($newlink = array('link1'= ...);
  
   same error message.  I was wondering if someone could shed some light
on
   what Im doing wrong.
  
   Thanks
   Daniel
  
 
 
  --
  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] image galleries

2003-06-25 Thread chris sherwood
I haven't found anything that would handle the problem you have... in my
case I would create the galleries that I needed... maybe write some
reiterate code that would display recreated thumbs from the images...


this could be done when the upload is done and the new image created from
the old one using create from functionality available in the php engine such
as
http://ca3.php.net/manual/en/function.imagecreatefromjpeg.php

or one of the others you find there good luck



Alan Quirk [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 I've had a look around lots of script sites (hotscripts, etc) and there
are
 lots of scripts for gd-library galleries, but unfortunately the server i'm
 using does not support it, and I really want to have a gallery where
 pictures can be uploaded and all the appropriate directories are created
 automatically (i'm not that good with code just yet) but instead of
listing
 pages of thumbnails it just automatically lists the pics in the gallery as
 text links.

 I hope you can be of some help, I can't find anything anywhere on the
whole
 internet like this.



 --
 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] Using variables from includes

2003-06-25 Thread chris sherwood
use globals to pass the information to other pages..

http://www.php.net/manual/en/language.variables.php

Ben [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 Ok, I'm sort of a beginner at this, so cut me some slack. :-)  Ok, I have
an
 if then statement that after you click a link it looks like this:
 blah?page=pagename It looks something like this:
 ?php
 if(!$page) {
 include (http://www.site.com/home.php;);
 }
 else{
 include (http://www.site.com/; . $page . .php);
 }
 ?
 This code is in the index.php file.  When home.php is included, I want to
 echo a variable like $title on the index.php page.  But $title is defined
on
 home.php.  For some reason, I can't get $title to echo on index.php after
 it's included.  Anyone know??



 --
 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] Berkeley db

2003-06-25 Thread chris sherwood
http://www.sleepycat.com/products/documentation.shtml

try that it is the online documentation for the Berkeley db

Logan McKinley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 I have absolutely no experience with Berkeley db but have been told by my
 ISP that it is what I need to use.  How do I connect to it? Do I use SQL
to
 set up the structure? does it accept standard SQL? If anyone knows of a
good
 resource that would be wonderful as well.
 Thanks in advance,
 ~Logan



 --
 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] Passing Array to object

2003-06-25 Thread Chris Sherwood
function DisplayLinks($links,$names)
 {
$namecount = sizeof($names);
for($a=0;$a$namecount;$a++)
{
$name = $names[$a];
$url = $links[$a];
echo :::a href= '$url''$name/a:::\n;

} //End for
} // End DisplayLinks function

try this and assigning the names you want to be displayed to the names array
and links to the links array...

I know this isnt pretty but it should work
- Original Message -
From: Daniel J. Rychlik [EMAIL PROTECTED]
To: Chris Sherwood [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 12:59 PM
Subject: Re: [PHP] Passing Array to object


 I remember seeing somewhere that you could only pass a single deminsional
 Array to a class.  But I cant even get this one deminsional to work.  If I
 place the links inside the main class and call it an attribute it works
 fine.

 var $newlinks = array (...)'

 When I var_dump($myarray)  I recieve the output as expected.  For some
 reason its still giving me the warning.  hmmm..  Ive tried everything
 that was suggested.  I think I need to go back and take another look at OO
 programming in php.


 - Original Message -
 From: Chris Sherwood [EMAIL PROTECTED]
 To: Daniel J. Rychlik [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2003 1:46 PM
 Subject: Re: [PHP] Passing Array to object


  hmmm okay
  cause list works by assigning elements in order from an array
  each iterates thru each element in a list so you want to pass both
 elements
  at the same time so you need to pass an array to get the effect your
 looking
  for
 
  ie $name being from the first array element, and $url being from the
 second
  array element...
 
  so I am thinking you wish to assign urls and names to a single array you
  will want to make it a multidimensional array
  ie array (array(name, link),array(name,link))
 
  hope this helps you daniel
 
  - Original Message -
  From: Daniel J. Rychlik [EMAIL PROTECTED]
  To: Daniel J. Rychlik [EMAIL PROTECTED]; Chris Sherwood
  [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Wednesday, June 25, 2003 11:17 AM
  Subject: Re: [PHP] Passing Array to object
 
 
   Its erroring at my display links function.  This function is inside my
  main
   class.
  
   function DisplayLinks($links) {
  
   while(list($name, $url) = each($links) {
  
   echo :::a href= '$url''$name/a:::\n;
  
   } //End while
  
   } // End DisplayLinks function
  
  
   I dont see why it wont work...  I even try assigning $links to the
 array.
  
  
   - Original Message -
   From: Daniel J. Rychlik [EMAIL PROTECTED]
   To: Chris Sherwood [EMAIL PROTECTED];
   [EMAIL PROTECTED]
   Sent: Wednesday, June 25, 2003 1:08 PM
   Subject: Re: [PHP] Passing Array to object
  
  
yea, I gave that a shot, Same message. Logically it makes sense, but
 php
doesnt like it.
   
by the way, thanks for your help Chris.  You've helped me in the
past.
-Daniel
   
- Original Message -
From: Chris Sherwood [EMAIL PROTECTED]
To: Daniel J. Rychlik [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:02 PM
Subject: Re: [PHP] Passing Array to object
   
   
 Have you tried to assign the array to a variable then pass the
  variable
   to
 the function ie

 $index = new main();
 $yourvar = array('array values');


 $index-SetLink ($yourvar);

 - Original Message -
 From: Daniel J. Rychlik [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2003 10:46 AM
 Subject: [PHP] Passing Array to object


 Hello,

 I am developing a site that uses classes to reuse code and
objects.

 I have in my main class a

 function SetLinks($newlinks) {

 $this-links = $newlinks;

 }

 And another function that displays them in the same class main {


 I have another file called index.php that basically just passes
   attributes
 to the main class and the main class displays them.

 Im having a bit of trouble passing an array to the object

 in the index.php

 I create new.

 $index = new main();
 $index-SetLink = array ( 'Link1'= 'link1.php',
 . );

 When I run I recieve Variable passed to each() is not an array or
   object


 so I tried this

 $index-SetLink($newlink = array('link1'= ...);

 same error message.  I was wondering if someone could shed some
 light
  on
 what Im doing wrong.

 Thanks
 Daniel

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

Re: [PHP] quotes

2003-06-25 Thread Chris Sherwood
LOL my mistake jason I should have paid more attention


- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 12:26 PM
Subject: Re: [PHP] quotes


 On Thursday 26 June 2003 01:33, Chris Sherwood wrote:

  I dont know what you were thinking but this is in a php list
 
  when you render html with php and you want double quotes in the html you
  MUST escape them
 
  otherwise you dont use double quotes

 Sorry, it was the context of the thing:

  ie input type=\text\

 As that snippet was on its own without any preceeding echo or print
statement
 I had assumed that that was plain HTML.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --

 --
 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] mysql update not working

2003-06-25 Thread Chris Sherwood
hmmm can you check to see if your field is exactly named desc in the
table... also whether or not it can accept string ie char or varchar.
- Original Message -
From: Steven Efurd [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 2:03 PM
Subject: [PHP] mysql update not working


 I have the following code:


 $sql = UPDATE class_sub SET  desc = '$catdesc', sub_cat = '$subcatname'
 WHERE id='$catid';
 echo $sql;
 $sql_result = mysql_query($sql);
 if (!$sql_result)
 {
 echo PCouldn't update record!br/p;
 echo mysql_error();
 exit;
 } else
 {
 header(Location: index.php); /* Redirect browser */
 exit;
 }
 here is the actual sql statement:
 UPDATE class_sub SET desc = 'Come play with us! This class is designed
 to challenge your cardiovascular and muscular endurance. Participants
 will work or \play\ in different activities such as team exercises,
 sprints, obstacle courses, cycling, plyometrics, and core conditioning.
 Challenge yourself like never before!', sub_cat = 'Recess' WHERE id='4'

 And the error:


 Couldn't update record!

 You have an error in your SQL syntax near 'desc = 'Come play with us!
 This class is designed to challenge your cardiovascul' at line 1



 the table is setup ok, i can INSERT data just fine.
 If i remove desc = whatever from the sql statement it works fine. It
 will update all fields in the table except desc. Now for the life of
 me I cannot see a problem here. Could someone please give a pointer in
 the right direction.

 Thanks
 Steve



 --
 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] One more time - HTTP_HOST

2003-06-25 Thread Chris Sherwood
hmm I am not sure but check this link out it may answer your questions

http://ca3.php.net/manual/en/features.http-auth.php

- Original Message - 
From: Sparky Kopetzky [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 2:41 PM
Subject: [PHP] One more time - HTTP_HOST


Is $_SERVER['HTTP_HOST'] the same as CGI $_ENV['REMOTE_HOST'] ??

Please, I need to know...

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net




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



Re: [PHP] Command line php output redirection.

2003-06-25 Thread Chris Sherwood
try using fopen();

http://www.php.net/manual/en/function.fopen.php

- Original Message -
From: Joshua Moore-Oliva [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 3:37 PM
Subject: [PHP] Command line php output redirection.


 This is really scaring me as file redirection is one of the basic things
in
 linux.. anyways

  I have a php script that outputs to stdout using echo.. when I run it
using

  php parser.php

  I can see the output no problem. However, when I attempted to redirect to
a
 file using

  php parser.php  temp

  temp only contains

  Content-type: text/html
  X-Powered-By: PHP/4.3.2


  Help??

  Thanks, Josh.


 --
 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] calling functions in classes using text and graphic links

2003-06-24 Thread Chris Sherwood
I am not sure what you mean but if you are trying to call functions that
exist within your class
 you need to do something like the following

$fg = new YourClass.class.php;
$fg-yourfunctionname($arguements);

- Original Message -
From: Daniel Rychlik [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 10:09 AM
Subject: [PHP] calling functions in classes using text and graphic links


 Hello,

 I am attempting to solve a problem in PHP.  My application consists of
 Classes and subclasses.  In my Class I call certain functions that have
 header information and footer information displaying them in nicely
 formatted HTML.  I have used this method because of one style sheet that
 all HTML documents read from.  I have run into a problem with executing
 functions using HTML links.  I have not yet come up with a solution and
 I was wandering if anyone has run into his one before.   Obviously I
 need this to be dynamic as possible, and as friendly to use.  Any
 suggestions would be greatly appreciated.

 Thanks in advance,
 Daniel


 --
 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] Change image file size dynamically

2003-06-23 Thread Chris Sherwood
check out this link it should have the answers your looking for

http://ca3.php.net/manual/en/function.imagecreatefromjpeg.php
- Original Message - 
From: Hardik Doshi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 23, 2003 2:14 PM
Subject: [PHP] Change image file size dynamically


 Hi Group,
 
 Is there any way to change the image size (Not height
 and width. I am talking about image file size)
 dynamically? 
 
 Our users upload the big files and we want to find a
 way so once user upload such file, system will
 automatically generate the small file and store both
 versions on the server location. Later on this small
 file will show up as the thumbnail. Once user clicks
 on thumbnail then system will show the original big
 file.
 
 Thanks
 
 Hardik
 
 -
 
 Hardik K. Doshi
 Web Application Developer
 
 Institute of Design
 Illinois Institute of Technology
 350, North Lasalle Street
 Chicago, Illinois 60610
 
 312.595.4907 (direct)
 312.595.4901 (fax)
 
 __
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!
 http://sbc.yahoo.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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



Re: [PHP] Source/version control?

2003-06-23 Thread Chris Sherwood
CVS is a known versioning tool... it resides on a linuxx or unix server and
is free (from gnu) if I remember correctly

otherwise its a google search
- Original Message -
From: J J [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 23, 2003 3:31 PM
Subject: [PHP] Source/version control?


 What tools do you recommend or use for a team
 environment that will allow us to maintain source
 control and even offer some version tracking/history
 in case we need to go back to old code?

 We need the ability to check-in and check-out files in
 a team environment --- normally just HTML and PHP type
 files.

 We have a local windows server we can work from or a
 Linux development server that is remote.  Primarily
 work is done in Dreamweaver and Flash.

 Low or no cost would be ideal.

 Thoughts or suggestions are appreciated.

 __
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!
 http://sbc.yahoo.com

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




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



Re: [PHP] bcmod()

2003-06-17 Thread Chris Sherwood
if I read it right it looks like it returns what is the remainder as per any
normal mod function

so fer instance you want to get the remainder when you divide 10 by 3 (which
we both know is 1)

$remainder = bcmod(10,3);


for example I think

- Original Message -
From: Thomas Bolioli [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 17, 2003 11:42 AM
Subject: [PHP] bcmod()


 The docs (see below) for bcmod() are rather skimpy. Does anyone have a
 clue as to how it works. Basically I want to do this (below code). PS: I
 am new to PHP but not to programming in general.
 Tom

 $i = 1;
 while (something true){
  $modulus = the_modulus_of($i / 4); // does php do % instead of /?
  if($modulus == 0){
   do_this_this_time();
  }
 $i++;
 }

 *bcmod*

 (PHP 3, PHP 4 )
 bcmod --  Get modulus of an arbitrary precision number
 Description
 string bcmod ( string left_operand, string modulus)

 Get the modulus of the left_operand using modulus.


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

2003-06-17 Thread Chris Sherwood
PHPCoder Pro is a very nice development enviroment as well
- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 8:22 PM
Subject: Fw: [PHP] php editor?


 Try to these PHP development environment:
 
 * Nusphere Studio
 * Zend Studio
 * Maguma Studio
 
 hello all people in the PHP mailing list, bye. 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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



Re: [PHP] Re: php editor?

2003-06-16 Thread Chris Sherwood
I use PHPCoder Pro and it works great... hook it into your php and apache
engines and you can run and debug while coding


- Original Message -
From: Noel Wade [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 16, 2003 9:57 AM
Subject: Re: [PHP] Re: php editor?


 My favorite little gem is a shareware program called Code-Genie
 (www.code-genie.com).  Its cheap, fast, a slim app, provides tons of
 useful little features, and has TOTALLY user-configurable text-coloring.
 You can specify a particular coloring scheme for each file extension, so
it
 automatically picks the scheme for the type of programming you're doing -
 very handy!  Comes with schemes for all of the most common / simple
 programming languages, plus plenty of user-made files for download, too!

 It doesn't have any real debugging features, nor can it do fancy things
like
 track your custom object-functions and color them or present their
 arguments - but for a quick, simple, helpful tool - its just perfect!

 Take care,

 --Noel



 --
 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] Redirects in PHP

2003-06-13 Thread chris sherwood
Build a JavaScript and have it execute as the document loads... i.e. in the
body tag with an onLoad event...


the header function in php will not do anything if you have sent output
already

-Original Message-
From: Carl Furst [mailto:[EMAIL PROTECTED]
Sent: June 13, 2003 9:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Redirects in PHP


I want to do one of those redirect pages where a php script prints HTML
saying sorry we're not here, we're redirecting you to the right location
and then after about 2-3 seconds a new location header gets printed and you
are transported to the new location. I see this everywhere but don't know
how it's done.

I tried this by printing the Location header first and then the text and
it just
relocated me without seeing the text. I tried printing the text first and
then the Location header and php complains that my header was already sent
and I
can't modify it to relocate.

How do you do this?? Is there something in the header I have to specify to
wait before it relocates? Do I have to do it manually by printing the text..
tell the script to wait and then clear the header somehow and send a new one
(can that be done?) I looked at HTTP1.1 docs and I didn't really get
anywhere.

Any ideas?


Carl.



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

2003-06-11 Thread chris sherwood
if they choose to limit to ie thats their choice ...

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: June 11, 2003 2:51 PM
To: Miles Thompson
Cc: [EMAIL PROTECTED] Php. Net
Subject: Re: [PHP] nl2br


That's plain wrong.  This is the /world wide/ web, not the IE users'
club.  Either stop that BS or keep off of the internet!

Miles Thompson wrote:

 We limited our users to using IE


--
The above message is encrypted with double rot13 encoding.  Any unauthorized
attempt to decrypt it will be prosecuted to the full extent of the law.



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

2003-06-11 Thread chris sherwood
That's true but how would you feel if you made some choices and then had
people criticizing it when you have no choice due to resource and funding
restrictions?



-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: June 11, 2003 3:13 PM
To: chris sherwood
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] nl2br


And it's my choice to tell him to go to hell.

chris sherwood wrote:

if they choose to limit to ie thats their choice ...


--
The above message is encrypted with double rot13 encoding.  Any unauthorized
attempt to decrypt it will be prosecuted to the full extent of the law.




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



RE: [PHP] nl2br

2003-06-11 Thread chris sherwood
and what consequences would that be.. its not law


-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: June 11, 2003 3:27 PM
To: chris sherwood
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] nl2br


Standards-compliant HTML can be written just as cheaply and easily as
IE-compliant HTML.  If I chose to make my restraunt inaccessible to
wheel chairs, I would have to face the consquences.

chris sherwood wrote:

That's true but how would you feel if you made some choices and then had
people criticizing it when you have no choice due to resource and funding
restrictions?


--
The above message is encrypted with double rot13 encoding.  Any unauthorized
attempt to decrypt it will be prosecuted to the full extent of the law.




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



[PHP] cookies

2003-05-27 Thread chris sherwood
Hi all

I have a cookie on the system and I know the name of the var set in it but
I seem to be unable to retrieve the info in the cookie.

any pointers?


Chris Sherwood
Nortia Learning Systems
(604)717-4323 office
[EMAIL PROTECTED]



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