[PHP] Apache Directives for php as module

2002-06-26 Thread Jason G Trusty

Hello,

I read the support pages at php.net regarding php.ini. Am I correct in the
assumption that so long as you have php compiled as a module for apache that
you can than use apache style directives to override the default php.ini?

Furthmore, are these override directives allowed in a vhost container? Given
the example vhost container (taken from my existing server setup):

VirtualHost 127.0.0.1:80
  ServerAdmin [EMAIL PROTECTED]
  ServerName www.example.com
  ServerAlias *.example.com

  php_value open_basedir = e:\www\htdocs

  DocumentRoot E:/www/htdocs

  Directory E:/www/htdocs
Options IncludesNoExec MultiViews
AllowOverride All
Order allow,deny
Allow from all
  /Directory

  Alias /logs/ c:/Apache2/logs/www/

  Directory c:/Apache2/logs/www/
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
  /Directory

  ErrorLog c:/apache2/logs/www/error.log
  CustomLog c:/apache2/logs/www/access.log common
  TransferLog c:/apache2/logs/www/access.log
/VirtualHost

Would the additional directive I have added (php_value open_basedir =
e:\www\htdocs) restrict php from executing any code, scripts and/or
fuctions from being executed for this virtual host only by limiting it to
the vhosts home directory?

I am obviously running apache/php/mysql in a Windows environment and I am
worried about security. Currently (using php) I can execute/issue any
command or function of my choosing with no restrictions whatsoever. For
example: I can create/delete directories, files etc  This is obviously
not a secure environment for virtual hosting.

Any help concerning this matter would be appreciated.

Cheers,
JTrusty


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




Re: [PHP] classes- getting their slowly but surely I think

2002-03-28 Thread Jason G.

Hello,

It sounds like a problem with your HTML output.

First, look at the source of the generated page, and find out if your html 
is formatted correctly.  Then look at the php code to find out the problem.

-Jason Garber

At 04:44 PM 3/28/2002 -0800, Caspar Kennerdale wrote:
just a quick query, hopefully someone can help (sorry for these repeat
schooboy questions)

re classes-

Can you create an instance of a class and use its 'value' within an instance
of another instance of the same class?


For example I have created two classes- html.class and db.class

I am creating an instance of the db.class to give an array containing the
rows from a table.

I would like to create a table using my HTML.class and using a while loop
create a tr using the date collected from each row in my db.class.

This all works fine.
However when I embed this newly created table into a cell of another table
created with html.class, the table is still created but it does not appear
in the cell, but outside of the desired table- so I have two tables side by
side instead of one table embedded within the cell of another?

Is this a code/ syntax issue or have I misunderstood the scope of classes?

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] implement yourname.mysite.com redirection

2002-02-18 Thread Jason G.

Hi, Look into mod_rewrite with Apache.

We use it to capture www.univo.biz/yourname and display a page about you.

However, my experience is very limited.  I would imagine you could figure 
it out though.

-Jason Garber
IonZOft.com


At 09:47 AM 2/18/2002 +, Adrian Murphy wrote:
Hi,
I'd like to implement a system whereby people have a subdomain on my site 
like so:
yourname.mysite.com
I've been reading the apache docs that say you can do this via virtual hosts.
Can I do it so 'yourname' can be anything - where all requests are sent
to the same page where i can parse the uri and query a db based on 'yourname'.
any reason why my isp might be reluctant to do this.I'm presuming I can't
do it via .htaccess?
as a side note what are the affects of this kind of redirection as far as 
search engines
go.I've heard that doing this kind of thing on a 404 page is a bad idea.


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




[PHP] Re: [PHP-DB] I cant get the logic for this...

2002-02-18 Thread Jason G.

$nWidth = 3;
$oRow = TRUE;

while($oRow)
{
 //Write tr here
 for($i=0; $i$nWidth; $i++)
 {
 $oRow = mysql_fetch_object($dbResult);
 //Write td/td here
 }
 //write /tr here
}

At 12:06 PM 2/18/2002 +, you wrote:
Hi all,

I want to display return results from my query (which works fine)
In I tidy way on screen.

So my result returns say seven results, I have a table, and I want to
show
3 results per row of the table... I.e.:

Table
TR
TD = result1 /TD  TD result2 /TD TD = result3 /TD
/TD
/TR
TR
TD = result4 /TD  TD result5 /TD TD = result6 /TD
/TD
/TR
TR
TD = result7 /TD  TD resultempty /TD TD = resultempty /TD
/TD
/TR
/table

The last two td in row 3 are empty because result found 7 results.

This cant be fixed so echo statements wont work as the result could
Be 3 or 10 or 56 or whatever.

As Always your help and or guidance in this matter is appreciated.

Dave Carrera
Php / MySql Development
Web Design
Site Marketing
http://www.davecarrera.com




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




Re: [PHP] form submission error trapping

2002-02-18 Thread Jason G.

Why do not you all just put all your PHP logic, db access, etc at the TOP 
of the script.  Once you have your results and variables created, then 
start into html.

This method produces MUCH cleaner scripts, and there is a very minimal 
amount of PHP interspersed within the HTML. Also, you have time to bail 
out, or redirect, etc...


?
 Connect to DB

 Are we to process the form?
 Yes:
 Validate fields
 Generate Error Messages
 break;
 No Error Messages?
 Update the DB
 Header(Location: bla.php?NEWID=$NEWID);
 exit;

?
html

Firstname: ? if(error) echo(error message); ?br
input type=text name=txtFIRSTNAME value=?= 
htmlspecialchars($txtFIRSTNAME); ?br
br
Lastname: ? if(error) echo(error message); ?br
input type=text name=txtLASTNAME value=?= 
htmlspecialchars($txtLASTNAME); ?br
br

/html




At 08:35 AM 2/18/2002 -0500, Matt wrote:
I think that mixing of html and php is too complex and leads to hard to
maintain scripts. I find it extremely difficult to understand a scripts
logic when it's spread out over hundreds of lines of php/html.

I use EasyTemplates that came in Web Applications Development with PHP 4.0
by Tobias Ratschiller and Till Gerkin. It looks like the source is
copyrighted and you have to buy the book to get it.  But it says it's based
on FastTemplates.  The book itself is at
http://www.amazon.com/exec/obidos/ASIN/0735709971/

You can see a sample of the method here
http://marc.theaimsgroup.com/?l=php-generalm=101371611609042w=2

Notice that the form action handler is the same as the original form. This
is a simple example, but it does remember user input as you want.

I wrote a couple of helper functions that accept db names to build select
boxes and radio buttons.  They return strings of the html with the selected
value, and I just put them in a template container reserved for them (the
{TEMPLATE_ITEM} in the sample).

For tables with unknown number of rows, I have one template of the main
page, one for the table container, and one for each row itself.  I loop on
the row, using the row template and concatenate all of the rows of html into
a string.  I take that string and stick it into the table template, and
finally stick the table into the page template.  Very smooth, easy to read,
and no trouble with headers() since all output is done on the last
statement.  You have complete control over the script until then, and can
bail out to another page, or decide to use other templates and output
something else.

As for errors, I build an array of the messages such as:
if (!empty($thatsThere)) {
$errors[] = Don't put $thatsThere in  there;
}
if (empty($userName)) {
   $errors[] = Username must be supplied;
}

Then you can tell if all is okay, with if (is_array($errors)).  If it is an
array, then something is wrong, so I  append the array contests into html
like this:
foreach($errors as $value) {
  $errorMsgs = $value . br\n;
}
and then put $errorMsgs into the page template container you've reserved for
it.

- Original Message -
From: Jason Dulberg [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

  I am working on some error trapping for several forms on my site. After
  visiting a bunch of websites, I've noticed 2 common methods of displaying
  error messages.
 
  1. display an error box on a new page and force the user to hit the back
  button
 
  2. display the form again with appropriate error text and pre-filled
fields.
 
  I have part of the error on the new page working but I'm running into the
  infamous no contents in the form after going back.
 
  There are some useability issues with forcing the user to hit the back
  button -- some just don't want to bother.
 
  Is there a way to display the form w/original contents and error messages
  'without' having to code the entire form twice? I have about 5 forms with
50
  fields or so each.
 
  What would be the best way to go about redrawing the form with the errors
  shown beside each field?
 
  Any suggestions are greatly appreciated.



--
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] Server Loading Question...

2002-02-06 Thread Jason G.

Hello List,

Does anyone know of a Really Good way to determine what kind of loads your 
Webserver/network can handle before degrading performance or flaking 
out?  I would like to find this out about our server before it fails us 
under heavy load.

Thanks,

Jason Garber
Univo.biz


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




Re: [PHP] Can php Read contents from MS Word in Exactly sameformat

2002-02-04 Thread Jason G.

Not that I know of - which doesn't mean much.  I do know that the RTF 
format is a published spec, that you could read if you felt like taking the 
time to code a reader.

However, give google a try, and maybe you'll turn something up.

-Jason Garber


At 03:07 AM 2/4/2002 -0500, jtjohnston wrote:
Is there a function or class written to convert rtf reliably to html? :)
Let me know,
John
A post  reply would be helpful if you can.

Jason G. wrote:

  MS Word is a proprietary, binary (i think), format...  Have fun.
 
  There may be a solution out there.
 
  If you could convince her to save it in Rich Text Format (rtf) and then
  upload it, your life would be much easier...
 
  -Jason Garber
 
  At 01:51 PM 2/4/2002 +0800, Jack wrote:
  Dear all
  I had made  a news input page for one of the HR Manger to input the 
 news for
  the whole company to read, she is quick comfort with using MS word as a
  editor, so is there anyway that the php can read the contents from the MS
  Word and display as exactly same format to html?
  
  If there is so, could any one suggest a book to me?
  
  Thx a lot
  Jack
  [EMAIL PROTECTED]
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


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


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




Re: [PHP] mail() function not sending to Yahoo address

2002-02-04 Thread Jason G.

Just a note...

Make sure your server's IP address is not black holed by some spam list...

-Jason Garber
IonZoft.com


At 08:22 AM 2/4/2002 +0100, TV Karthick Kumar wrote:
  Hi,

 I use a form on my website for the visitors to send me the feedback and
use the mail() to do this job for me. And I get mails without any
problems I am happy... :-)..

Karthick


  I've tried several PHP form processors, and all of
  them have trouble sending the form contents to a Yahoo
  address.  When I change the address to something other
  than a Yahoo account, it sends the form results with
  no problem.  Is there an issue with PHP's mail
  function and Yahoo email addresses?
 
  thanks,
  John
 
  __
  Do You Yahoo!?
  Great stuff seeking new owners in Yahoo! Auctions!
  http://auctions.yahoo.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.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] crypt/Password

2002-02-03 Thread Jason G.

Hi,

I just thought i would point out that the entire point of crypt, md5, or 
MySQL password() function is to create a hash out of the original 
string.  However, they are designed so it is computationally infeasible to 
take a hash and find out the original string was.  Actually, it is 
impossible to know exactly what the original string was, because there may 
be more than one input that creates the same output.  The chances of this 
happening in a password case are EXTREMELLY RARE.

Sometimes, I to use md5 to hash passwords, and others, I just store the 
plain text passwords in the protected database. In most cases, if someone 
has access to your database, you have bigger things to worry about than 
them getting your password list.

Best Regards,

Jason Garber
IonZoft.com


At 11:56 PM 2/3/2002 +0800, you wrote:
Hi there,
I'm creating a user/password table that will use either Mysql Password or
PHP Crypt function to encrypt the data. I know these functions are non
reversible for good reason, but how do I deal with a situation where I want
to email out a forgotton password? How can I get the passwrd back to a form
recognisable to the user?
Thanx in advance
Phil



--
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] Can php Read contents from MS Word in Exactly same format

2002-02-03 Thread Jason G.

MS Word is a proprietary, binary (i think), format...  Have fun.

There may be a solution out there.

If you could convince her to save it in Rich Text Format (rtf) and then 
upload it, your life would be much easier...

-Jason Garber


At 01:51 PM 2/4/2002 +0800, Jack wrote:
Dear all
I had made  a news input page for one of the HR Manger to input the news for
the whole company to read, she is quick comfort with using MS word as a
editor, so is there anyway that the php can read the contents from the MS
Word and display as exactly same format to html?

If there is so, could any one suggest a book to me?

Thx a lot
Jack
[EMAIL PROTECTED]



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


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




Re: [PHP] Sockets

2002-02-03 Thread Jason G.

A quick note...

If you are not aware of cURL (curl.haxx.se), then you may want to look into it.

If you are, then please disregard this post.

-Jason Garber

At 11:06 PM 2/3/2002 -0800, Evan Nemerson wrote:
Anyone know if there is a way yet to see if a socket is still connected to a
host? I want to use a socket to send GET / HTTP/1.0\r\n\r\n over a socket,
and retrieve everything the server sends. That part works great, but I can't
figure out when the remote host disconnects.

I have the CVS version of php.

Here is the function so far. The problem is at the end.



function getdata ($host, $port, $data)
{
 /* well, the below comment would be true if i could get it 
 working! */

 /* This function sends $data to $host:$port, then returns the 
 response
 * until connection is severed. Great for HTTP, but won't usually work
 * too well in protocols where data needs to be analyzed, and replied
 * to appropriatly, such as POP v3 */

 // Create a socket
 $so = socket_create (AF_INET, SOCK_STREAM, getprotobyname(TCP));
 if ( !$so )
 {
 exit(Could not create socket.\n);
 }

 // Connect...
 $ec = socket_connect ($so, $host, $port);
 if ( $ec  0 )
 {
 exit (ERROR $ec: .socket_strerror($ec));
 }

 /* Write $data to socket. The manual doesn't say what it returns, 
 but I'll
 * assume (even though it makes an ass out of you and me) that it 
 is the same
 * as socket_connect() because it wouldn't be logical to return a
descriptor. */
 $ec = socket_write ( $so, $data, ( strlen($data) ));
 if ( $ec  0 )
 {
 exit (ERROR $ec: .socket_strerror($ec));
 }
 else
 {
 /* PROBLEM IS HERE- what do I put instead of while ( $x 
 == 0 )??? */
 $x = 0;
 while ( $x == 0 )
 {
 $buffer = socket_read ( $so, 1, PHP_BINARY_READ);
 $string .= $buffer;
 }
 }

 // And (hopefully) return $string, for your viewing pleasure.
 return $string;
}

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


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




[PHP] Re: [PHP-DB] Drop down list

2002-01-30 Thread Jason G.

Sir,
Would you kindly suppress the 7000 headers that your IncrediblyAnnoying
email program includes. Also, please use only plain-text.
Thanks you,
Jason Garber
IonZoft.com 
At 09:17 PM 1/30/2002 +1300, you wrote:
 I have two fields artist_id,
artist. How do I put the contents of artist into a dropdown
list.


IncrediMail - Email has finally evolved -
Click
Here 


Re: [PHP] How can I decrypt a password I previously coded with md5()?

2002-01-30 Thread Jason G.

Hi Nicolas,

I would be interested in seeing the javascript md5 function if possible.

Thanks,

Jason Garber
IonZoft.com



At 11:18 AM 1/30/2002 +0100, Nicolas Costes wrote:

As already said here, you cannot reverse the md5() function ...
So :

 -The user fills a login box (login, password)
 -The PHP script 'crypts' this password with md5();
 -The already-encrypted password in the database (or the passwd 
 file) is
 compared with the one provided by the user (and encrypted by PHP) 
 : if they
 aren't the same ... Bye !!!

And for more security, I use a JavaScript MD5 function to encrypt the
provided password in the user's browser so it goes already encrypted on the
net ... Then PHP's just got to compare it with the one in the database !!!


Le Mercredi 30 Janvier 2002 10:51, Jose a écrit :
  I'm making a proyect in php, and I have some doubts about the md5.
  I encript a password with it, but I don't know how to decrypt it again.
 
  Thanks.
 
 
  ---
 - --
  Jose Fco. ( [EMAIL PROTECTED] ).
  OLINET, S.L. Teléfono: 952207135 - Fax: 952207600
  Avda. Juan Sebastián Elcano, 39-41. 29017 Málaga.
  ---
 - --

--
  ( ° Nicolas Costes
  //\\  IUT de La Roche / Yon
/ \/ ) [EMAIL PROTECTED]
`-  http://luxregina.free.fr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] '' and \ - How do you avoid removing these?

2002-01-29 Thread Jason G.

Set this:
magic_quotes_gpc=0

in your php.ini

or use stripslashes on all your data.

-Jason Garber
IonZOft.com


At 02:58 AM 1/30/2002 +, Jon wrote:
Okay, I'm trying to read in a form with  and ' in it. The problem is that
PHP automatically changes these to \ and \' without asking :( If I read in
a file with  or ' in, it's fine and outputting to the screen is no problem.
It's only when I read in from a form that a problem appears. All I want to
do is read from my form and write it into a normal text file. If anyone's
got any ideas how to solve this, feel free to mail me... Cheers!





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Any Ideas

2002-01-28 Thread Jason G.

$str = ereg_replace('[-!@#$%^*()_+=-\';:/.,?]', '', $str);

You may need to escape some of these characters with \

On the other hand, they are contained in a character class [] so you may 
not need to escape them.  Note how the `-' is in the beginning.

-Jason Garber
IonZoft.com


At 09:13 AM 1/27/2002 +1300, Philip J. Newman wrote:
Any Ideas how I can remove   !@#$%^*()_+=-';:/.,? charactors from a 
string?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] getting a LAMP job in this economy

2002-01-25 Thread Jason G.

This has been an interesting thread, so I'll toss in my unique point of view...

I have never held a full time job for anyone but myself.  I find good 
opportunity and take advantage of it.  I make decent money also.

I have not marketed myself as a PHP developer, but rather as a problem 
finder and solver.

Many times, clients do not know what they need - you need to find the 
appropriate solution to their problem, even though they do not know what 
their problem is!

If you become well at doing this, you *will* be able to find 
business.  Maybe it takes a passion for the field.  But you do need to be 
able to recognize the issues and apply your vast knowledge (from many 
different areas) to it, and come up with a solution that your clients did 
not even know was possible.

Now, this will not happen all the time, but when it does, you will be 
getting more business from them, and other businesses that they talk to.

For those of you that have a mind for business, there are hundreds of 
unique opportunities that you can use to generate money.

The site I am currently working on is owned by three people (including 
me).  The each of us bring a very different skill to the table.  I bring 
technical skills and problem solving, partner 1 brings Sales and marketing, 
partner 2 brings financial backing and a mind for business.  The result is 
a site that is expected to top $1,000,000/year by 2003.

When I first encountered the above venture (it is only 1 year old), I did 
not know PHP (I have had other experience - not web based though).  I said 
I'll have your site working in 7 weeks.  What a seven weeks!  But I spent 
some crazy hours working on it, learned PHP, MySQL, CSS, HTML, etc..., and 
delivered the site (3 days late).

Look for niche groups of people that you can market a particular, useful 
service to.  Keep your eyes peeled - you will turn things up.

In the mean time, learn.  Become not only good, but excellent.  When you 
have mastered PHP, master MySQL.  When you have that down, learn how TCP/IP 
works, learn C, learn Perl, learn how to write Windows Apps that interface 
with the data on your Web server.  Read, Read, Read.  Feed your brain, be 
observant, and you will find ways to market yourself.

More and more in the job market today, I see people that are good in 1 
area.  But one area is not good enough for most business issues.

My hobby (that's what I call it) is finishing my Electro-Mechanical 
Engineering Technology Degree.  They have the right idea - output students 
that can help a business with electronice, robotics, computers, plc's, 
mechanics, machining, etc...  The student may not be fluent in all, but 
they know enough about different areas, that they can come up with ideas 
for solutions, and then figure out the details are.

Keep in mind, a Job is not the only way to go.  Learn, learn, learn more.

Just my (limited) experience.

Jason Garber
IonZoft.com



At 09:32 PM 1/24/2002 -0500, you wrote:
Vincent Stoessel wrote:

On another list that I am on someone made this very bold
statement:
I've seen a lot of jobs for ColdFusion  Oracle or MS SQL server
experience combinations.  Don't let anyone fool you, PHP/MySQL is not
going to land you a job  [;)] 
now, as someone that was making avery good living doing Linux based
web application development last year and now among the jobless I am 
beginning
to question the validity of having all of my eggs in the LAMP  (linux 
apache mysql php)
basket.  I just recently built a NT4 to do some win based development on. 
I still have
not installed any development enviroment cause it just feels so alien. 
Has anyone else
out there feeling the pressure of going to the win32 side  to pay the bills.
Thoughts?


This really depends on how you want to work and/or approach 'jobs'.

Do you consider a job a place to go for 40 hours a week and get a 
paycheck?  Or is it more than that?

Being able to positively improve an employer's bottom line is always a 
plus you can bring to any 'job' - you're there to do work and make them 
money too.  If you can help by furthering the use of Linux/PHP/etc due
to the licensing cost issues, so much the better.

I will never again (bold words I know) *merely* have a job where I'm
told what to do by someone who doesn't really give a rat's ass about 
me.  :)  (been there done that too many times).  When approaching a job 
now, I would be more proactive about what impact I can make in a company, 
and  the Linux/PHP skills/experience would be a facet of that, no doubt.

Sure, there are many people advertising for ASP developers, etc. Perhaps 
they're not finding qualified people, and need to advertise? I'd say 
PHP/MYSQL won't land you a job, but neither will CF, or Java, or anything 
else.  You need to sell YOURSELF, and if you sell your ability to further 
a company's objectives (make money) many won't care what you use, or at 
least won't care to the point of restricting you.  There will always be 
shops that are CF 

Re: [PHP] Need opinion On sessions - Cookies mandatory?

2002-01-23 Thread Jason G.

At 09:35 AM 1/23/2002 +0100, Nick Wilson wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Jason G. blurted
  If cookies do not work, then you must have a session_id appended to the
  URL.  HTTP is a stateless protocol.  So every time you make a request 
 via
  HTTP, you must let PHP know what the session_id is either through cookies,
  or url query strings (or possibly posted with a form).

Yep, now I'm with you. The amount of times you'd see that kind of ugly
URL would be fairly minimal in most situations as most users these days
aren't even aware they *can* disable cookies.


   disable cookies, but appending the session ID could be a security risk.
   Consider this: Someone is viewing a page and says oh cool, I want Joe
   to see this. He then copy/pastes the URL, sessionID and all, to Joe,
   who then loads up the page using his friend's SessionID. With cookies,
   this would not happen.
  
  Not a problem. The session is *destroyed* as soon as a user closes the
  browser.
 
  A session will only be *destroyed* if it uses a cookie. PHP never knows
  when you close the browser, but the browser will remove the cookie.  Next
  time you fire up the browser, it will not send the cookie, and a different
  session will be started.

Sure. But there is some kind of clean on the host machine right? You
couldn't expect to continue a session a week later because you've
bookmarked a URL containind a SID.
I think this is controlled by something like a timeout var in the
php.ini.
Yeah, the sessions will time out and be cleaned up, but that applies just 
as much for cookie based sessions as url based sessions.


  In my personal experience, using cookies only has not proven to be a
  problem.  Your call.
I run several sites that have secure login's (Username and password).  And 
i do require the members to have cookies enabled in order for them to login.

If anyone has a problem with it, then they tell their browser to destroy 
the cookies when they close the browser, or only accept cookies from my sites.

When you say using cookies only do you mean 'requiring' the user to have
cookies enabled?

- --

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com

-Jason Garber
IonZoft.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Fatal error: Call to a member function on a non-object in example 1.php on line 66

2002-01-17 Thread Jason G.

First of all, make sure the $root-children() returns an array of objects.

Second of all, remove the space between $All_nodes and [1].

Your code should look like:
$childNodes=$All_nodes[1]-children();

If that does not work, you may have to create a temp var to use...
$tmp = $All_nodes[1];
$childNodes=$tmp-children();

-Jason Garber
IonZoft.com

At 06:21 PM 1/17/2002 +, Sandeep Murphy wrote:
Hi,

I keep getting this error Fatal error: Call to a member function on a
non-object in /www/html/smurthy/example1.php on line 66 and simply unable
to figure out why this is occuring..

64 $root = $dom-root();

65 $All_nodes = $root-children();

66 $childNodes=$All_nodes [1]-children();

can anyone help me out pleaseee

TIA,
sands

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] htmlspecialchars() alias

2002-01-17 Thread Jason G.

Hello General and Dev list,

Considering the fact that it is good practice to use htmlspecialchars() 
anytime you are outputting non-html content to the browser...

After typing the 16 characters in the htmlspecialchars() function thousands 
of times...

I was wondering if it would be feasible to create an alias for this 
function, say hsc() or something short.

Even nicer, but probably not practical would be a language extension like:
?== $var ?   being the same as  ?= htmlspecialchars($var) ?

It is no big deal, but for a function that is used ALL THE TIME, it would 
be nice.

Any Comments???

-Jason Garber
www.IonZoft.com
www.Univo.biz


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Including files variables ...

2002-01-02 Thread Jason G.

What you need to do is simply set the variables before you include the script.

When you include a script with include() or require(), they fall into the 
same namespace as the include() or require() function that called them.

Best Regards,

Jason Garber
IonZoft.com

At 06:54 PM 1/28/2002 -0800, Evansville Scene wrote:
I'm having problems passing variables into included PHP files.  How can I 
do this?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Branching to a page

2001-12-13 Thread Jason G.

Just send a redirect header.

header(Location: nextpage.php);
exit;

-Jason Garber
IonZoft.com

At 08:45 AM 12/11/2001 -0800, Todd Cary wrote:
I open a socket if I am in the middle of a php script to branch to a
page so that I can send the header information.  However, I understand
that this is not how most php programmers do it.  Could someone share
with me the way it is done with php?

In more detail, this is how I structure a page:

1) The Form calls itself - the same page.

2) At the top of the page, I do my validation and I may check to see if
a Cancel button was pressed.

3) Depending on the circumstances, I branch to another page.

   /* Example: was the Cancel button pressed?
  If so, branch to redirect page */
   if (!empty($cancel)) {
 $http = new http;
 $fp = $http-http_fget($server, $path .
 redirect.php,);
 if($fp) {
   print 'BASE HREF=' . $url .
   'redirect.phpp';
   fpassthru($fp);
   exit;
 }
   }

Many thanks.

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL Query Question

2001-12-08 Thread Jason G.


Assuming you have the variable member_id (for the member in question)...
Get the score for that member and store it to $score...

SELECT score FROM members WHERE id=$member_id

Then to determine rank, just do this...
SELECT COUNT(*)+1 as rank FROM members WHERE SCORE$score;

-Jason Garber
IonZoft.com

At 08:47 PM 12/8/2001 +, Andrew Brampton wrote:
Hi,
This isn't a php question, more of a SQL question, but I don't know any 
where better to send it, and I guess its trival enough for someone here to 
answer.

Anyway, I have a list of members each with a score field. How can I say 
that Member 3 is ranked 10 out of 100 members for example.

Here is the layout of the members table:
ID, Name, Score

I can get the total count of members in the table, but I don't know how to 
determine what rank they are, unless I return all the rows in the table 
(sorted), and cycle through them until I find the member I want, counting 
how many people are above him... This method would work, but would be slow 
(and wastful), is there a better way to determine his position with a SQL 
Query?

Thanks in advance
Andrew

P.S
If it matters I'm using MySQL  PHP 4.0.6 on WinXP under Apache 1.3.22


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to compute time to load page...

2001-12-08 Thread Jason G.

What about the small difference there will be between server time and local 
time?
-Jason Garber

At 10:40 PM 12/8/2001 -0500, Alex Shi wrote:
Basically I agree with you. But the second time to get time must be done
after the page is rendered on local browser. So I suggest to use Javascript
for the second time to get time, and pass the first time value into a js
function.

Alex


- Original Message -
From: Andrew Forgue [EMAIL PROTECTED]
To: Jack Dempsey [EMAIL PROTECTED]; Torkil Johnsen
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, December 08, 2001 9:42 PM
Subject: Re: [PHP] How to compute time to load page...


  Or this:
 
  at the beginning of your script, get the time using microtime
  then at the bottom, you could  get the time again, subtract
  the difference and voila, thats how long the execution time
  of your script is.
 
  -ajf
 
  - Original Message -
  From: Jack Dempsey [EMAIL PROTECTED]
  To: Torkil Johnsen [EMAIL PROTECTED];
  [EMAIL PROTECTED]
  Sent: Saturday, December 08, 2001 7:59 PM
  Subject: RE: [PHP] How to compute time to load page...
 
 
   the search time is different than the page load timegoogle for
example
   can find thousands of records in a tenth of a second, yet it takes
longer
  to
   get that html result back to your browseryou could estimate page
   download time by calculating the filesize and using the connection
   speedcertainly not 100% accurate, but it will give you a way of
   estimating.
  
   jack
  
   -Original Message-
   From: Torkil Johnsen [mailto:[EMAIL PROTECTED]]
   Sent: Saturday, December 08, 2001 7:14 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] How to compute time to load page...
  
  
   Hi All... (again)
  
   I was just wondering if anyone out there has made a function that will
   compute how long time (seconds, milliseconds) it will take to load a
page?
  
   I see some search engines have a function that displays how long time
the
   search took, and I'm looking for the same thing, to compare different
   designs and improve loading time for my viewers.
  
   Anyone?
   - Torkil Johnsen
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] session question: session.auto_start vs. session_register.

2001-12-05 Thread Jason G.

You may want to check out something like auto_prepend_file.  Look at the 
PHP configuration help.

I was thinking that you may be able to include your class definition there 
- IF auto_prepend_file IS INCLUDED BEFORE session.auto_start starts the 
session.

Otherwise, use auto_prepend_file to include a file that:
1. Inludes your class def
2. Starts your session.

Just my 2 Cents.

-Jason Garber
IonZoft.com


At 12:44 PM 12/5/2001 -0800, Kurt Lieber wrote:
I am working on an open source e-commerce package and have hit a wall with
sessions.

If I have session.auto_start turned on, I get the following error message:

Fatal error: The script tried to execute a method or access a property of an
incomplete object. Please ensure that the class definition shoppingcart of
the object you are trying to operate on was loaded _before_ the session was
started in  path to my file on line 12

If I turn session.auto_start off, the error disappears.

So, the error message tells me that I can't use the class unless I've defined
it before the session gets started.  However, session.auto_start (as far as I
know) starts a session immediately, before even waiting for a script to be
fully parsed  executed.  So, the two seem mutually exclusive. (but then the
usefullness of session.auto_start would seem extremely limited)

Is there a way

I think there's some glaring errors in my understanding here.  Can someone
help me fill in the holes?

--kurt


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cause of:`T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR'

2001-12-01 Thread Jason G.

Hello all,

I have ran across this error a number of times, and for those of you who 
are or will pulling out your hair, read on.

When you get a:

Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or 
`T_VAR' or `'}'' in your_script.php on line 2149

Check to see if you have all of you { and } intact.
The error could be thousands of lines away, but the error message may point 
to the end of your file.

I notice this behavior when I am working on class definitions and forget to 
open close a block (switch, for, while) in a method in the class somewhere.

Hope it helps someone.

-Jason Garber
IonZoft.com






Re: [PHP] Classes

2001-11-25 Thread Jason G.

Miles,

I have come from a QBASIC to VFP to VC++ to PHP (VFP and PHP are my primary 
languages), so I'll try to clear it up a bit.

In VFP, there is no constructor.  I believe that the equivalent is the 
init() method.  The init() method, or the constructor (in PHP, C++, etc) 
are useful for doing stuff that needs to be done when an object is 
created.  Likewise in true object oriented languages (PHP is not one of 
them yet), there is a Destructor that is called when an object goes out of 
scope or is deleted.  In VFP, there is a Destroy() method to simulate this 
behavior.

In VFP, there is the notion of Public, Private, and Hidden properties.  PHP 
does not yet support this behavior.  In PHP, especially since it is such a 
loosely typed language, you can add and remove properties on the 
fly.  Generally when programming in PHP, I like to identify private 
properties and methods by placing a single underscore before their 
name.  This makes it clear for someone using the class not to ever 
reference these entities.

If you want to see a neat example of object oriented programming in action 
(not that I like M$ or anything), check out how the Microsoft Foundation 
Classes (MFC) work.  They effectively demonstrate public and private class 
members, inheritance, constructors, destructors, parent objects, etc...

Hope it Helped...

-Jason Garber
IonZoft.com






At 09:10 AM 11/25/2001 -0400, Miles Thompson wrote:
Chris,

Not such a useless explanation at all, in fact a damned good one. Tight  
concise, and you immediately related the functions to code examples, along 
with an easy-to-visualize object, the chair.

But I have two questions:

1. Why is a constructor class needed? My OO background is Visual FoxPro, 
and all it requires is a declaration of  the class, it' methods and properties.

2. Are the chairs properties exposed, or are they private? You use 
functions to both set and retrieve them, which implies that they are 
private.  Even so, PHP's syntax is much cleaner than the tortured syntax 
used in VB.

Miles Thompson

At 03:28 AM 11/25/2001 -0800, you wrote:
On Sun, 25 Nov 2001, Rudi Ahlers wrote:
  Can anyone explain classes to me please? On many sites have I seen 
 classes,

There are people earning PHD's while explaining classes.  I know your
question originates from using PHP, and this is a PHP general mailing list
... but your question is just a tad too general for this list.

  I'm not sure how these work, or how to use them. I'm still learning about

Classes aren't unique to PHP.  You need to learn a true object-oriented
programming language (C++, Java, ... etc.) to really learn classes.
Truly gifted individuals can learn object-oriented programming w/o too
much help, but they'd first have a firm grip on programming.  I'd expect
the average, novice programmer to need a good amount of help learning 
understanding objecte-oriented programming ...  like that attained from a
University, a good High School, or a lot of independent study and time
experimenting with code.

That said ...

You weren't completely missing the boat with your analogy of a class to a
variable, but in the same breath, that idea is totally missing the boat (I
can see from where you're coming, and to where you're headed).  Classes
are an IDEA.  They're not actually anything.  They're the definition of
private and public data members and methods that should make up an object.
When a class is instantiated, an object is created with the defined data
members and methods available.  You can then use the objects' methods to
set, get, alter, or otherwise interact with its data members, or to simply
perform a set of related operations.  Insert a couple semesters of theory
here. That's my feeble attempt to explain classes.  It's abstract, I
know, and possibly not a help at all.  But it's because of the paragraph
above this one.

Let's look at some petty code:

class chair{
 // DATA
 var num_legs;
 var color;
 var num_arms;

 // METHODS
 function chair( $legs = 3, $arms = 0 ){ //CONSTRUCTOR
 $this-num_legs = $legs;
 $this-num_arms = $arms;
 }

 function setLegs( $legs ){
 $this-num_legs = $legs;
 return;
 }
 function getLegs( ){
 return $this-num_legs;
 }

 // ... *clip* ...
}


Above is the [incomplete] definition of a chair class.  As you can see,
the class is useless.  But you can instantiate the class, and create a
useable object ... you can now create a chair.

$myChair = new chair( 4, 2 );

Now I have a chair [object] with 4 legs and 2 arms, called $myChair.
Let's have the chair tell us how many legs it has ...

$numLegsOnMyChair = $myChair-getLegs();
print( My Chair has $numLegsOnMyChair legs. );

Lets change how many legs the chair has ...

$myChair-setLegs( 7 ); // very odd, seven-legged chair

We should have a chair with 7 legs now, instead of 4.  

Re: [PHP] Classes

2001-11-25 Thread Jason G.

Miles,

I have come from a QBASIC to VFP to VC++ to PHP (VFP and PHP are my primary 
languages), so I'll try to clear it up a bit.

In VFP, there is no constructor.  I believe that the equivalent is the 
init() method.  The init() method, or the constructor (in PHP, C++, etc) 
are useful for doing stuff that needs to be done when an object is 
created.  Likewise in true object oriented languages (PHP is not one of 
them yet), there is a Destructor that is called when an object goes out of 
scope or is deleted.  In VFP, there is a Destroy() method to simulate this 
behavior.

In VFP, there is the notion of Public, Private, and Hidden properties.  PHP 
does not yet support this behavior.  In PHP, especially since it is such a 
loosely typed language, you can add and remove properties on the 
fly.  Generally when programming in PHP, I like to identify private 
properties and methods by placing a single underscore before their 
name.  This makes it clear for someone using the class not to ever 
reference these entities.

If you want to see a neat example of object oriented programming in action 
(not that I like M$ or anything), check out how the Microsoft Foundation 
Classes (MFC) work.  They effectively demonstrate public and private class 
members, inheritance, constructors, destructors, parent objects, etc...

Hope it Helped...

-Jason Garber
IonZoft.com






At 09:10 AM 11/25/2001 -0400, Miles Thompson wrote:
Chris,

Not such a useless explanation at all, in fact a damned good one. Tight  
concise, and you immediately related the functions to code examples, along 
with an easy-to-visualize object, the chair.

But I have two questions:

1. Why is a constructor class needed? My OO background is Visual FoxPro, 
and all it requires is a declaration of  the class, it' methods and properties.

2. Are the chairs properties exposed, or are they private? You use 
functions to both set and retrieve them, which implies that they are 
private.  Even so, PHP's syntax is much cleaner than the tortured syntax 
used in VB.

Miles Thompson

At 03:28 AM 11/25/2001 -0800, you wrote:
On Sun, 25 Nov 2001, Rudi Ahlers wrote:
  Can anyone explain classes to me please? On many sites have I seen 
 classes,

There are people earning PHD's while explaining classes.  I know your
question originates from using PHP, and this is a PHP general mailing list
... but your question is just a tad too general for this list.

  I'm not sure how these work, or how to use them. I'm still learning about

Classes aren't unique to PHP.  You need to learn a true object-oriented
programming language (C++, Java, ... etc.) to really learn classes.
Truly gifted individuals can learn object-oriented programming w/o too
much help, but they'd first have a firm grip on programming.  I'd expect
the average, novice programmer to need a good amount of help learning 
understanding objecte-oriented programming ...  like that attained from a
University, a good High School, or a lot of independent study and time
experimenting with code.

That said ...

You weren't completely missing the boat with your analogy of a class to a
variable, but in the same breath, that idea is totally missing the boat (I
can see from where you're coming, and to where you're headed).  Classes
are an IDEA.  They're not actually anything.  They're the definition of
private and public data members and methods that should make up an object.
When a class is instantiated, an object is created with the defined data
members and methods available.  You can then use the objects' methods to
set, get, alter, or otherwise interact with its data members, or to simply
perform a set of related operations.  Insert a couple semesters of theory
here. That's my feeble attempt to explain classes.  It's abstract, I
know, and possibly not a help at all.  But it's because of the paragraph
above this one.

Let's look at some petty code:

class chair{
 // DATA
 var num_legs;
 var color;
 var num_arms;

 // METHODS
 function chair( $legs = 3, $arms = 0 ){ //CONSTRUCTOR
 $this-num_legs = $legs;
 $this-num_arms = $arms;
 }

 function setLegs( $legs ){
 $this-num_legs = $legs;
 return;
 }
 function getLegs( ){
 return $this-num_legs;
 }

 // ... *clip* ...
}


Above is the [incomplete] definition of a chair class.  As you can see,
the class is useless.  But you can instantiate the class, and create a
useable object ... you can now create a chair.

$myChair = new chair( 4, 2 );

Now I have a chair [object] with 4 legs and 2 arms, called $myChair.
Let's have the chair tell us how many legs it has ...

$numLegsOnMyChair = $myChair-getLegs();
print( My Chair has $numLegsOnMyChair legs. );

Lets change how many legs the chair has ...

$myChair-setLegs( 7 ); // very odd, seven-legged chair

We should have a chair with 7 legs now, instead of 4.  

RE: [PHP] EXAMPLE: Redirect upon execution of script...

2001-11-25 Thread Jason G.

Doing this is very simple, although a pain in the rear...

For those of you that have any confusion on this issue, pay very close 
attention to this script.  It effectivly demonstrates how to deal with a 
form, and display intellegent errors WITHOUT any of that ...Please click 
your browsers back button... crap.

Have a hidden field in your form - ACTION=SAVE
This will tell your script when to look for input.

Write your script like this

?

//Make sure your ID is of int type.
//If ID  0 then you are in UPDATE mode.  if ID == 0 then you are in INSERT 
MODE
$ID = intval($ID);

//The main reason that I use a switch instead of an IF is that you can 
break out at any time.
switch($ACTION) case 'SAVE':
{
 //Validate all fields here
 if(empty($field1)) $oErr-field1 = 'Required';
 if(empty($field2)) $oErr-field2 = 'Required';

 //If the variable $oErr is set, then break
 if(isset($oErr)) break;

 //We are okay, add slashes to all fields...
 $field1 = addslashes($field1);
 $field2 = addslashes($field2);

 if($ID)
 {   //UPDATE MODE
 $sQuery = UPDATE table SET field1='field1', 
field2='field2 WHERE id=$ID;

 //Do the UPDATE query here (however you do that)
 }
 else
 {   //INSERT MODE
 $sQuery = INSERT INTO table VALUES ('field1', 'field2');

 //Do the INSERT query here (however you do that)

 //Grab the newly inserted ID
 $ID = mysql_insery_id();
 }

 //We have success, Do the redirect here
 header(Location: http://www.yourdomain.com/nextscript.php?ID=$ID;);
 exit;
}

?

html
body
   form name=frmInput action=?= $PHP_SELF ? method=post
  input type=hidden name=ACTION value=SAVE
  input type=hidden name=ID value=?= $ID ?

  Field 1: ? if(isset($oErr-field1)) echo($oErr-field1); ?br
  input type=text name=field1 value=?= addslashes($field1) ?
  Field 2: ? if(isset($oErr-field2)) echo($oErr-field2); ?br
  input type=text name=field2 value=?= addslashes($field2) ?

   /form
/body
/html

**

At 06:24 PM 11/25/2001 +0100, Daniel Alsén wrote:
  2. User fills in a form, clicks submit which calls the same script,
  passing itself the values. Depending on the value passed by the submit
  button, the script processes the information (INSERT or UPDATE) and sets
  $done = 1 if successful.
 
  The second scenario is easier to handle.
  Call the same script, passing it $done, and depending on whether or not
  $done is set you redirect.
 
  Juli Meloni has done an excellent tutorial on just this at
  http://www.thickbook.com. look in the tutorials for something like Form
  With Error Message. You just have to adapt the logic to suit your needs.

The second scenario is correct. I am actually already using the method in
Melonis tutorial for error messages. But i can´t do a redirection that way
since $done isn´t set until after the db INSERT. My if-statement for the
header is at the top of the page (wich is the only place i can put it) and
will never know if $done is set or not below.

- Daniel


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Send an e-mail witdh php

2001-11-22 Thread Jason G.

Also, If you have an array of addresses, use the implode() function.

$sAddressList = implode(',', $aAddressArray);

and then use that with the Bcc: header in the mail function.

-Jason Garber
IonZoft.com



Hi Henk,

You don't need a special class, just use:

$to = [EMAIL PROTECTED];
$subject = Your Subject;
$messages = some text you want to send...;
$headers = CC: firstname[EMAIL PROTECTED], [EMAIL PROTECTED],;
$headers .= [EMAIL PROTECTED]\n;
$headers .= From: Your name[EMAIL PROTECTED]\n;

mail ($to, $subject, $message , $headers);

Best,
Sebastian
At 01:50 PM 11/22/2001 +0100, Sebastian Wenleder wrote:
Hello,

I want to send an e-mail to one address(To) and many carbon copies to many
e-mailadresses(BCC).

Is there a class to do this??

Henk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Check contents of variable

2001-11-20 Thread Jason G.

You could also try:

if(! ereg('^http://', $url))
 $url = 'http://' . $url;

-JAson Garber



At 11:15 PM 11/20/2001 +0100, Daniel Alsén wrote:
  How about:
 
  if (substr($url,0,7)  http://;)
  $url = http://; . $url;

Thanks!

That´s just the function i am looking for. I looked it up in the manual.
Correct me if i am wrong - if i don´t set the second parameter in substr it
just continues to read until the variable is finished? If i set it to 7 (as
above) it stops reading after 7 characters?

- Daniel


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Cookies and Variables

2001-11-20 Thread Jason G.

Keep it mind that EGPCS is in that order for a reason. Changing it can open 
up security problems...

-JAson Garbr


At 01:16 PM 11/20/2001 -0800, Fred wrote:
If you want certain variables to over ride cookie variables you need to
change the setting of the variables_order directive in php.ini:

variables_order string
Set the order of the EGPCS (Environment, GET, POST, Cookie, Server) variable
parsing. The default setting of this directive is EGPCS. Setting this to
GP, for example, will cause PHP to completely ignore environment
variables, cookies and server variables, and to overwrite any GET method
variables with POST-method variables of the same name.

Fred

Richard S. Crawford [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Consider this code, in page1.php:

?php
  setcookie(someWord,I am a cookie);
?

...and this code, in page2.php:

?php
  setcookie(someWord,$someWord);
  print (someWord says: $someWord);
  $someWord = I am a variable;
  print ( a href=\page2.php?someWord=$someWord\ Click here /a
 );
?

(In the actual code, the value of $someWord is passed via POST through a
form, but the principle is the same.)

The first time I load page2.php, the output should be:

  someWord says: I am a cookie

Which, of course, works perfectly.

But each subsequent time I load page2.php, I want the output to be:

  someWord says: I am a variable

and then set the value of the cookie someWord to I am a variable.

But that's not what happens.  Everytime I load page2.php, someWord tells me
that it is a cookie.

How do I get the value of the variable to override the value of the cookie?




Sliante,
Richard S. Crawford

http://www.mossroot.com
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
MSN: [EMAIL PROTECTED]

It is only with the heart that we see rightly; what is essential is
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] extract() question

2001-11-19 Thread Jason G.

I needed this once, but I could not figure out how to just create the vars 
in current scope.

If my_extract() is called from within a function, then the variables will 
not be available unless you declare them global (which kinda makes the 
function pointless).

Any ideas?

-Jason Garber
IonZoft.com


At 06:55 PM 11/18/2001 -0500, Joe Stump wrote:
You may want to do something like this instead:

?

   function my_extract($arr)
   {
 if(is_array($arr)  sizeof($arr))
 {
   while(list($key,$val) = each($arr)
   {
 $new_var = str_replace(' ','_',$key);
 global $$new_var;
 $$new_var = $val;
   }
 }
   }

?

--Joe


On Sun, Nov 18, 2001 at 04:21:46PM -0500, David Bernier wrote:
  There is this array which I would like to convert into a series 
 variables using the extract function:
 
  ?
  $oz = array(
   lion = courage,
   dorothy = kansas,
   scarecrow = brain
   tin man = heart);
 
  extract($oz);
  ?
 
  now, I would like to access my new variables. it is obviously easy for 
 $lion, $dorothy, and $scarecrow but it isn't for tin man.
 
  from this, I have 3 or 4 questions:
  1) has $oz[tin man] been passed into a variable?
  2) if yes, how do I access the variable that came out of $oz[tin man]?
  3) let's pretend that I have no control over the names of the keys for 
 $oz, how should I have called extract() to tell it to replace the space 
 between tin and man by a underscore character?
  4)  finally, is there a way to access and retrieve that values of the 
 symbol table without knowing their names?
 
  David
 

Joe Stump [EMAIL PROTECTED]

How would this sentence be different if pi equaled 3?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Detecting IP address

2001-11-19 Thread Jason G.

Use the $HTTP_SERVER_VARS['REMOTE_IP'] variable...

At 01:58 AM 11/19/2001 -0800, Heidi Belal wrote:
Does anyone have any idea how i can detect a clients
IP address?  I've found javascripts on the net but
they only work on netscape and only when java is
enabled.  I need it to work on IE.
Thanks!
Heidi

=
Heidi Belal
ICQ# 32127109

A bus stops at a bus station.
A train stops at a train station.  On my desk
I have a work station...

__
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to create and run background process at Win2K

2001-11-19 Thread Jason G.

I believe that there is something like crontab for windows...  If not, then 
you could write one in C or C++ or VB etc...

 From apache/mod_php, set a marker in a file, or in a db.

Every minute, or 5 minutes, or 15 minutes (you decide), your crontab 
equivalent will call a cgi/php script that checks for the marker in the 
file/db.  If the marker is there, then remove the marker, and generate the 
report.

Hope it helps.

-Jason Garber
IonZoft.com

At 12:00 PM 11/19/2001 +0800, Chris Lee wrote:
Dear John,

Actually I need to generate an report which need an half an hour to
complete.
The MS Proxy Server time out for the long process, so I want to create the
report by following method:

apache/mod_php - call cgi/php - email notify end user when completed.

Regards,
Chris Lee


  -Original Message-
  From: John Monfort [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 19, 2001 11:38 AM
  To: Chris Lee
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] How to create and run background process at Win2K
 
 
 
 
  You can run the application as a SERVICE.
  Would that do the trick?
 
 
  __John Monfort_
  _+---+_
   P E P I E  D E S I G N S
 www.pepiedesigns.com
  The world is waiting, are you ready?
  -+___+-
 
  On Mon, 19 Nov 2001, Chris Lee wrote:
 
   Hi,
  
   It is possible to create/run background process at Win2K / Apache
   environment? If yes, how?
  
   Regards,
   Chris Lee
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
  
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Valid Chars Function

2001-11-19 Thread Jason G.

Well, you can make good use of regular expressions, or write your own function.
(It turns out i needed the functions, so I just wrote them, and included 
them here)


**
//This regex checks for  1 letters in a string - anything else will fail
if(ereg('^[a-z|A-Z]+$', $sName))
 echo 'Valid';
else
 echo 'Invalid';
**
//Returns TRUE if all characters in sString are found in sValidChars
function ValidChars($sValidChars, $sString)
{
 $len = strlen($sString);
 for($i=0; $i$len; $i++)
 if(strpos($sValidChars,$sString[$i])===FALSE)
 return FALSE;
 return TRUE;
}
**
//Returns TRUE if none characters in sString are found in sValidChars
function InvalidChars($sValidChars, $sString)
{
 $len = strlen($sString);
 for($i=0; $i$len; $i++)
 if(strpos($sValidChars,$sString[$i]))
 return FALSE;
 return TRUE;
}
**

-Jason Garber
IonZoft.com





At 01:28 AM 11/19/2001 -0600, phantom wrote:
Anyone know a good PHP function or script to scan a string for Valid
Characters to make sure something that is not allow is not included in a
form?

$Name = #@@##@!#!@ would not be a valid alphabetical name, how do I
scan for that in PHP?  Thanks.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Segmented Code/HTML VS. ECHO??

2001-11-19 Thread Jason G.

We are not writing in perl...

Php offers a very handy feature, the ability to go in and out of html/php 
code by just using ?  ? and the ability to echo data by using ?= $var ?

Seperate as much of your HTML from your PHP as possible.  It will assist in 
readability, and
maintenance.

---
?php
 $color = #FFCC00;
 $name  = Yogi;
?
font color=?= $color ?The bear is ?= $name ?./font
---

-Jason Garber
IonZoft.com




At 05:36 PM 11/18/2001 -0800, you wrote:
I _hate_ echo'n out big batches of HTML, so I never do it.  I prefer to
include HTML, or have a class or function write HTML.  However, printing
in heredoc style is very handy ... more so than sliced bread.

For example:

?php
 $color = #FFCC00;
 $name  = Yogi;

 print EOF
 font color=${color}The bear is ${name}./font
 !-- this can be as much plain HTML intermixed with PHP
  variables as you like --
EOF;
 print( date() );
?

PHP code, followed by plain HTML (I put in some PHP variables, but they
aren't necessary) (without a bunch of echo/print calls, or having to
escape quotes), followed by more PHP ... wash, rinse, repeat as much as
necessary ... you get the picture.  It works out rather nicely.

 $0.02
 ~Chris   /\
  \ / September 11, 2001
   X  We Are All New Yorkers
  / \ rm -rf /bin/laden

On Sun, 18 Nov 2001, Brad Melendy wrote:

  Hello,
  Other than the fact that sometimes, you just can't get raw HTML to process
  properly by dropping out of PHP code, what are the pros and cons of using
  RAW HTML or just ECHOING everything in PHP?  Thanks for any insights.
 
  ..Brad
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Adding *another* person to an e-mail *to:* address

2001-11-19 Thread Jason G.

Bcc: [EMAIL PROTECTED],[EMAIL PROTECTED]
Or
Cc: [EMAIL PROTECTED],[EMAIL PROTECTED]
Or
To: [EMAIL PROTECTED],[EMAIL PROTECTED]

Put a comma between email addresses.

-Jason Garber
IonZoft.com


At 01:00 PM 11/19/2001 -0600, Anthony Ritter wrote:
Hi,
Thanks to all that helped me out yesterday.

I'm using PHP with Apache on a MS Windows 98 box.

I would like to include a cc to another e-mail adresss when sending an
e-mail.

In addition I would like to *receive* and *also have the cc person receive*
this e-mail as well.

Right now, I am receiving an e-mail but not the other person using the
following script.

Using the variable and concatating the string to read:

$to.=[EMAIL PROTECTED];

does not seem to work.

How do I go about configuring this script so that both of us - the *to*
person and the *cc* person can recieve the same e-mail?

The script:



?
$msg=Email sent from WWW site;
$msg.=Sender's name:\t$sender_name\n;
$msg.=Sender's email address:\t$sender_email\n;
$msg.=Message:\t$message\n\n;
$to=[EMAIL PROTECTED];
$other_email = [EMAIL PROTECTED];
$subject=Web Site Feedback;
$mailheaders=From: My Website\n;
$mailheaders.=Cc: $other_email\n;
$mailheaders.=Reply to: $sender_email\n;
mail($to,$subject,$msg,$mailheaders);
?
..

In the above script:
I received an e-mail but *not* the cc person - Linda.

However, when I hit reply to that e-mail, both:

[EMAIL PROTECTED]
and
[EMAIL PROTECTED]

showed up with Linda's as the cc.

O.K. That's half the riddle.

I'm trying to have both myself *and Linda* receive
an e-mail...not just me.

So I tried the following script by concatating the string
$to
...


?
$msg=Email sent from WWW site;
$msg.=Sender's name:\t$sender_name\n;
$msg.=Sender's email address:\t$sender_email\n;
$msg.=Message:\t$message\n\n;
mailto:$to=[EMAIL PROTECTED];;
$to.=[EMAIL PROTECTED];
$other_email = [EMAIL PROTECTED];
$subject=Web Site Feedback;
$mailheaders=From: My Website\n;
$mailheaders.=Cc: $other_email\n;
$mailheaders.=Reply to: $sender_email\n;
mail($to,$subject,$msg,$mailheaders);
?

Simple Feedback Form

The following email has been sent:



Your Name:
? echo $sender_name; ?

Your email address:
? echo $sender_email; ?

Message:
? echo $message; ?
.

And after using *that* script neither of us receive an e-mail except that it
gets bounced back as:

[EMAIL PROTECTED]

So, it seems that somewhere the string in

$to

is getting fouled up.

Any ideas?

Many thanks for your time and help.

Kindest regards,
Tony Ritter








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] Difference of queries in PHP/mySQL?

2001-11-18 Thread Jason G.

Check the return value of mysql_query().  It should either evaluate to 
false, or true.  If false, then output some error messages using 
mysql_error() and mysql_errno().

-JasonGarber
IonZoftDotCom

At 01:29 PM 11/17/2001 -0500, Jeff Lewis wrote:
I am wondering if there are any difference between using PHP and using the
command line for mySQL.  Entering this at the comman line returns all the
membergroups properly.  When I use this in my PHP program, it doesn't
continue past this line:

$request = mysql_query(SELECT membergroup FROM membergroups WHERE 1 ORDER
BY ID_GROUP);


Jeff


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Question on variable variables

2001-11-17 Thread Jason G.

It seems to me that the use of a temp variable may be the clearest 
solution, and I doubt any overhead would matter really.

$a = dog;
$tmp = MY.$a; //$tmp = MYdog;

So the following two would be the same:
$$tmp = Spot;
$MYdog = Spot;

Good Luck,

Jason Garber
IonZoft.com

At 09:47 PM 11/16/2001 -0500, Jeff Lewis wrote:
I've a question regarding variable variable I was hoping someone could 
help me with:

All the examples in the manual have the entire variable name being 
variable e.g.
$a = hello   and
$$a being the same as $hello

What I need to do, however, is append a variable portion to a constant 
prefix.  So I have a set of variables that are named $MYdog, $MYcat etc. 
and I need to do

$a = dog
${MY$a} being the same as $MYdog

Can this be done, and if so - how? I can't get it to work.

Jeff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Advantages of php

2001-11-17 Thread Jason G.

You could check the list archives...  This question flys by every week or 
two...

-Jason Garber
IonZoft.com

At 01:41 PM 11/17/2001 +0530, Adrian D'Costa wrote:
Hi,

Is there somewhere on the PHP site that give a list of advantages, speed,
etc in comparsion with other similar programs.  I have a client that is in
ASP and would like to move to PHP and need this info.

Thanks

Adrian


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] array_unique() workaround? SOLUTION!

2001-11-14 Thread Jason G.

it seems that...

$newarray = array()
foreach($oldarray as $key = $value)
 if(! isset($newarray[$key]))
 $newarray[$key] = $value;

-JAson Garber
IonZOft.com

At 10:42 AM 11/14/2001 +0100, Spunk S. Spunk III wrote:
Thanks everyone for the ideas,
Here's what I came up with...
I forgot to mention that I needed to preserve the original array's keys.
Here is a replacement I wrote that seems to work. Let me know if you see
errors in it or have improvements.

function my_array_unique($somearray)
{
 asort($somearray);
 reset($somearray);
 $currentarrayvar = current($somearray);
 foreach ($somearray as $key=$var)
 {
 if (next($somearray) != $currentarrayvar)
 {
 $uniquearray[$key] = $currentarrayvar;
 $currentarrayvar = current($somearray);
 }
 }
 reset($uniquearray);
 return $uniquearray;
}


 
  I'm working on a script that needs array_unique() but my host is using 
 4.0.4
  and it's broken in that build. Does anyone have a good workaround for this?
  I can wait for my host to upgrade but if I release this code, it would be
  better to have the workaround...
 
  I just need a good way to check for dups in an array and remove them. I
  can't get my brain around it...
 
  TIA
  Spunk
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Can If Else statements be split into code blocks??

2001-11-14 Thread Jason G.

try this..

?
if(true)
{
 ?
 Raw html code here for
 as long as
 you want
 ?
}
else
{
 ?
 More
 Raw
 Html
 Code
 Here
 ?
}


I believe that this feature is way underutilized by php developers.  Tying 
all your html up in echo or print statements is a mess to say the least.

-Jason Garber
IonZoft.com


At 05:13 PM 11/13/2001 -0800, Brad Melendy wrote:
Ok, I figured out that just using echo seems to be the best way to do this
under PHP.  In ASP, you can end your code block and start in with HTML, but
I couldn't get that to work with PHP.  However, I was able to just use the
echo statement to get the conditional HTML I wanted to show up when the
proper condition was met in the If Else statement.

Brad

Brad Melendy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
  I'm trying to execute some HTML in an IF ELSE statement.  I'm trying
  something like:
 
  ?php
  if (strstr($DomResults,$Match))
  print Congratulations!  $domain.$suffix is available!;
  ?
  form method=POST action=step2.asp name=form2
pinput type=submit value=Register name=B1/p
  /form
 
  ?php
 else
  print Sorry, $domain.$suffix is already taken.;
  ?
 
  Basically, it works great without the form I'm trying to insert, but with
  the form after the IF statement, it fails.  Is what I want to do against
the
  rules?  I'm converting an ASP script I have to PHP and I have it all
working
  under ASP.  That means it should be eaiser with PHP right?  ;-)  Thanks in
  advance.
 
  ...Brad
 
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Regular Expression

2001-11-13 Thread Jason G.

I am just learning them, but I think something like this may be in order...
I know that you would use the | (or) operator.

if(! (ereg('^[a-z|A-Z|0-9|\-]+$', $fn)  (ereg('^[a-z|A-Z|0-9|\-]+$', $fs)))
{
 Either $fn or $sn failed the match
}

-Jason Garber
IonZoft.com



At 04:41 PM 11/13/2001 +0930, [EMAIL PROTECTED] wrote:
Hi All-

This is probably very simple for most of you.
I have the following statement

if ((ereg('[^([:alnum:]|\-)]',$fn)) || (ereg('[^([:alnum:]|\-)]',$sn))) {
// Do something here
}

What it's doing is checking two variables to make sure they contain only
alphanumeric
characters.

I have a requirement that hyphens (-) be allowed in $fn and $sn as well.
What do I need
to add to the regular expression to allow hyphens?

I know this is a relatively silly question. I plan on buying a book on
regular expressions
today and learning as much as I need to know about building them.

Cheers.

Regards,
Adam Whitehead
Systems Developer - Computer Support and Maintenance
Ph. (08) 8936 3164 ** Mobile (0411) 241 120
E-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Function Call Line Number

2001-11-13 Thread Jason G.

Hello,

Does anyone know of a way, that from within a function, you can determine 
what line number and file the function was called on?

I did try:
function myfunc($lineno = __LINE__)
{
echo $lineno;
}
but this just outputted the very line that __LINE__ resides on.

This would be very helpful in displaying sensible error messages, like the 
native php functions do.

Thanks,

-Jason Garber
IonZoft.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Checkboxes / Undefined Variables

2001-11-13 Thread Jason G.

your error reporting must be set to E_ALL.

a very simple way is:
$checkbox_3 = isset($checkbox_3);

Now, $checkbox_3 will be either TRUE or FALSE with no errors!

-Jason Garber
IonZoft.com

At 06:03 AM 11/14/2001 +, [EMAIL PROTECTED] wrote:
In am HTML form, checkboxes NOT checked are not passed
to the PHP script called by the form.

Therefore, if $name_of_chechbox_3 is not passed but it's
used in the PHP script, it results in Warning:
Undefined Variable.

How can I avoid this?

Thanks!

A. F. Rodriguez
([EMAIL PROTECTED])

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Question....

2001-11-12 Thread Jason G.

try .mysite.com

-Jason Garber

At 12:07 PM 11/13/2001 +1100, Chris Kay wrote:

I have a simple question that bugging me..

I have a site which I am designing with users auth, I have decided to use
cookies as I need to store variables after the user leave the site..

Problem I am having is the domain I set it on,

If the user logs into http://www.mysite.com and later logs into
http://mysite.com without the www the cookie will not work..

Is this because I am setting the domain wrong?

I have tried

 .mysite.com
 mysite.com
 $HTTP_HOST
 

Is some1 able to point me in the right direction



  Chris Kay - Tech Support - IDEAL Internet
email: [EMAIL PROTECTED] phone: +61 2 4628  fax: +61 2 4628 8890


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Am i crazy?

2001-11-04 Thread Jason G.

Try putting exit; right after the header() function...

-JAson Garber
IonZoft.com

At 06:54 PM 11/4/2001 +0100, Martin wrote:
Jack Dempsey wrote:

  you're assigning, not checking for equality...use two ='s

Still not redirecting ...

Martin S

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mail and mime and attachments

2001-11-03 Thread Jason G.

I tried and tried.  I finally got it to work (multipart/alternative) after 
reading the rfc.  Read RFC 1521 at 
http://www.faqs.org/rfcs/rfc1521.html.  Look at section 7.2.2.  It will 
tell you all you need to know.

By the way everyone, from faqs.org, WHICH I AM SURE MOST OF YOU USE TIME TO 
TIME...

If something is not done VERY, VERY shortly, FAQS.org will have to be 
shutdown. FAQS.org has lost its funding and I cannot personally pay for the 
bandwidth needed to keep it operational.  The care and feeding is not a 
problem, paying for the bandwidth is.  I will shortly have none unless you 
can help

If you can, take a look at www.faqs.org and see if there is anything you 
can do.

-Jason Garber
IonZoft.com
At 12:30 AM 11/3/2001 +0100, you wrote:
Hi,

I've read all docs on how to send multiple attachments with mime headers...

But all I get is the headers in plain text in the resulting e-mail!

No attachments at all!

Could anyone give me short working example please...

Thanks,

Simon.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Can you AUTO Post/Submit on a mixed HTML/PHP form

2001-11-01 Thread Jason G.

Just a thought...

Check out crescent internet toolkit by Progress Software.  It has a control 
for VB that lets you post data to a script, rather than relying on an HTML 
form...

Can you just use a query string?  you may have to code your own urlencode() 
function in VB, but that may be an option.

Maybe you can invoke cURL from vb.  It's free, but I do not know if it has 
a Win32 version.

Hope it helps.
-Jason Garber
IonZoft.com


At 11:01 AM 11/1/2001 +, Arf wrote:
Like the heredoc thanx for that...

The way that I am using VB will not support the VBscript option
unfortunately but a good suggestion.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Uncertainties about MySQL commands

2001-11-01 Thread Jason G.

Regarding your mysql_insert_id() function:

I believe that it works on a connection by connection basis.  Therefore, if 
you execute an insert, and then call that function, you are guarenteed to 
have the correct ID.  Look up the LAST_INSERT_ID() function in the MySQL 
manual on www.mysql.com for more information.

-Jason Garber
IonZoft.com


At 09:22 PM 11/1/2001 +0100, TD - Sales International Holland B.V. wrote:
Hey list, i'm new to php so bare with me...

got some questions on mysql commands. I'd like to know how the
mysql_insert_id() function works exactly.
First of all how reliable is it? What happens this happens:
Table: (ID int unsigned primary key auto_increment, Stuff text, MoreStuff
text)
(my script)
insert into table values(NULL, bla, bla)
(some other application)
insert into table values(NULL, bleh, bleh)
(my script)
$id = mysql_insert_id

it's not likely that this will happen, but if the site is very/extremely
crowded it could be that there's an insert right after mine but before me
callind mysql_insert_id. As you might guess I'd like to know which ID will be
returned, the one my script created or the one from the other application?

Also what happens if my table is like this:
Table: (Stuff text, ID int unsigned primary key auto_increment, OtherStuff
text)
Thus having the ID on column 2 instead of 1
or like this
Table: (Bla int unsigned primary key auto_increment, Stuff text, Otherstuff
text)
Thus the ID not having the name ID
Or like this
Table: (bla int unsigned primary key auto_increment, id int unsigned primary
key auto_increment, stuff text, otherstuff text)
Thus having 2 auto_increment columns where the 2nd one is called ID (lower
case).

I'm really uncertain about that and couldn't find it back in the manual
does it only read the first column? does this column have to be named ID,
what if ID is another column? what if there is more than 1 auto_increment
column in the table? what happens if some(one)/(thing) else inserts before
calling mysql_insert_id.

One more question (pure curiosity this one) the return value from
mysql_query... is that ever gonna be higher than 1? I assume it can be if the
insert affects more than 1 line right? Also my book says that the return
value is TRUE or FALSE for every command except for an INSERT in which case
it would be 0 on failure and higher on succes. I think that's crap? I'm
guessing it will also return a number for UPDATE's and REPLACE's is that
correct? Are there others?

OK just one more thing, this is for the people from troutworks if they're
monitoring this list. I think the translation of the PHP Bible is
crap! Please complain about it at the translator. The guy/girl
managed to translate (quotes)  to (comma's) , and there are a lot of other
wrongly translated things in there, luckily the examples in there got me on
the right path again over and over showing that the translation was incorrect
but it's just confusing like hell. The number of mistakes is unbelievable
(and i'm NOT talking about spelling errors, I'm talking about messy stuff
like calling quotes comma's) and I'm 100% certain it was NOT translated by a
programmer

regards

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] show png in the browser

2001-10-31 Thread Jason G.

Ever consider reading the online manual?


First, say header(Content-type: image/png);
Second, create image.
third use ImagePNG() function
fourth, destroy image.
fifth, go directly to the php script that generates the image, then you 
will see PHP generated errors.

-Jason Garber
IonZoft.com

At 12:38 AM 10/31/2001 +, Luz Lopez wrote:
Hi All

I configured the php with thelibrary GD, zlib, jpeg and libpng, I hae a 
program that generate a image, I can to save this png image but in my 
borwser I can't to see this image, the browser send me to save to my hard 
disk this image.

I need to show this image in the browser, How can I do it?

Thanks in Advanced,

Regards,

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] question about variables...

2001-10-31 Thread Jason G.

READ THE MANUAL.

variable variables

$i=1;
$sName = seat$i;
$value = $$sName;


At 04:40 PM 10/31/2001 +1100, sc wrote:
Hey all;

If i have a variable say, $seat and i want to go through variables with a
number, ie. $seat1 , $seat2 etc. how would i go about it? i have one setup
where $p increments (so then you have $seat$p) but i cant get it to work
properly (tried all sorts of combinations with ' and  and . etc.)...and
cant seem to find any info on it (dont really know what to search for)..

Anyone know how one can go about it?

thx.

-sc



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] defending PHP mail function

2001-10-31 Thread Jason G.

I've just been watching the posts regarding this issue.

I can see the following:

You SHOULD test it on *nix JUST to narrow down the problem.
You ask for help from all the *VERY NICE* people on this list, and then 
WILL not do what they say will help???
If you do not like the php smtp implementation, then read RFC821 and 
implement a better one.

Regards,

-Jason Garber
IonZoft.com





At 12:08 PM 10/31/2001 -0500, Matthew Luchak wrote:

OK.  here's why I think it's in PHP's SMTP support:

There is an address that fails in 4.06 yet functions in 4.04 - exactly
the same code, same SMTP server, same .ini,  everything the same.

I wouldn't question the class if I hadn't tested my own code and
settings first.  I've been trying to track this down for the past two
weeks and have already been advised by someone on this list that PHP's
SMTP support is not the greatest:

 SMTP code in PHP is not good enough. It needs to be rewritten.
snip
 Yasuo Ohgaki


It doesn't do much good to test on a nix box because what I'm looking
for is a solution to a PHP/SMTP problem.



Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]


-Original Message-
From: Kurt Lieber [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 31, 2001 11:57 AM
To: PHP General List
Subject: Re: [PHP] defending PHP mail function


On Wednesday 31 October 2001 08:40 am, you wrote:

  for now it's PHP that's in question

AFAIK, this is the first I've ever heard of probelms with mail() not
sending
to perfectly valid email addresses.  Scalability issues and other
performance
problems, sure, but that's a different animal.

Given the number of people that use PHP (and use mail(), especially) I
would
certainly think this problem would have been reported before if it were
a
real bug.

So, to be blunt, you probably have a problem with your code, your SMTP
server, the way you've configured PHP, or something other than mail().
It's
easy to blame it on mail() and/or PHP, but I think you're barking up the

wrong tree.

Find a forgiving customer who reported the problem, ask for their help
in
troubleshooting it and then send some test emails from a completely
different
server, preferably on a *nix platform.  (not because *nix is better than

windows, but because *nix PHP doesn't use smtp for mail delivery)

--kurt

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] run php in commandline

2001-10-31 Thread Jason G.

I just did that tonight.

Lookup the predefined variables in the manual.

$argc gives a count of the arguments
$argv is an array of the arguments

Ex:
php -q myscript.php Apple Orange

$argc == 3
$argv[0] == 'php -q myscript.php' or something like that
$argv[1] == 'Apple'
$argv[2] == 'Orange'

-Jason Garber
IonZoft.com

At 03:12 AM 11/1/2001 +0800, JIM wrote:
hi all,
i want to know how i can feed a parameter into a php script in commandline?
eg.
php getdata.php apple orange

so, i want to get use of apple and orange...
any help pls!

jim





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session handling with cookies??

2001-10-30 Thread Jason G.

Set the expire date to be 0.  then the browser will delete them after the 
browser window is closed.

-Jason Garber
IonZoft.com

At 02:39 PM 10/29/2001 +0100, Andy wrote:
Hello,

I have developed a member login system with cookies. Now I have the prob,
that the session stayes existend when the browser is closed. This could
couse a problem in Internet caffes for example. As second thing, I have
realized, that it depends on the clients clock!! I am sending a cookie which
expires in time() + $expireseconds. Unfortunatelly the time command takes
the tim from the server and the cookie expires checking the client time.

So... does anybody know how...

1) I get the system to delete the cookie as soon as I leave the site, or
close it
2) How to work on the same time.

Thanx for any help


Cheers Andy



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Trouble with php generated images

2001-10-30 Thread Jason G.

Give ImagePNG a try...
-Jason Garber

At 10:22 PM 10/29/2001 -0800, costa wrote:
The text printed on this image looks sloppy and grainy. (This image is being
generated on a linux server RH 7.1, Apache 1.3.19, with GD 1.8)  I remember
seeing something about adjusting the quality of the image, but I can't find
it now, and even if I did, I don't know how much help it would be, because I
also recall seeing that it defaulted to 100. My question is this, is there a
way to generate a quality image or improve the quality of this image, or am
I stuck? As a side note, images that don't contain text seem to generate
very cleanly. Would it be possible to make the background transparent, like
a transparent gif?

-C

?php

### draw an image for the header and print some stuff on it.
###

## tell the browser what it is
header(Content-type: image/jpeg);

## draw a new image
$width = 600;
$height = 100;
$image = imagecreate($width, $height);

##make the background same as page
$backg = imagecolorallocate($image, 0, 51, 102);

##make the text white
$text = imagecolorallocate($image, 255, 255, 255);

imagefilledrectangle($image, 0, 0, $width, $height, $backg);
imagettftext($image, 30, 0, 200, 25, $text,

## now let's print some text to the image
/usr/share/fonts/ttf/GARAIT.TTF, foo);
imagettftext($image, 40, 0, 60, 75, $text,
/usr/share/fonts/ttf/GARAIT.TTF, some guy);

## off it goes
imagejpeg($image);

## cleanup
imagedestroy($image);

?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending two attachments

2001-10-29 Thread Jason G.

I believe one of your boundarys has -- at the end.  According to the RFC 
dealing with this subject, stick -- on the end of only the last boundary.

-Jason Garber
IonZoft.com








At 02:13 PM 10/12/2001 +0530, Sharat Hegde wrote:
Hello,

I am trying to send multiple attachments by email from my PHP program (two
to be precise).

I have put the relevant codes to send attachments, and separated it with the
Message Boundary. The first attachment comes fine. The second attachment is
also coming to my Inbox, but for some reason, Outlook Express (my mail
client) does not recognize the 2nd attachment. The message header and the
size of the email indicates that the content has two attachments.

Any clues?

The email looks like this after the standard headers for From and To:

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=Message-Boundary

This is a MIME encoded message.

--Message-Boundary
Content-Type: text/plain; charset=iso-8859-1

Testing mail component

--Message-Boundary
Content-Type: application/octet-stream; name=ValleyView1.csv
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=ValleyView1.csv

Um9vbUlkLFNlcmlhbE51bWJlcixEaXNwbGF5T3JkZXIsRGVzY3JpcHRpb24sUmF0ZVR5cGUsQWR1
bHRQcmljZSxDaGlsZFByaWNlLE51bURheXMsTWluUGVyc29ucyxNYXhQZXJzb25zLEFwcGxpY2Fi
bGVEYXlzClIwMDIsMiwxLERvdWJsZSAzIG5pZ2h0cyxWQUwsMjI1LjAwLDAuMDAsMywxLDIsIjAs
MSwyIgpSMDAyLDEsMixEb3VibGUgNCBuaWdodHMsVkFMLDI4MC4wMCwwLjAwLDQsMSwyLCIwLDEi
Cg==

--Message-Boundary--
Content-Type: application/octet-stream; name=junk.txt
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=junk.txt

SnVuayBUZXh0IEZpbGUKTGluZTIKTGluZTMK

--Message-Boundary--

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how do i give optional arguments to functions??

2001-10-25 Thread Jason G.

Umm...

function top($image = '')
{
 echo(bla bla $image bla);
}

Might need to use an IF (because of having 2 spaces if the image is empty)

-Jason Garber
IonZoft.com


At 10:14 AM 10/24/2001 -0700, Richard S. Crawford wrote:
function top ($image) {
 if ($image) echo blah blah blah;
 else echo blah blah $image blah;
}

There's probably a more efficient way to do it.


At 09:57 AM 10/24/2001, sunny AT wde wrote:
hi all!!

i'm writing functions like -
---
function top () {
  echo blah blah blah;}
---

what i want to do is make it so that i can do -
---
function top($image) {
  echo blah blah $image blah; }
---

but also make the $image parameter in the top() as optional. so if
its not there, then tell php not to worry about it.

any ideas??

thanks!

sunny


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Sliante,
Richard S. Crawford

http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
It is only with the heart that we see rightly; what is essential is 
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] OnUNload Scripts

2001-10-24 Thread Jason G.

It may be possible to do something of the following:

I know that on rollovers, Javascript can preload the images needed to 
rollover to...  Hmm...  Maybe you could have javascript load an image 
during the unload event with the image's src pointing to a php script...

-Jason Garber



At 04:51 PM 10/24/2001 +1000, Martin Towell wrote:
 From what I can tell, the only way you can execute a PHP script is to have
the browser request it. This means using the same window that the document
is being unloaded in, or opening a new window.

You could open a new window, give focus to the current window, and in the
new window, have it close itself after it's finished processing.

Hope this helps.
Martin

-Original Message-
From: Impex Holidays Maldives / Hasan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 4:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] OnUNload Scripts


Hi everyone,

I can use javascripts onunload to run PHP file with a new window.
Is there anyway i can run PHP script file on ONUNLOAD with out opening a new
window ( in the back ground).

Any one's help will be greatly appreciated.

Best regards,
Hasan



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Form Question

2001-10-22 Thread Jason G.

Chip,

I read all of the posts regarding this topic that I could find, and just 
*had* to reply.

(Take the TIME to look at this.  It is about the most Efficient, Powerful 
way I know of)

Do this!
__
?php

//If the hidden variable ACTION == DOIT then process the form
//This way, the form will not get processed the first time around...
if($ACTION=='DOIT')
{
   //Validate Form Here
   if(empty($txtNAME)) $oErr-txtNAME=Required;
   if(empty($txtADDRESS)) $oErr-txtADDRESS=Required;

   //if there is an error message, break out here
   if(isset($oErr)) break;

   //Save your form here...

   //All went ok...  Redirect to the next page...
   header(Location: nextpage.php);
   exit;
}

?
form name=frmMyForm method=post action=?php echo $PHP_SELF; ?
input type=hidden name=ACTION value=DOIT

?php echo($oErr-txtNAME); ?
input type=text name=txtNAME value=?php 
echo(htmlspecialchars($txtNAME));  ?

 *or*

?php1 if(isset($oErr-txtADDRESS)) echo($oErr-txtADDRESS); ?
input type=text name=txtADDRESS value=?php 
echo(htmlspecialchars($txtADDRESS));  ?

/form


-Jason Garber


At 03:49 PM 10/21/2001 -0400, Chip Landwehr wrote:
I got a form that a user fills out.  When they hit submit they are
transfered to a PHP page that verifies their data.  If a problem is found
(They forgot to enter an e-mail address) the PHP sends them back to the
original form with the field they forgot to fill out highlighted in red.
Unfortunately all there entries are wiped out and they have to re-enter
everything.  Any easy way to keep there original entries?




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: require include

2001-10-22 Thread Jason G.

 From the manual:

Unlike include(), require() will always read in the target file, even if 
the line it's on never executes. If you want to conditionally include a 
file, use include(). The conditional statement won't affect the require(). 
However, if the line on which the require() occurs is not executed, neither 
will any of the code in the target file be executed.

Similarly, looping structures do not affect the behaviour of require(). 
Although the code contained in the target file is still subject to the 
loop, the require() itself happens only once.





At 08:48 AM 10/23/2001 +0900, Yasuo Ohgaki wrote:
Jtjohnston wrote:

Coverting from perl ...
What's the differencw between require and include? Where, when, why?


I forgot from which version, but current PHP's require/include works the 
same way except

- require() raise fatal error, if it can't find file
- include() raise warning, if it can't find file


requrie_once()/include_once() works almost the same as require()/include() 
except they include file only once. (Hash table is used to determine if 
files are included or not)

See also get_{required|included}_files()

--
Yasuo Ohgaki


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] parsing a string

2001-10-18 Thread Jason G.

Why don't you do something like this:

servimg:name.jpg:This is the alt text Buddy

Then search for a regx something like servimg*  (I am not sure of the 
exact syntax).
Then parse the found tag, generate your img tag and replace the original 
tag with the generated tag.

I hope it gives you some good ideas.

-Jason Garber
IonZoft.com





At 12:11 PM 10/18/2001 -0400, John A. Grant wrote:
I'm reading some HTML text from a file and echoing it to
stdout. The HTML text contains IMG but I would rather
have the server do the work of looking up the image size.
I know how to lookup the image size with getimagesize().
My problem is in coming up with a good format for embedding
a reference to the image in the text and then writing the code
to parse it.

So instead of this:
 here is some text img src=bird.gif width=100 height=20
 alt=this is a bird and here is more text and another
 image img src=plane.gif width=123 height=23
 alt=this is a plane and more text

I would like to have something like this:
 here is some text [bird.gif,this is a bird] and here
 is more text and another image [plane.gif, this is a plane]
 and more text

Crossing line boundaries is not an issue - each text string
is complete. I need to be able to dump out the string until I
see a reference to an image, then extract the name and alt text,
handle it (by emitting IMG) and continue to echo text from
the string until I encounter another image reference.

My problem is in coming up with a syntax for this and then
to write the code to extract the information.

In the above example, I'm using the syntax:
 [filename,text]

but it's conceivable that the HTML text might also contain
 [some plain text not related to images]

so I thought about some of these:
 {filename,alt text} - not good, text might contain {plain text]
 @filename, alt text@
 img(filename,alt text)

Using the same @ delimiter at each end might make it easier
to use explode() to split the text.  But perhaps img(filename,text)
is more elegant, but it might need more skills than I have in using
regex to recognize it and extract it.  Also I need to figure out how
to extract and echo the plain text around it.

Any ideas are appreciated. Thanks.

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] formular multiple select trouble

2001-10-02 Thread Jason G.

Give the select tag an ID.  You can then reference the element by its ID.

select name=aname[] id=aname

javascript
 alert(aname.value);
/javascript

-Jason Garber
IonZoft.com


At 01:25 PM 10/2/2001 +0200, Sebastian wrote:
Hi all

If i use multiple select fields in a from
i use name[] to access it in php afterwards
select name=aname[] multiple
optiontest1/option
optiontest2/option
/select

i can then access in php $name and it has its the elements that were
selected.
my problem now is that i can't access name[] with javascript...
if i try
javascript
 alert(document.fo.neme[].value);
/javascript
gives an error...

is there another way to neme the seletc field?
if i use name=aname
then i only get one selected value in php.

thanks

sebastian


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Creating mailaccounts

2001-10-02 Thread Jason G.

Take a look at the exec() and system() functions.

-Jason Garber
www.ionzoft.com


At 08:55 PM 10/2/2001 +0200, Bjornie wrote:
Hi everybody!

I have a problem :/
I just said yes to a project, which includes webmail. I know how to send
mail and how to receive mail with imap, but can I in any way create a
mailaccount on the server by using PHP? Or should I use any other language
like Java/JSP or ASP (with a component)?`

Hilfe! :)



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Making variable global / accessing variable

2001-10-01 Thread Jason G.

You can see the below code in action at:
http://www.ionzoft.com/code/testing/globals.php

?
function CreateGlobals($td)
{
 $td = foo;

 $td_error = $td . _error;
 $td_ok = $td . _ok;

 global $$td_error;
 global $$td_ok;

 $$td_error = 'Error Message';
 $$td_ok = 'Ok Message';
}

//Just testing

echo 'Before Call to CreateGlobals()br';
echo '$foo_error = ', $foo_error, 'br';
echo '$foo_ok = ', $foo_ok, 'br';

echo 'br';
CreateGlobals(foo);
echo 'br';

echo 'After Call to CreateGlobals()br';
echo '$foo_error = ', $foo_error, 'br';
echo '$foo_ok = ', $foo_ok, 'br';

?



There is probably a better way to do this.
Check the docs on Variable Variables and the {} syntax.



At 10:01 PM 9/30/2001 -0700, Justin Garrett wrote:
But how would you use this to create new global variables with $td as the
prefix?

$td = foo;

then we want new global variables

$foo_error and $foo_ok created.

--
Justin Garrett

Jason G. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  function MyFunction($td)
  {
   global $$td;
   echo $$td; // echos 3
   $$td = 5;
  }
 
  $billybob = 3;
  MyFunction(billybob);
  file://Now $billybob = 5
 
  -Jason Garber
  IonZoft.com
 
  At 10:25 PM 9/30/2001 -0400, you wrote:
 
  I have used:
  
  global $$td;
  
  in the past with success...
  
  -Jason Garber
  IonZoft.com
  
  
  At 07:38 PM 9/30/2001 -0700, Justin Garrett wrote:
  Maybe something similar to this?
  
  function test($td){
  
   $global = global \$$td._error, \$$td._ok;;
   eval($global);
  
   $set = \$$td._error = \ERROR\; \$$td._ok = \OK\;;
   eval($set);
  }
  
  test(foo);
  echo $foo_error $foo_ok;
  
  --
  Justin Garrett
  
  Martin [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello!
   
How can I make a variable, which name I give to a function, global in
this function?
   
I want to make something like:
   
function MyFunc($sVarName)
{GLOBAL [$sVarName]_error, $sVarName_ok;

}
   
So if $sVarName = sHello, I want to access $sHello_error and
$sHello_ok in this function.
   
Any idea how I can make this variable gloabl and whats the easyst way
to
access this var then?
   
Martin
   
   
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
 
  At 10:25 PM 9/30/2001 -0400, Jason G. wrote:
 
  I have used:
  
  global $$td;
  
  in the past with success...
  
  -Jason Garber
  IonZoft.com
  
  
  At 07:38 PM 9/30/2001 -0700, Justin Garrett wrote:
  Maybe something similar to this?
  
  function test($td){
  
   $global = global \$$td._error, \$$td._ok;;
   eval($global);
  
   $set = \$$td._error = \ERROR\; \$$td._ok = \OK\;;
   eval($set);
  }
  
  test(foo);
  echo $foo_error $foo_ok;
  
  --
  Justin Garrett
  
  Martin [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello!
   
How can I make a variable, which name I give to a function, global in
this function?
   
I want to make something like:
   
function MyFunc($sVarName)
{GLOBAL [$sVarName]_error, $sVarName_ok;

}
   
So if $sVarName = sHello, I want to access $sHello_error and
$sHello_ok in this function.
   
Any idea how I can make this variable gloabl and whats the easyst way
to
access this var then?
   
Martin
   
   
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Making variable global / accessing variable

2001-09-30 Thread Jason G.


I have used:

global $$td;

in the past with success...

-Jason Garber
IonZoft.com


At 07:38 PM 9/30/2001 -0700, Justin Garrett wrote:
Maybe something similar to this?

function test($td){

 $global = global \$$td._error, \$$td._ok;;
 eval($global);

 $set = \$$td._error = \ERROR\; \$$td._ok = \OK\;;
 eval($set);
}

test(foo);
echo $foo_error $foo_ok;

--
Justin Garrett

Martin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello!
 
  How can I make a variable, which name I give to a function, global in
  this function?
 
  I want to make something like:
 
  function MyFunc($sVarName)
  {GLOBAL [$sVarName]_error, $sVarName_ok;
  
  }
 
  So if $sVarName = sHello, I want to access $sHello_error and
  $sHello_ok in this function.
 
  Any idea how I can make this variable gloabl and whats the easyst way to
  access this var then?
 
  Martin
 
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Making variable global / accessing variable

2001-09-30 Thread Jason G.


function MyFunction($td)
{
 global $$td;
 echo $$td; // echos 3
 $$td = 5;
}

$billybob = 3;
MyFunction(billybob);
//Now $billybob = 5

-Jason Garber
IonZoft.com

At 10:25 PM 9/30/2001 -0400, you wrote:

I have used:

global $$td;

in the past with success...

-Jason Garber
IonZoft.com


At 07:38 PM 9/30/2001 -0700, Justin Garrett wrote:
Maybe something similar to this?

function test($td){

 $global = global \$$td._error, \$$td._ok;;
 eval($global);

 $set = \$$td._error = \ERROR\; \$$td._ok = \OK\;;
 eval($set);
}

test(foo);
echo $foo_error $foo_ok;

--
Justin Garrett

Martin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello!
 
  How can I make a variable, which name I give to a function, global in
  this function?
 
  I want to make something like:
 
  function MyFunc($sVarName)
  {GLOBAL [$sVarName]_error, $sVarName_ok;
  
  }
 
  So if $sVarName = sHello, I want to access $sHello_error and
  $sHello_ok in this function.
 
  Any idea how I can make this variable gloabl and whats the easyst way to
  access this var then?
 
  Martin
 
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


At 10:25 PM 9/30/2001 -0400, Jason G. wrote:

I have used:

global $$td;

in the past with success...

-Jason Garber
IonZoft.com


At 07:38 PM 9/30/2001 -0700, Justin Garrett wrote:
Maybe something similar to this?

function test($td){

 $global = global \$$td._error, \$$td._ok;;
 eval($global);

 $set = \$$td._error = \ERROR\; \$$td._ok = \OK\;;
 eval($set);
}

test(foo);
echo $foo_error $foo_ok;

--
Justin Garrett

Martin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello!
 
  How can I make a variable, which name I give to a function, global in
  this function?
 
  I want to make something like:
 
  function MyFunc($sVarName)
  {GLOBAL [$sVarName]_error, $sVarName_ok;
  
  }
 
  So if $sVarName = sHello, I want to access $sHello_error and
  $sHello_ok in this function.
 
  Any idea how I can make this variable gloabl and whats the easyst way to
  access this var then?
 
  Martin
 
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql_fetch_array() doesn't work

2001-09-27 Thread Jason G.


echo a href='$PHP_SELF?offset=$i*$step' target='_top'

Missing end quote and semicolon on this line may be the reason...

Try properly indenting and formatting your code.  Also take advantage of 
going in and out of php mode to seperate your code from your display of 
content...
Ex:
instead of this:
? echo(td align=\center\ width=\$nWidth\$sContent/td); ?
Try this:
td align=center width=? echo($nWidth); ?? echo($sContent); ?/td
Or even this:
td align=center width=?=$nWidth??=$sContent?/td

It makes it MUCH easier to read and maintain, and seperates the PHP code 
from the HTML content as much as possible.

Any questions, please ask me.

-Jason Garber
Lead Programmer - www.pulseaday.com
[EMAIL PROTECTED]

---

At 12:48 PM 9/27/2001 +0800, you wrote:
System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98

When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]

What's the problem wiht mysql_fetch_array() or other?
What does the T_STRING' or `T_VARIABLE' or `T_NUM_STRING' mean?

THANKS
Mike


The full code below:


?
$link=mysql_connect(localhost,,);
if($link==false){
echo Failed linking to database.;
exit();
}
$handler=mysql_select_db(database1);
if($handler==false)
echo Failed linking to database.;
$query=selct count(*) from users where sign=1;
$res=mysql_query($query);
$row=mysql_fetch_row($res);
$all=$row[0];
$step=5;
$pages=ceil($all/$step);   /*the number of pages needed to listed */
if(empty($offset))
$offset=0;
$query=select user_id, user_name, time, status, comment from users
where sign=1
order by user_name
limit $offset, $step;
$res=mysql_query($query);
echo tabletd align=centerUser/td
td align=centerAdded time/tdtd align=centerStatus/td/tr;
$num=mysql_num_rows($res);
for($i=0; $i$num; $i++) {
$arr=mysql_fetch_array($res);   /* HERE is line where the error occurs!!!
*/
echo trtd align=centera href=\profile.php?id=$arr['user_id']\
target='_top'
$arr['user_name']/a/td;
echo td align=center$arr['time']/td;
echo td align=center$arr['status']/td/tr;
echo tr colspan=3td$arr['comment']/td/tr;
}

echo /tablebrbrbr;

echo tabletrtd align='center';  /* show others in multi-pages */
for($i=0; $i$pages; $i++){
echo a href='$PHP_SELF?offset=$i*$step' target='_top'
echo ($i+1)./a;
echo nbsp;nbsp;;
}
echo /td/tr/table;

?


-
create table users (
user_id int not null auto_increment primary key,
user_name varchar(30),
time datetime,
status tinyint(1),
comment text,
sign tinyint(1) default '1'
);







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] Does PHP + PHP CACHE can vs JSP ?

2001-09-27 Thread Jason G.

A good question is:  Do you REALLY need the speed difference, or should you 
be asking which is the best language to do Dynamic Web Development 
in???  Which is better supported, which is most cost effective, which is 
Open Source, which is Better...

-Jason Garber
deltacron.com

At 02:48 PM 9/27/2001 +0800, mydata wrote:
Hi,
I heard about JSP a lot recently though I doing PHP programing now.
somebody said jsp is most fastest in (asp , php , jsp).
I want to know if it is true . And if I use PHP + php cache , can I speed up
PHP as same as JSP as they said.

I just want to know which is the best solution ,(php + php cache) or jsp .



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] handling errors

2001-09-27 Thread Jason G.

Placing an @ symbol before the function name will suppress any errors.
@GetImageSize()

At 09:09 AM 9/27/2001 +0200, * RzE: wrote:
Original message
From: Joseph Bannon [EMAIL PROTECTED]
Date: Wed, Sep 26, 2001 at 11:09:39AM -0500
Message-ID: 
[EMAIL PROTECTED]
Subject: [PHP] handling errors

  How do I turn off the error messages that appear at the top of the page?  I
  have this function below that if an image is not there for $url, it give a
  warning.
 
  $size = GetImageSize($url);
 
 
 
  Example error message below...
 
  Warning: getimagesize: Unable to open 'http://www.yahoo.com' for reading.
  line 28
 
 
  Joseph

/Original message

Reply

Ofcourse it might just be a strange idea stuck in my head for some
reason, but you know what helps? Writing code that doesn't produce
any errors or warnings. Supressing warnings by just not showing them
doesn't really make your code very reliable does it?!

/Reply

--

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] array

2001-09-27 Thread Jason G.

check out the serialize() and unserialize() functions in the manual.

replace this:
print(A HREF=new_page?arr=$array sort /a);

with this
a href=new_page.php?arr=? echo(urlencode(serialize($array))); ? sort /a

Excerpt from the manual:
http://www.php.net/manual/en/function.serialize.php

If you are passing serialized data between pages in hidden form
fields (or in a query string), you need to serialize() the data,
then *urlencode()* it, then put it in the hidden field.
When you get to the next page, urldecode() it, then unserialize().

-Jason Garber
www.deltacron.com



At 11:15 PM 9/26/2001 +0200, you wrote:
Hi,

I have an array witch I display in my browser. Now I want to create a button
sort which sorts the array.

Problem is how to pass the array?
I tried:

print(A HREF=new_page?arr=$array sort /a);

I know I can reload the page and insert a function sort but it would be
stupid because the array has to be filled twice.

Any suggestions?

Thanks!





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] handling errors

2001-09-27 Thread Jason G.

You are completely right.  Do intensive error checking.  In thousands and 
thousands of lines of code, I think i only used @ in 3 places -  in the 
functions that connect to the database - I have more robust error checking 
in place.

-Jason Garber
deltacron.com

At 09:26 AM 9/27/2001 +0200, * RzE: wrote:
Original message
From: Jason G. [EMAIL PROTECTED]
Date: Thu, Sep 27, 2001 at 03:25:16AM -0400
Message-ID: [EMAIL PROTECTED]
Subject: Re: [PHP] handling errors

  Placing an @ symbol before the function name will suppress any errors.
  @GetImageSize()

/Original message

Reply

Yep, I know it does. Yet, it's still no good way of handling your
errors/warnings. Unless you made some real intensive errorchecking
yourself, you should not use that @-construction or lower the
errorreportinglevel. Reporting should be as high as possible
(E_ALL). And yes, indeed, it might then just be that you get a lot
of warnings (and/or errors). Then you have to fix your code, not
start using @ in order to supress them. Errors and warnings are not
reported without a reason you know. Even if your code works, when
there are warnings it can still happen that in some situation the
code will crash.

/Reply

--

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Accessing lots of variables

2001-09-25 Thread Jason G.

Try This...

for($i=1; $i=35; $i++)
{
$sVarName = link$i;

if(empty($$sVarName))
{
   //Do Something
}
else
{
   //Do Something Else using $$sVarName...
}
}


-Jason Garber
deltacron.com




At 01:42 PM 9/25/2001 -0400, Jordan Elver wrote:
Hi,
I'm feeling a bit stupid. I have a,load of variables coming from a MySQL
connection using list(). The variables are link1 to link 35 inclusive.

How can I access each of these variables, check if they are empty, then add
them to an array. I don't know how to access then inside a for loop. Can I
use $link and append the number on the end somehow?

Any help please,

Jord

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] A simple PHP form not working

2001-09-24 Thread Jason G.

First of all, you need to type

header(Location: thankyou.html);
exit;

Try that...

-Jason Garber
deltacron.com


At 09:26 AM 9/25/2001 +0600, Tshering Norbu wrote:
Hi list,
I can not get the form (from thesitewizard) working. When I submit the form,
I get this error: Warning: Failed to Connect in c:\Program Files\Apache
Group\Apache\htdocs/druknet/feedback/feedbacksend.php on line 2.  My PHP
conf with Apache has no problem. What am I doing wrong? Sorry, I am a
beginner in PHP.
Here are 2 php files:

feedback.html

Email:
Message:




feedbacksend.php

?php
mail([EMAIL PROTECTED], Feedback Form Results,$message, From:
$email);
(Location:thankyou.html);
?





Thanks.
NORBU



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Assistance Please - Two-Dimension Arrays

2001-09-22 Thread Jason G.

Mark,

PHP, at this point, does not support MultiDimension arrays.  However, you 
can get around this by placing array's inside arrays.

Thus:

$myarray[0] = array(element00, element01,element02);
$myarray[1] = array(element10, element11,element12);
$myarray[2] = array(element20, element21,element22);

You would refrence element11 by
$myarray[1][1];

Hope it helps!

-Jason Garber
deltacron.com


At 12:03 PM 9/23/2001 +0800, Mark van Proctor wrote:
I'm trying to fill information that i read out of files into a 2 dimensional
array.
My main problem (i think) is that i dont know how to declare a 2 dimensional
array prior to adding parts to it.
Especially since the size of each internal array and the external array are
all picked up from the files and read as strings - i'm not sure how to
convert these to ints.

I don't know how to test if the data is beign stored in the array because
when i come out of the entry loop, the count() size of the array is 0.

I'm very new at this so any help you can offer is greatly appreciated.

Thanks,

Mark



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Codes in PHP

2001-09-20 Thread Jason G.

Please only post a question ONCEE

PHP does all of it's work on the server, Going back to a previous page 
(without reloading it) is done by the Web Browser.

The only way I know of is maybe to have php generate an empty page that has:
html
body onLoad=javascript:history.go(-2);
/body
/html


At 03:49 PM 9/20/2001 -0400, Wee Chua wrote:
Hi all,
I know how to forward a page with PHP, but what if the page I want to
forward is the previous page or last page. In javascript, the code is like
javascript:historygo(-1). The reason why I want to go back to previous page
is because I don't want to lose any information on previous page. Can anyone
help? Thank you.

Calvin Chua

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Codes in PHP

2001-09-20 Thread Jason G.

Please only post a question ONCEE

PHP does all of it's work on the server, Going back to a previous page 
(without reloading it) is done by the Web Browser.

The only way I know of is maybe to have php generate an empty page html 
that has:
onLoad=javascript:history.go(-2); in the body tag


At 03:49 PM 9/20/2001 -0400, Wee Chua wrote:
Hi all,
I know how to forward a page with PHP, but what if the page I want to
forward is the previous page or last page. In javascript, the code is like
javascript:historygo(-1). The reason why I want to go back to previous page
is because I don't want to lose any information on previous page. Can anyone
help? Thank you.

Calvin Chua

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] simple question...

2001-09-20 Thread Jason G.

Well,

Here is a function that may be helpful.  The bad part is that I never 
finished it, so it only accepts dates in the MDY format...

http://www.deltacron.com/source/check_date.php

-Jason Garber
www.deltacron.com




At 08:56 PM 9/20/2001 -0700, you wrote:
ey guys.. how do i check if the postdata is a valid time format? something
like '2001-09-15'
I hate it when they'll be entering garbage in it...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] simple question...

2001-09-20 Thread Jason G.

Well,

Here is a function that may be helpful.  The bad part is that I never 
finished it, so it only accepts dates in the MDY format...

http://www.deltacron.com/source/check_date.php

BTW... If you already have a connection to MySQL, you could send simple 
queries to it to take advantage of its large amount of date 
functions.  This is probably not optimal though!

-Jason Garber
www.deltacron.com




At 08:56 PM 9/20/2001 -0700, you wrote:
ey guys.. how do i check if the postdata is a valid time format? something
like '2001-09-15'
I hate it when they'll be entering garbage in it...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Just for fun:

2001-09-20 Thread Jason G.

One of my largest is a function of a complete session management class that 
I wrote - 150 lines.  The class is ~ 450 lines.

When you find yourself writing HUGE functions, it may be better to split it 
into smaller, more clearly defined functions or classes and do it that way...

-Jason Garber
Lead Programmer - pulseaday.com


At 08:40 PM 9/20/2001 -0400, Matthew Loff wrote:


-Original Message-
From: Jason Bell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 20, 2001 8:32 PM
To: PHP Users
Subject: [PHP] Just for fun:


Here is a question, just for fun:

What is the biggest function (In terms of line count) you have ever
written?

I just finished one that is 100 lines long. That is by far my
biggest It's a script initialization function that sets up database
connectivity, creates all tables necessary for my script, and creates an
administrative user.

-Jason


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] string conversion

2001-09-20 Thread Jason G.

Andras,

$aRay = split('.', 'mypicture.jpg');

$aRay[0] will be the filename
$aRay[1] will be the extension

-Jason Garber
www.deltacron.com



At 03:14 PM 9/20/2001 -0700, Andras Kende wrote:
Hi,

I trying to cut the last 4 char of a string but sometimes its cut 3 sometime
4 char

$pic1=$amyrow[picture];
$pic2 = substr($pic1, 0, -4);

Actually I have some pictures where I need to cut off the extensions...

amamm.jpg
33.jpg
321.gif

to

amamm
33
321

Is any other way than substr to do this ??

Thanks

Andras


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] string conversion

2001-09-20 Thread Jason G.

Sorry,
In this case, use explode() instead of split() ...

Andras,

$aRay = split('.', 'mypicture.jpg');

$aRay[0] will be the filename
$aRay[1] will be the extension

-Jason Garber
www.deltacron.com



At 03:14 PM 9/20/2001 -0700, Andras Kende wrote:
Hi,

I trying to cut the last 4 char of a string but sometimes its cut 3 sometime
4 char

$pic1=$amyrow[picture];
$pic2 = substr($pic1, 0, -4);

Actually I have some pictures where I need to cut off the extensions...

amamm.jpg
33.jpg
321.gif

to

amamm
33
321

Is any other way than substr to do this ??

Thanks

Andras


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Using Ingres II Functions

2001-08-28 Thread Jason G Ngo

The php manual mentions about compiling php with Open API headers for Ingres. We are 
using the commercial version of Ingres II for NT. Is this a different animal from 
Ingres for Linux or should I contact Computer Associates to get those headers? How do 
I get php to access directly to Ingres II for NT aside from going through ODBC?

__
www.edsamail.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]