Re: [PHP] Query result to an array

2002-09-12 Thread Christian Ista


   $result = mysql_query(...);
   while( $t = mysql_fetch_row($result) ){
 $array[] = $t;
   }

No. I need a 2 dimensions arrays, each line of this array, is the result 
of one row of the query and each cell of this row is a field from the 
select.

Example, the query return 2 row and 3 fields for each row :
Christian, Ista, Belgium
zak, PhpNet, Dontknowfrom

resulf of SELECT NAME, LASTNAME, COUNTRY FROM MyTable;

I'd like to put that in an array and later because I use a session array.

I'd like via a for loop access these data by
echo(MyArray[1][1]);  result is PhpNet
echo(MyArray[0][2]);  result is Belgium
echo(MyArray[1][0]);  result is zak

Is it clearer now ?

Thanks,

Christian



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




RE: [PHP] Query result to an array

2002-09-12 Thread Martin Towell

$result = mysql_query(...);
   while( $t = mysql_fetch_row($result) ){
 $array[] = $t;
   }
 
 No. I need a 2 dimensions arrays, each line of this array, is the result 
 of one row of the query and each cell of this row is a field from the 
 select.
 
 Example, the query return 2 row and 3 fields for each row :
 Christian, Ista, Belgium
 zak, PhpNet, Dontknowfrom
 
 resulf of SELECT NAME, LASTNAME, COUNTRY FROM MyTable;
 
 I'd like to put that in an array and later because I use a session array.
 
 I'd like via a for loop access these data by
 echo(MyArray[1][1]);  result is PhpNet
 echo(MyArray[0][2]);  result is Belgium
 echo(MyArray[1][0]);  result is zak
 
 Is it clearer now ?
 
 Thanks,
 
 Christian
 

That's exactly what this will do. mysql_fetch_row() returns an array.
Appending that to another array and you get back an array of arrays (which
is the same as a 2D array)

Try it and see...

Martin


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




RE: [PHP] frame

2002-09-12 Thread Martin Towell

Sorry, can't help you there. I'm not familiar with swf_* functions
Martin

-Original Message-
From: dinnie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 4:59 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] frame



anyway thanks before mr martin..^_^
i know to use it if use html but
how bout command swf_setframe(void) or swf_getframe(void) ???


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 11:02 AM
To: '[EMAIL PROTECTED]'; Milist PHP
Subject: RE: [PHP] frame


this is more of an HTML question. You'll probably be wanting to look at
frameset and frame

-Original Message-
From: dinnie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 12:59 PM
To: Milist PHP
Subject: [PHP] frame



hi all,
sorry for disturb all of u for a while...
there's anyone can hel me...??

i'm a beginner in PHPer...
right now... i'm trying to make 2 frames in one file...

example.. 

setup.php as main program with 2 frame 
then i want to call dispsetup.php and display it in second frame...
how the way to make the syntax...??

thanks before all... ^_^




-- 
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] Date-format

2002-09-12 Thread Tommi Virtanen

Hi!

I have web-form, which has field (10 chars), there I enter date (format
dd.mm.). Then data saves to database (date-field type is date). 

So everything works, but not fine. When I enter date in format ex.
31.12.2002 and save form, then I'll check what are in db (there are
2031-12-20). 

Is there any chance to correct this problem. 

I have (in clause which insert to db): 

GetSQLValueString($HTTP_POST_VARS['date'], date)

gustavus



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




[PHP] what is wrong?

2002-09-12 Thread Meltem Demirkus

Hi,
I want to understand what is wrong with this code?I am trying to understand
when an empty inputs come from form and I will then give a warning message..

if($_POST[new_password1] ==)

echo empty input;



thanks..

meltem


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




Re: [PHP] Query result to an array

2002-09-12 Thread Zak Greant

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On September 12, 2002 01:55, Christian Ista wrote:
$result = mysql_query(...);
while( $t = mysql_fetch_row($result) ){
  $array[] = $t;
}

 No. I need a 2 dimensions arrays, each line of this array, is the result
 of one row of the query and each cell of this row is a field from the
 select.

  Did you test the code? :)

 Example, the query return 2 row and 3 fields for each row :
 Christian, Ista, Belgium
 zak, PhpNet, Dontknowfrom

 resulf of SELECT NAME, LASTNAME, COUNTRY FROM MyTable;

  The code snippet above combined with the above query would create an array
  of this structure:

  $array[0][0] = 'Christian';
  $array[0][1] = 'Ista';
  $array[0][2] = 'Belgium';

  $array[1][0] = 'zak';
  $array[1][1] = 'PhpNet';
  $array[1][2] = 'Canada';

 I'd like to put that in an array and later because I use a session array.

 I'd like via a for loop access these data by
 echo(MyArray[1][1]);  result is PhpNet
 echo(MyArray[0][2]);  result is Belgium
 echo(MyArray[1][0]);  result is zak

 Is it clearer now ?

Cheers!
- --zak  
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9gD/1b6QONwsK8bIRAmm7AJ41PUo2zVmFwN/vfvTr4j6Fze/NdwCbBPZm
bWnEPyBj+bKQsnQ2bg9HZ7E=
=q8vy
-END PGP SIGNATURE-


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




[PHP] question about $_GET, etc

2002-09-12 Thread swade

On my laptop i still have 4.11 apache,linux on it but its just for 
development.

I must be confused about get and post handling. I've been referrencing
them in $_GET, etc but I was just working on something and linked to a 
script by using ?section=duh in the query string,etc

Now i thought $duh would be empty since i thought all get and post
now got stored in $_GET[duh], but i notice if i echo $duh[0] it will return 
an 'd'

is this normal? 

thanks!
shawn






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




[PHP] Session Vars Problem

2002-09-12 Thread Krispi

Hi,

I have a problem when registering Session variables.
Let me describe.

I have 2 files. In the first one initialization is done and some session
registering.
The second one is my main application. If I call a method from the first
file in my main file , variables are not registered. I use session_start in
both files.


Thx,

  Krispi






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




[PHP] Re: what is wrong?

2002-09-12 Thread lallous

try this:
if (empty(trim($_POST[new_password1])))
{
  echo 'Empty!!!';
}

Meltem Demirkus [EMAIL PROTECTED] wrote in message
001701c25a2c$4758d4a0$5583@hiborya">news:001701c25a2c$4758d4a0$5583@hiborya...
 Hi,
 I want to understand what is wrong with this code?I am trying to
understand
 when an empty inputs come from form and I will then give a warning
message..

 if($_POST[new_password1] ==)

 echo empty input;



 thanks..

 meltem




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




RE: [PHP] what is wrong?

2002-09-12 Thread Rudolf Visagie

if ($_POST['new_password1'] ==  || !isset($_POST['new_password1']))

echo empty input;

-Original Message-
From: Meltem Demirkus [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 9:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] what is wrong?


Hi,
I want to understand what is wrong with this code?I am trying to understand
when an empty inputs come from form and I will then give a warning message..

if($_POST[new_password1] ==)

echo empty input;



thanks..

meltem


-- 
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] Date-format

2002-09-12 Thread Jacob Miller

It looks to me like the database is interpreting your date 
incorrectly.  Try changing the format you use to insert, -mm-dd

- jacob

At 15:11 09/12/2002, Tommi Virtanen wrote:
Hi!

I have web-form, which has field (10 chars), there I enter date (format
dd.mm.). Then data saves to database (date-field type is date).

So everything works, but not fine. When I enter date in format ex.
31.12.2002 and save form, then I'll check what are in db (there are
2031-12-20).

Is there any chance to correct this problem.

I have (in clause which insert to db):

GetSQLValueString($HTTP_POST_VARS['date'], date)

gustavus



--
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] Date-format

2002-09-12 Thread Tommi Virtanen

Well, insert format in wrong, but in Finland enter format is dd.mm.,
so I cannot use other insert format (it have to do other way).

gustavus

It looks to me like the database is interpreting your date 
incorrectly.  Try changing the format you use to insert, -mm-dd



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




[PHP] Trouble on php.net

2002-09-12 Thread Christian Ista

Hello,

I use in general the chm help file in English. Today I downloaded the 
french version (php_manual_fr.chm) but it's not french it's a mix 
german/english.

Downloaded from this page : http://www.php.net/download-docs.php

Christian,


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




Re: [PHP] question about $_GET, etc

2002-09-12 Thread olinux

You need to turn register_globals off in your php.ini
file. This is default in php 4.2+

Try this article for a great overview:
http://www.webmasterbase.com/article/758/8

olinux


--- swade [EMAIL PROTECTED] wrote:
 On my laptop i still have 4.11 apache,linux on it
 but its just for 
 development.
 
 I must be confused about get and post handling. I've
 been referrencing
 them in $_GET, etc but I was just working on
 something and linked to a 
 script by using ?section=duh in the query string,etc
 
 Now i thought $duh would be empty since i thought
 all get and post
 now got stored in $_GET[duh], but i notice if i echo
 $duh[0] it will return 
 an 'd'
 
 is this normal? 
 
 thanks!
 shawn
 
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

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




Re: [PHP] Date-format

2002-09-12 Thread Jacob Miller

Why can't you just reformat it before inserting it into the db?

 $date = 31.12.2002;

 $parts = split(\., $date);
 echo $parts[2].-.$parts[1].-.$parts[0];

- jacob

At 16:13 09/12/2002, Tommi Virtanen wrote:
Well, insert format in wrong, but in Finland enter format is dd.mm.,
so I cannot use other insert format (it have to do other way).

gustavus

 It looks to me like the database is interpreting your date
 incorrectly.  Try changing the format you use to insert, -mm-dd



--
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] How to change charset in vb

2002-09-12 Thread Mohd_Q

Does anyone know how to add a line describing charset in vbulletin?

MQ.



[PHP] Cry for help

2002-09-12 Thread Chad Winger

I need to learn PHP and databases. If I had those skills, I would be so much
more succesful with my web designs. What I usually do, is make the html
templates, and then hire someone, usually expensively, to do the PHP and
MySQL bankend.

Unfortunately, my programming skill is ZERO. Ok, maybe not zero, I do have a
little bit of PERL experience, but it mainly comes in the form of
downloading prewritten scripts, and lots of trial and error in editing them
using common sense and drawing on my experience of BASIC which I learned
when I was 6 years old!

I have browsed hours on the net looking for help in this sort of thing. I
have downloaded programs, I have read hours of documents and manuals, and
still, I am no further along than where I started. Programming and databases
are more of a mystery to me than women are. I'm absolutely CLUELESS.

So basically, I need to learn this stuff as soon as humanly possible, but I
have NO IDEA where to start. Let me tell you first what I have done thusfar.

First thing I did was download something called mySQL Max version 3.23.49
directly from the website of mysql. I was under the impression that this
program would be something along the lines of MS Access in the standpoint of
user interface, and it would allow you to create tables etc. (I do know how
to create some rudimentary tables in MS Access). So after I installed this
program, I clicked on the icon to start it, and to my surprise, the only
thing that happened was the an MS-Dos box popped up for about 2/10ths of a
second and then disappeared. So to me it was a waste of 2 hours of
downloading.

After a bit more of prodding I saw that there was some configuring to do.
For the life of me, I have no idea where to look, and even if I did, I
wouldnt have any idea what I need to configure anyways. Basically I want to
have this installed so that during my learning process of PHP, I can test
and run things on my local machine, and not have to connect to the internet,
upload files etc.


Secondly, I downloaded something similar, called Easy PHP. The website said
it would install this and that and then something else that would allow you
to run PHP scripts on your local machine as well as being an editor to help
you write scripts. So I downloaded this as well. So 27 MB and 3 hours later
I have yet another useless program with no interfaces nothing. Just
something that runs in the background.

So now I talked with my roommate and explained these issues to him. He
pointed me to a software called CodeCharge. So I downloaded that and spent
hours looking through the templates and what not, and although I can see
this is a step in the right direction, it still leaves me with more
questions than answers. It wants me to specify DNS or ODBC or ASPI etc etc
and I have no clue what that is, what it means or what is does.

Furthermore I see no way to use existing html files that I have created as
templates. Just existing ugly templates that come with the software. I'm
sure there is a way to do that, but I haven't figured it out.

So what are my questions? Basically want to do is create sets of HTML
templates for various sections of sites. Then using the templates, code the
PHP to pull the correct information from a database, manipulate it, and then
return it together with templates. For example. On this a site that I am now
working on, there is a section that will contain headlines to various news
stories. In the HTML it looks something like this:


A HREF=1.htmHEADLINE/ABR
DATE

All this would simply create is something that looks like this Below:

Headline
September 12, 2002

Obviously clicking the headline would take you to another page that would
give you the entire story. To me, drawing on common sense, what you are
really saying is this:


A HREF=1.htm{LOOK IN THE DATABASE FOR A HEADLINE AND PRINT IT
HERE}/ABR
{LOOK IN THE DATABASE FOR THE DATE OF THE ABOVE HEADLINE AND PRINT IT HERE}

Makes sense no? So really for this template, it would use 2 sections from
the database: Headline and Date and the PHP tells the server where to
put what depending on which templates is being used

I don't want to drag this on, but in other words for these sites that I am
creating there are basically 1 thing that I need to accomplish.

#1 is that I need a control panel that is somewhere that I can go to any
computer and log in to. When I do that I can log-in and that will bring me
to and ADD/EDIT/DELETE form for any section of the site, and if I go to add,
then I will type the various bits of info into it, click submit and
automatically that info is added to the database. The edit and delete
features are self explanatory, but the end result is simply saying that OK,
now I've entered the info into the database, Now, Mr. Server and Mr. PHP
when the time comes for this info to be used, you have the info.

To me this isn't brain science in concept, but I have no friggin idea where
to start. So? Where do I start?

Ok, so hopefully you've read with me so far. 

[PHP] curl_init() ??

2002-09-12 Thread Geoff Lists

Hi,
I am using PHP v.4.1.2,  CURL v7.7.2   with Apache server on MacOS X 
10.1.5
I have a PHP script containing the following:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,http://omitted.com;);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, salexml=$saleXML);
$result=curl_exec ($ch);
curl_close ($ch);

When I run the script I receive the following error:
Fatal error: Call to undefined function: curl_init()

My reading of the PHP manual, Curl man pages, curl web site and PHP
books and articles in the curl-php mailing list indicate that this 
should work.

Can someone tell me how to get PHP to recognise the function
curl_init() or tell me another method of getting a PHP script to
simulate POST method as though the data was being sent from a form.

TIA
--
Geoff Hill
Information Technology Training  Solutions
A.B.N. 28 712 665 728



[PHP] user and password for socket connection

2002-09-12 Thread Wilbert Enserink

Hi all,


I'm trying to open a socket connection on a client. The server needs a 
username/password combination for this connection to accept. Does anybody know how to 
send this with php??

In ASP I use 

xmlhttp.Open POST,sURL, false, sUser, sPass

,where sUser=myUsername and sPass=myPassword. this script worx, but of course I want 
to use PHP :-)



in php i'm trying. 

$hostname=https://www.url.com;;
$port=443;
$loginmessage=GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n;
$timeout=30;
$fp = fsockopen ($hostname, $port, $errno, $errstr, $timeout);
if (!$fp) {
echo $errstr ($errno)br\n;
} else {
fputs ($fp, $loginmessage);
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}


thx Wilbert




-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


Re: [PHP] Cry for help

2002-09-12 Thread Justin French

Dude, take small steps, and try to understand what you're doing rather than
jumping in head-on.  Do lots of reading and searching.


1. You need an Apache webserver on your local machine.  There are many good
tutes, pre-compiled .exe's, etc etc on apache.org, and hundreds of tutorials
on it across the web. Ignore PHP and MySQL -- just get apache running, and
try to serve some basic HTML pages to yourself over http:// (NOT file:///).

There is an apache-users list for help with this too.

2. Then try to get PHP working alongside Apache... create some very simple
PHP pages, and try to get them working.  No doubt Apache will need to have
some tweaks to get it going.  PHP IS a background process, NOT a GUI
program.  PHP parses certain webpages (commonly, those a with .php
extension).  Yes, this PHP list will be able to help with the installation.
Personally, I'd download PHP ONLY from php.net, getting a pre-compiled
installer of the latest stable release.

3. THEN try to get MySQL working with PHP and Apache.  Again, this will
require some reconfiguring of PHP and perhaps Apache.  The best way to test
if you've got MySQL set up right would be to install phpMyAdmin.  There is a
mysql mailing list which will be abel to help you with specific MySQL
installation and configuration problems.  Personally, I'd download MySQL
ONLY from mysql.com, getting a pre-compiled installer of the latest stable
release.

4. Install phpMyAdmin (.net or .org i think), which is a web based GUI
interface for MySQL... again, read the documentation and installation
instructions, go slowly, and you should be able to get it fired up, assuming
that MySQL, PHP and Apache are all talking.  There is a mailing list and
forums specifically for installation and configuration of phpMyAdmin.

5. Find some SIMPLE tutorials on programming with PHP and MYSQL... something
like the classic contact database examples on sitepoint.com,
phpbeginner.com, phpbuilder.com, etc etc will be a good start.  Books (yes,
they aren't free) are good too.

6. Spend about a year trying to learn both MySQL and PHP, and you should be
getting pretty good.


There's no way you can expect to achieve what your current programmer's
achieving overnight.  It would appear from your email that you don't have
much/any experience with web servers, server side scripting languages, SQL,
etc etc, and it does take time to get a decent code library and knowledge
base together.

Please do expect this list to be able to help you huge emails covering
20,000 topics -- it's not going to work, and you are not going to become a
php guru overnight.  Take it slowly, preferably working on something
personal, not something client-based with a deadline.  Depending on the
complexity of what you want to achieve, my guess is you'll be comfortable
with using PHP and MYSQL in a client situation in about 3 to 12 months --
NOT a week.  

A bypass for step 1-3 may be an installation package called phpTriad, which
installs Apache, PHP and MySQL with common configurations, supposedly pain
free... although I've never done it... I'm pretty sure there's a windows
version.  Or, pay someone knowledgable and experience to set up all three
for you on your machine.  They are NOT like installing the latest version of
Internet Explorer :)


Good luck,

Justin French



on 12/09/02 6:44 PM, Chad Winger ([EMAIL PROTECTED]) wrote:

 I need to learn PHP and databases. If I had those skills, I would be so much
 more succesful with my web designs. What I usually do, is make the html
 templates, and then hire someone, usually expensively, to do the PHP and
 MySQL bankend.
 
 Unfortunately, my programming skill is ZERO. Ok, maybe not zero, I do have a
 little bit of PERL experience, but it mainly comes in the form of
 downloading prewritten scripts, and lots of trial and error in editing them
 using common sense and drawing on my experience of BASIC which I learned
 when I was 6 years old!
 
 I have browsed hours on the net looking for help in this sort of thing. I
 have downloaded programs, I have read hours of documents and manuals, and
 still, I am no further along than where I started. Programming and databases
 are more of a mystery to me than women are. I'm absolutely CLUELESS.
 
 So basically, I need to learn this stuff as soon as humanly possible, but I
 have NO IDEA where to start. Let me tell you first what I have done thusfar.
 
 First thing I did was download something called mySQL Max version 3.23.49
 directly from the website of mysql. I was under the impression that this
 program would be something along the lines of MS Access in the standpoint of
 user interface, and it would allow you to create tables etc. (I do know how
 to create some rudimentary tables in MS Access). So after I installed this
 program, I clicked on the icon to start it, and to my surprise, the only
 thing that happened was the an MS-Dos box popped up for about 2/10ths of a
 second and then disappeared. So to me it was a waste of 2 hours 

[PHP] Re: Cry for help

2002-09-12 Thread lallous

Hello Chad,

I started PHP from a book.
I believe a book is a good way to start as it organized and well written to
make sure you're progressing chapter by chapter.
After that, I read articles and tutorials as I needed to expand my skills.

just my 2cents,
Elias


Chad Winger [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I need to learn PHP and databases. If I had those skills, I would be so
much
 more succesful with my web designs. What I usually do, is make the html
 templates, and then hire someone, usually expensively, to do the PHP and
 MySQL bankend.

 Unfortunately, my programming skill is ZERO. Ok, maybe not zero, I do have
a
 little bit of PERL experience, but it mainly comes in the form of
 downloading prewritten scripts, and lots of trial and error in editing
them
 using common sense and drawing on my experience of BASIC which I learned
 when I was 6 years old!

 I have browsed hours on the net looking for help in this sort of thing. I
 have downloaded programs, I have read hours of documents and manuals,
and
 still, I am no further along than where I started. Programming and
databases
 are more of a mystery to me than women are. I'm absolutely CLUELESS.

 So basically, I need to learn this stuff as soon as humanly possible, but
I
 have NO IDEA where to start. Let me tell you first what I have done
thusfar.

 First thing I did was download something called mySQL Max version 3.23.49
 directly from the website of mysql. I was under the impression that this
 program would be something along the lines of MS Access in the standpoint
of
 user interface, and it would allow you to create tables etc. (I do know
how
 to create some rudimentary tables in MS Access). So after I installed this
 program, I clicked on the icon to start it, and to my surprise, the only
 thing that happened was the an MS-Dos box popped up for about 2/10ths of a
 second and then disappeared. So to me it was a waste of 2 hours of
 downloading.

 After a bit more of prodding I saw that there was some configuring to do.
 For the life of me, I have no idea where to look, and even if I did, I
 wouldnt have any idea what I need to configure anyways. Basically I want
to
 have this installed so that during my learning process of PHP, I can test
 and run things on my local machine, and not have to connect to the
internet,
 upload files etc.


 Secondly, I downloaded something similar, called Easy PHP. The website
said
 it would install this and that and then something else that would allow
you
 to run PHP scripts on your local machine as well as being an editor to
help
 you write scripts. So I downloaded this as well. So 27 MB and 3 hours
later
 I have yet another useless program with no interfaces nothing. Just
 something that runs in the background.

 So now I talked with my roommate and explained these issues to him. He
 pointed me to a software called CodeCharge. So I downloaded that and spent
 hours looking through the templates and what not, and although I can see
 this is a step in the right direction, it still leaves me with more
 questions than answers. It wants me to specify DNS or ODBC or ASPI etc etc
 and I have no clue what that is, what it means or what is does.

 Furthermore I see no way to use existing html files that I have created as
 templates. Just existing ugly templates that come with the software. I'm
 sure there is a way to do that, but I haven't figured it out.

 So what are my questions? Basically want to do is create sets of HTML
 templates for various sections of sites. Then using the templates, code
the
 PHP to pull the correct information from a database, manipulate it, and
then
 return it together with templates. For example. On this a site that I am
now
 working on, there is a section that will contain headlines to various news
 stories. In the HTML it looks something like this:


 A HREF=1.htmHEADLINE/ABR
 DATE

 All this would simply create is something that looks like this Below:

 Headline
 September 12, 2002

 Obviously clicking the headline would take you to another page that would
 give you the entire story. To me, drawing on common sense, what you are
 really saying is this:


 A HREF=1.htm{LOOK IN THE DATABASE FOR A HEADLINE AND PRINT IT
 HERE}/ABR
 {LOOK IN THE DATABASE FOR THE DATE OF THE ABOVE HEADLINE AND PRINT IT
HERE}

 Makes sense no? So really for this template, it would use 2 sections from
 the database: Headline and Date and the PHP tells the server where to
 put what depending on which templates is being used

 I don't want to drag this on, but in other words for these sites that I am
 creating there are basically 1 thing that I need to accomplish.

 #1 is that I need a control panel that is somewhere that I can go to any
 computer and log in to. When I do that I can log-in and that will bring me
 to and ADD/EDIT/DELETE form for any section of the site, and if I go to
add,
 then I will type the various bits of info into it, click submit and
 

[PHP] Re: curl_init() ??

2002-09-12 Thread lallous

Hello,

1)probably you don't have CURL extension enabled in your php.ini file? try
to open php.ini and search for CURL.
2)to achieve a POST via PHP code, look at www.phpclasses.org

Elias,

Geoff Lists [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
 I am using PHP v.4.1.2,  CURL v7.7.2   with Apache server on MacOS X
 10.1.5
 I have a PHP script containing the following:
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL,http://omitted.com;);
 curl_setopt($ch, CURLOPT_FAILONERROR, 1);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, salexml=$saleXML);
 $result=curl_exec ($ch);
 curl_close ($ch);

 When I run the script I receive the following error:
 Fatal error: Call to undefined function: curl_init()

 My reading of the PHP manual, Curl man pages, curl web site and PHP
 books and articles in the curl-php mailing list indicate that this
 should work.

 Can someone tell me how to get PHP to recognise the function
 curl_init() or tell me another method of getting a PHP script to
 simulate POST method as though the data was being sent from a form.

 TIA
 --
 Geoff Hill
 Information Technology Training  Solutions
 A.B.N. 28 712 665 728




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




[PHP] accessing a property the static way

2002-09-12 Thread Wolfram Kriesing

how can i access a property statically (without creating an object)?
is that possible at all?

i.e.

class foo
{
   var $prop = array('some','defines','are','here');
}

$myVar = foo::prop;
   OR
$myVar = foo::prop[0];

how can this be realized?
can someone help? is that possible with php?

-- 
Wolfram

... translating template engine 
   http://sf.net/projects/simpletpl

... authentication system 
   http://sf.net/projects/auth


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




[PHP] Re: Cry for help

2002-09-12 Thread John Wards

I started also from a book Begining PHP 4 by wrox. I had a good
understanding of programming languages before I started as I had experience
of Delphi and some Java. oh and BASIC which I also learned what I was about
6! on a spectrum by any chance?

If you have a grasp of programming languages then PHP is dead easy to pick
up. I only started learning PHP about 9 months ago and I have designed a
website that is pulling 3 million hits a month (http://sportnetwork.net) and
I got a Job as a PHP programmer.

I would suggest looking for some basic programming books to get your head
around how programming languages work.if statments, for loops, while
loops, case statments etc these are used in most if not all programming
languages. And if you are brave you can look at object orrientated!! I have
just become brave enough!

On the install front. I got one of these multi purpose install things that
install apache,php, mysql and phpmyadmin at once which got me started but
after a we while i uninstalled it all and did each thing individually. I
just wanted to know where every thing went!

Anyhooo good luck and have fun!

John Wards
SportNetwork.net
- Original Message -
From: lallous [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 12, 2002 11:22 AM
Subject: [PHP] Re: Cry for help


 Hello Chad,

 I started PHP from a book.
 I believe a book is a good way to start as it organized and well written
to
 make sure you're progressing chapter by chapter.
 After that, I read articles and tutorials as I needed to expand my skills.

 just my 2cents,
 Elias


 Chad Winger [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I need to learn PHP and databases. If I had those skills, I would be so
 much
  more succesful with my web designs. What I usually do, is make the html
  templates, and then hire someone, usually expensively, to do the PHP and
  MySQL bankend.
 
  Unfortunately, my programming skill is ZERO. Ok, maybe not zero, I do
have
 a
  little bit of PERL experience, but it mainly comes in the form of
  downloading prewritten scripts, and lots of trial and error in editing
 them
  using common sense and drawing on my experience of BASIC which I learned
  when I was 6 years old!
 
  I have browsed hours on the net looking for help in this sort of thing.
I
  have downloaded programs, I have read hours of documents and manuals,
 and
  still, I am no further along than where I started. Programming and
 databases
  are more of a mystery to me than women are. I'm absolutely CLUELESS.
 
  So basically, I need to learn this stuff as soon as humanly possible,
but
 I
  have NO IDEA where to start. Let me tell you first what I have done
 thusfar.
 
  First thing I did was download something called mySQL Max version
3.23.49
  directly from the website of mysql. I was under the impression that this
  program would be something along the lines of MS Access in the
standpoint
 of
  user interface, and it would allow you to create tables etc. (I do know
 how
  to create some rudimentary tables in MS Access). So after I installed
this
  program, I clicked on the icon to start it, and to my surprise, the only
  thing that happened was the an MS-Dos box popped up for about 2/10ths of
a
  second and then disappeared. So to me it was a waste of 2 hours of
  downloading.
 
  After a bit more of prodding I saw that there was some configuring to
do.
  For the life of me, I have no idea where to look, and even if I did, I
  wouldnt have any idea what I need to configure anyways. Basically I want
 to
  have this installed so that during my learning process of PHP, I can
test
  and run things on my local machine, and not have to connect to the
 internet,
  upload files etc.
 
 
  Secondly, I downloaded something similar, called Easy PHP. The website
 said
  it would install this and that and then something else that would allow
 you
  to run PHP scripts on your local machine as well as being an editor to
 help
  you write scripts. So I downloaded this as well. So 27 MB and 3 hours
 later
  I have yet another useless program with no interfaces nothing. Just
  something that runs in the background.
 
  So now I talked with my roommate and explained these issues to him. He
  pointed me to a software called CodeCharge. So I downloaded that and
spent
  hours looking through the templates and what not, and although I can
see
  this is a step in the right direction, it still leaves me with more
  questions than answers. It wants me to specify DNS or ODBC or ASPI etc
etc
  and I have no clue what that is, what it means or what is does.
 
  Furthermore I see no way to use existing html files that I have created
as
  templates. Just existing ugly templates that come with the software. I'm
  sure there is a way to do that, but I haven't figured it out.
 
  So what are my questions? Basically want to do is create sets of HTML
  templates for various sections of sites. Then using the templates, 

[PHP] Re: Sending Attachements through php email form

2002-09-12 Thread Craig Donnelly

Edit this to what you need:

http://www.evilwalrus.com/viewcode.php?codeEx=546

Regards,

Heidi Belal [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hi,

 I was wondering if anybody could tell me the best way and how to code
sending an attachement with an email form.  I want the user to be able to
browse and select the file he wants to attach, and i want the reciepent to
be able to see the file that has been attached with the email.

 Thanks,



 Heidi Belal
 Web Developer
 www.code-corner.com

 A bus stops at a bus station;
 a train stops at a train station;
 and on my desk i have a work station ...





 -
 Yahoo! - We Remember
 9-11: A tribute to the more than 3,000 lives lost



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




[PHP] Re: Cry for help

2002-09-12 Thread Chad Winger

Justin,
Thanks for the reply. Funny seeing the word dude again. Havent heard that
in quite a while, since moving over here to Italy. :)

I hope I didnt come across as thinking I can just learn this in a week or
two. I'm bright, but I'm not a genius. I know, and realize that it is a long
a frustrating process. What I don't have is the real opportunity here to
learn this like I could back in the states. There isn't a lot of info here
on the topic in English, no classes to take, etc. I can't just walk into the
local bookstore and buy a PHP book. While I am fluent in Italian, it would
be that much easier if I can get my start in English obviously.

As far as Apache is concerned, I looked at the website, yet couldnt find the
exact server software, so if you could provide me with a direct link I'd
appreciate it. It would be to my benefit however, if I could not only serve
myself html pages as http:// but also as file:// as internet costs here are
ridiculously high (no unilimited $24.99 2/7 packages here yet)

I have read many docs and downloaded many scripts to try to familiarize
myself with the language, and while I grasp many of the concepts, I still
have lingering questions that I havent been able to resolve. So I have been
trying to just have some of my fellow netizens to just point me to the right
door in the HUGE hallway of doors that will get me into the proper room in
which to learn. So thanks again

-Tree

Chad Winger [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I need to learn PHP and databases. If I had those skills, I would be so
much
 more succesful with my web designs. What I usually do, is make the html
 templates, and then hire someone, usually expensively, to do the PHP and
 MySQL bankend.

 Unfortunately, my programming skill is ZERO. Ok, maybe not zero, I do have
a
 little bit of PERL experience, but it mainly comes in the form of
 downloading prewritten scripts, and lots of trial and error in editing
them
 using common sense and drawing on my experience of BASIC which I learned
 when I was 6 years old!

 I have browsed hours on the net looking for help in this sort of thing. I
 have downloaded programs, I have read hours of documents and manuals,
and
 still, I am no further along than where I started. Programming and
databases
 are more of a mystery to me than women are. I'm absolutely CLUELESS.

 So basically, I need to learn this stuff as soon as humanly possible, but
I
 have NO IDEA where to start. Let me tell you first what I have done
thusfar.

 First thing I did was download something called mySQL Max version 3.23.49
 directly from the website of mysql. I was under the impression that this
 program would be something along the lines of MS Access in the standpoint
of
 user interface, and it would allow you to create tables etc. (I do know
how
 to create some rudimentary tables in MS Access). So after I installed this
 program, I clicked on the icon to start it, and to my surprise, the only
 thing that happened was the an MS-Dos box popped up for about 2/10ths of a
 second and then disappeared. So to me it was a waste of 2 hours of
 downloading.

 After a bit more of prodding I saw that there was some configuring to do.
 For the life of me, I have no idea where to look, and even if I did, I
 wouldnt have any idea what I need to configure anyways. Basically I want
to
 have this installed so that during my learning process of PHP, I can test
 and run things on my local machine, and not have to connect to the
internet,
 upload files etc.


 Secondly, I downloaded something similar, called Easy PHP. The website
said
 it would install this and that and then something else that would allow
you
 to run PHP scripts on your local machine as well as being an editor to
help
 you write scripts. So I downloaded this as well. So 27 MB and 3 hours
later
 I have yet another useless program with no interfaces nothing. Just
 something that runs in the background.

 So now I talked with my roommate and explained these issues to him. He
 pointed me to a software called CodeCharge. So I downloaded that and spent
 hours looking through the templates and what not, and although I can see
 this is a step in the right direction, it still leaves me with more
 questions than answers. It wants me to specify DNS or ODBC or ASPI etc etc
 and I have no clue what that is, what it means or what is does.

 Furthermore I see no way to use existing html files that I have created as
 templates. Just existing ugly templates that come with the software. I'm
 sure there is a way to do that, but I haven't figured it out.

 So what are my questions? Basically want to do is create sets of HTML
 templates for various sections of sites. Then using the templates, code
the
 PHP to pull the correct information from a database, manipulate it, and
then
 return it together with templates. For example. On this a site that I am
now
 working on, there is a section that will contain headlines to various 

[PHP] Find DPI ing image?

2002-09-12 Thread Johan Holst Nielsen

Hi people...

Anyone know a class or a solution so I can find the DPI (dot per inch) 
of an image?

getImageSize do not help me? Any other solutions?

Regards,

Johan


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




[PHP] Re: user and password for socket connection

2002-09-12 Thread Erwin

 $hostname=https://www.url.com;;
 $port=443;
 $loginmessage=GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n;
 $timeout=30;
 $fp = fsockopen ($hostname, $port, $errno, $errstr, $timeout);
 if (!$fp) {
 echo $errstr ($errno)br\n;
 } else {
 fputs ($fp, $loginmessage);
 while (!feof($fp)) {
 echo fgets ($fp,128);
 }
 fclose ($fp);
 }

You could try using 
$url = https://$user:$[EMAIL PROTECTED];

I haven't tried this yet ;-))

HTH 
Erwin


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




[PHP] Re: How do I upgrade my version of PHP?

2002-09-12 Thread David Robley

In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...
 Could you explain what man patch does or is? I haven't updated using a
 patch before. Thanks.
 
  From: [EMAIL PROTECTED]
  Newsgroups: php.general
  Date: Wed, 11 Sep 2002 23:14:55 +0200
  To: [EMAIL PROTECTED]
  Subject: Re: How do I upgrade my version of PHP?
  
  You should use the patch command, feel free to man patch.
  
  --
  
  Nicos - CHAILLAN Nicolas
  [EMAIL PROTECTED]
  www.WorldAKT.com - Hébergement de sites Internet
  
  Monty [EMAIL PROTECTED] a écrit dans le message de news:
  [EMAIL PROTECTED]
  I've downloaded the patch file for 4.2.2 to 4.2.3 from the PHP website,
  but,
  not sure what to do with this file. I have a Linux 7.x server. Can anyone
  tell me how to patch my version of PHP or point me to a source that
  explains
  how this is done?
  
  Thanks!

patch is a *nix program to apply patches such as the one you have 
downloaded. man is a *nix program which displays help about the program 
supplied as an argument to man - so 'man patch' will show you the manual 
page for patch.

-- 
David Robley

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

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




[PHP] Re: what is wrong?

2002-09-12 Thread David Robley

In article 001701c25a2c$4758d4a0$5583@hiborya, mdemirkus@momentum-
dmt.com says...
 Hi,
 I want to understand what is wrong with this code?I am trying to understand
 when an empty inputs come from form and I will then give a warning message..
 
 if($_POST[new_password1] ==)
 
 echo empty input;
 
 
 
 thanks..
 
 meltem

Well, you are comparing it to a non-empty string of three spaces rather 
than an empty value .


-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




RE: [PHP] Cry for help

2002-09-12 Thread Scott Houseman

Hi Chad.

Some really excellent places to start:

http://www.onlamp.com/php/
http://www.phpbuilder.com/
http://www.devshed.com/Server_Side/PHP
http://www.zend.com/zend/tut/

Good luck!

Regards

-|Scott

 -Original Message-
 From: Chad Winger [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 12, 2002 10:44 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Cry for help


 I need to learn PHP and databases. If I had those skills, I would
 be so much
 more succesful with my web designs. What I usually do, is make the html
 templates, and then hire someone, usually expensively, to do the PHP and
 MySQL bankend.

 Unfortunately, my programming skill is ZERO. Ok, maybe not zero,
 I do have a
 little bit of PERL experience, but it mainly comes in the form of
 downloading prewritten scripts, and lots of trial and error in
 editing them
 using common sense and drawing on my experience of BASIC which I learned
 when I was 6 years old!

 I have browsed hours on the net looking for help in this sort of thing. I
 have downloaded programs, I have read hours of documents and
 manuals, and
 still, I am no further along than where I started. Programming
 and databases
 are more of a mystery to me than women are. I'm absolutely CLUELESS.

 So basically, I need to learn this stuff as soon as humanly
 possible, but I
 have NO IDEA where to start. Let me tell you first what I have
 done thusfar.

 First thing I did was download something called mySQL Max version 3.23.49
 directly from the website of mysql. I was under the impression that this
 program would be something along the lines of MS Access in the
 standpoint of
 user interface, and it would allow you to create tables etc. (I
 do know how
 to create some rudimentary tables in MS Access). So after I installed this
 program, I clicked on the icon to start it, and to my surprise, the only
 thing that happened was the an MS-Dos box popped up for about 2/10ths of a
 second and then disappeared. So to me it was a waste of 2 hours of
 downloading.

 After a bit more of prodding I saw that there was some configuring to do.
 For the life of me, I have no idea where to look, and even if I did, I
 wouldnt have any idea what I need to configure anyways. Basically
 I want to
 have this installed so that during my learning process of PHP, I can test
 and run things on my local machine, and not have to connect to
 the internet,
 upload files etc.


 Secondly, I downloaded something similar, called Easy PHP. The
 website said
 it would install this and that and then something else that would
 allow you
 to run PHP scripts on your local machine as well as being an
 editor to help
 you write scripts. So I downloaded this as well. So 27 MB and 3
 hours later
 I have yet another useless program with no interfaces nothing. Just
 something that runs in the background.

 So now I talked with my roommate and explained these issues to him. He
 pointed me to a software called CodeCharge. So I downloaded that and spent
 hours looking through the templates and what not, and although I can see
 this is a step in the right direction, it still leaves me with more
 questions than answers. It wants me to specify DNS or ODBC or ASPI etc etc
 and I have no clue what that is, what it means or what is does.

 Furthermore I see no way to use existing html files that I have created as
 templates. Just existing ugly templates that come with the software. I'm
 sure there is a way to do that, but I haven't figured it out.

 So what are my questions? Basically want to do is create sets of HTML
 templates for various sections of sites. Then using the
 templates, code the
 PHP to pull the correct information from a database, manipulate
 it, and then
 return it together with templates. For example. On this a site
 that I am now
 working on, there is a section that will contain headlines to various news
 stories. In the HTML it looks something like this:


 A HREF=1.htmHEADLINE/ABR
 DATE

 All this would simply create is something that looks like this Below:

 Headline
 September 12, 2002

 Obviously clicking the headline would take you to another page that would
 give you the entire story. To me, drawing on common sense, what you are
 really saying is this:


 A HREF=1.htm{LOOK IN THE DATABASE FOR A HEADLINE AND PRINT IT
 HERE}/ABR
 {LOOK IN THE DATABASE FOR THE DATE OF THE ABOVE HEADLINE AND
 PRINT IT HERE}

 Makes sense no? So really for this template, it would use 2 sections from
 the database: Headline and Date and the PHP tells the server where to
 put what depending on which templates is being used

 I don't want to drag this on, but in other words for these sites that I am
 creating there are basically 1 thing that I need to accomplish.

 #1 is that I need a control panel that is somewhere that I can go to any
 computer and log in to. When I do that I can log-in and that will bring me
 to and ADD/EDIT/DELETE form for any section of the site, and if I
 go to add,
 then I will type the various bits of 

[PHP] Re: what is wrong?

2002-09-12 Thread Erwin

Meltem Demirkus wrote:
 Hi,
 I want to understand what is wrong with this code?I am trying to
 understand when an empty inputs come from form and I will then give a
 warning message.. 
 
 if($_POST[new_password1] ==)
 
 echo empty input;

And as final addition, you probably have to use

$_POST[new_password1]

Besides that, I would use the form of Lallous:

if ( empty( trim( $_POST[ new_password1 ] )
echo Empty!;

HTH
Erwin


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




[PHP] Re: curl_init() ??

2002-09-12 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Hi,
 I am using PHP v.4.1.2,  CURL v7.7.2   with Apache server on MacOS X 
 10.1.5
 I have a PHP script containing the following:
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL,http://omitted.com;);
   curl_setopt($ch, CURLOPT_FAILONERROR, 1);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
   curl_setopt($ch, CURLOPT_POST, 1);
   curl_setopt($ch, CURLOPT_POSTFIELDS, salexml=$saleXML);
   $result=curl_exec ($ch);
   curl_close ($ch);
 
 When I run the script I receive the following error:
 Fatal error: Call to undefined function: curl_init()
 
 My reading of the PHP manual, Curl man pages, curl web site and PHP
 books and articles in the curl-php mailing list indicate that this 
 should work.
 
 Can someone tell me how to get PHP to recognise the function
 curl_init() or tell me another method of getting a PHP script to
 simulate POST method as though the data was being sent from a form.
 
 TIA

It seems that the version of PHP you are using doesn't have curl support 
compiled in/ doesn't have curl libs loaded through the ini file.

Run a script with ?php phpinfo() ? to confirm you don't have curl 
support; you may have to recompile or if you have the appropriate curl 
exstension lib you can probably add/uncomment curl in the etensions 
section of yor php.ini

 --
 Geoff Hill
 Information Technology Training  Solutions
 A.B.N. 28 712 665 728

So I don't need to withold tax on this reply:-) 

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: what is wrong?

2002-09-12 Thread lallous

I'ld also add isset() to avoid warnings too:

if (isset($_POST['new_password1']) 
!empty(trim(isset($_POST['new_password1']
{
  echo i am not empty, you can do whatever;
}
else
{
  echo i am empty! show error message;
}

Erwin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Meltem Demirkus wrote:
  Hi,
  I want to understand what is wrong with this code?I am trying to
  understand when an empty inputs come from form and I will then give a
  warning message..
 
  if($_POST[new_password1] ==)
 
  echo empty input;

 And as final addition, you probably have to use

 $_POST[new_password1]

 Besides that, I would use the form of Lallous:

 if ( empty( trim( $_POST[ new_password1 ] )
 echo Empty!;

 HTH
 Erwin




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




[PHP] session_register trouble ?

2002-09-12 Thread Christian Ista

Hello,

I use this code :
$myarray= array();
session_register (myarray);
$i=0;
while ($row = mysql_fetch_object($result)) {
$myarray[$i][0] = $row-ID;
$myarray[$i][1] = $row-NOM;
$myarray[$i][2] = $row-PRENOM;
$i = $i + 1;
}

for($i=0; $isizeof($myarray);$i++){ ?
a href=index.php?argumenthere=testid=?php  echo($myarray[$i][0]); ?
?php echo($myarray[$i][2]); ?/a
?php }

mysql_free_result($result);
mysql_close($link);
?

That's work. But when I add an a href= to call an another page 
(at the end of this) and in this another page I use axactly the same for 
loop than in the previous code

?php
for($i=0; $isizeof($myarray);$i++){ ?
a href=index.php?argumenthere=testid=?php  echo($myarray[$i][0]); ?
?php echo($myarray[$i][2]); ?/a
?php } ?

I receive the error :
Notice: Undefined variable: myarray in 


I solved the problem, I did that :
- register_globals = On
- use session_start(); on the top of the second page too

Is it normal ?

Bye


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




[PHP] pdf in php

2002-09-12 Thread sonjaya

i create some pdf in php like this :
?php
$p=PDF_new();
PDF_open_file($p,);
PDF_begin_page($p,595,842);
$font=PDF_findfont($p,Helvetica-Bold,host,0);
PDF_setfont($p,$font,18.0);
PDF_set_text_pos($p,50,700);
PDF_show=($p,Tess pdf!);
PDF_continue_text($p,Line 2 nih);
PDF_end_page($p);
PDF_close($p);
$buf=PDF_get_buffer($p);
$len=strlen($buf);
header(Content-type:application/pdf);
header(Content-Lenght:$len);
print $buf;
PDF_delete($p);
?

and i get error message like this:
Warning: Failed opening '/home/web/html/pdf.php' for inclusion 
(include_path='.:/usr/local/lib/php') in Unknown on line 0


sicute

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




[PHP] headers already sent

2002-09-12 Thread Gian Michele

I'm doing a little form:
In the first page i have the form to insert datas,then redirect the 
control to a script that check if the filds are correct.If they are 
correct redirect the output to a prospect else to the first page.The 
problem is that it gives an error like this
Warning: Cannot send session cache limiter - headers already sent 
but I wrote session_start() in the highest part of all the scripts.
I redirect the output with header(Location: http://..;) is it correct 
or there is an other way ?

If i don't write session_start() in the html's page the variables dont 
appear in the fields(if i insert before,naturally).

Someone help me please?

Tanks Gian Michele


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




[PHP] Need some help with array sorting

2002-09-12 Thread Will Steffen

Ahem *tap* *tap* is this thing on?

Hi everyone, my name is Will and I've been addicted to php for 3 months
and 21 days... *grin*

I'm hitting a bit of a brick wall in a current project - the answer is
probably quite simple, but I'm still newish to php and coding in general
so bear with me:

I have a multidim array which looks something like :

$blocks[0] = array(param1=4,param2=some other param)
$blocks[1] = array(param1=3,param2=some other param)
$blocks[2] = array(param1=6,param2=some other param)

And so forth

Fairly straight forward you say, my problem is that elements can be
inserted into the blocks array in no particular order and I need to sort
at the top level using the values in param1 - so my output should be:

$sorted_blocks[0] = array(param1=3,param2=some other param)
$sorted_blocks[1] = array(param1=4,param2=some other param)
$sorted_blocks[2] = array(param1=6,param2=some other param)

I've had a long hard look at the manual and all those obscure array
manipulation goodies (ksort, multisort, etc) and done some hunting on
phpbuilder and the like, but turned up zip - either I'm not
understanding the array functions properly, or this can't be done, or
there's a nifty trick for doing it which I havent figured out?  

Ideally I'd like to be populating blocks using an sql query so I could
do an order by or some such upfront, but this world is anything but
ideal.

Any1 got 2c for me?


Thanks in advance
Will




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




[PHP] Re: headers already sent

2002-09-12 Thread David Robley

In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...
 I'm doing a little form:
 In the first page i have the form to insert datas,then redirect the 
 control to a script that check if the filds are correct.If they are 
 correct redirect the output to a prospect else to the first page.The 
 problem is that it gives an error like this
 Warning: Cannot send session cache limiter - headers already sent 
 but I wrote session_start() in the highest part of all the scripts.
 I redirect the output with header(Location: http://..;) is it correct 
 or there is an other way ?
 
 If i don't write session_start() in the html's page the variables dont 
 appear in the fields(if i insert before,naturally).
 
 Someone help me please?
 
 Tanks Gian Michele

Check that you don't have _any_ whitespace before the ?php ? tags, and 
of course don't send any other output before the header function.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] cookie problem...

2002-09-12 Thread info

we are using apache 1.3.12 server, php 4.2.3 on linux.
Before, we didn't write cookies.txt on harddisk. We changed some
configuration in httpd.conf like.
We disabled  mod_proxy module and then cookie had been wrote. But now, we
are not reading
cookie variables from cookies.txt (Netscape). I konw problem could be very
easy but.
I am unsleepy two days.

thanks all

Tansel Akgl


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




[PHP] Cookie doen't get in variable!

2002-09-12 Thread info

we are using apache 1.3.12 server, php 4.2.3 on linux.
Before, we didn't write cookies.txt on harddisk. We changed some
configuration in httpd.conf like.
We disabled  mod_proxy module and then cookie had been wrote. But now, we
are not reading
cookie variables from cookies.txt (Netscape). I konw problem could be very
easy but.
I am unsleepy two days.

thanks all

Tansel Akgl


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




[PHP] whois query

2002-09-12 Thread yasin inat

please  anyone  can  help  me   about  querying  a  domain  
like   whois  queries ?

if  someone  has   got   a   script  ,  it's   acceptable 





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




[PHP] dll file for postgres-php connection

2002-09-12 Thread YC Nyon

Looking for this file, php_pgsql.dll
running php 4.1.2 on w2k.
anyone where i can find it.

Regards
Nyon






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




RE: [PHP] Re: Cry for help

2002-09-12 Thread Jay Blanchard

[snip]
As far as Apache is concerned, I looked at the website, yet couldnt find the
exact server software, so if you could provide me with a direct link I'd
appreciate it. It would be to my benefit however, if I could not only serve
myself html pages as http:// but also as file:// as internet costs here are
ridiculously high (no unilimited $24.99 2/7 packages here yet)
[/snip]

When you install apache locally (on your own system) you will be serving
pages as http:// locally. Should help you to cut down on those unreal
internet costs.

What OS are you running now? Give us that and we can point you to a link.

HTH! Peace ...

Jay



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




[PHP] PHP mem leaks

2002-09-12 Thread John Wards

After being told off on the dev list I have posted this on this list (I
thought it was techie enough to go on that list but I was wrong)

I am running a large PHP/MySQL/Apache driven website and I am finding that
the apache Processes get larger and larger as the days go on. When I
stop/start apache the processes are around 16-17 meg each and after a week
they are about 40meg each and if we then get a large in flux of traffic say
a Monday lunch time the server just pages out and dies...

I have been on the apache list given them all my modules that I have running
and they pointed the finger at PHP, I was told to change maxrequestsperchild
to 100 but this made no difference. Is there a fix for this? or a planned
fix for this?

Oh and here are the modules I am using:

We are running Apache/1.3.26, PHP/4.2.2 mod_ssl/2.8.9 under FreeBSD 4.6.
Apache modules:

mod_php4, mod_ssl, mod_setenvif, mod_so, mod_auth, mod_access, mod_alias,
mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir,
mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime,
mod_log_config, mod_env, http_core

all compiled in except for mod_php4 and mod_ssl which are loaded using
LoadModule.

Cheers
John Wards
SportNetwork.net



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




Re: [PHP] whois query

2002-09-12 Thread Adam Williams

Have a php page that runs exec() or system() and does a whois query on the
domain you want and then have it output the text to a page.  Very simple
to do, less then 2 minutes of coding.

Adam

On Thu, 12 Sep 2002, yasin inat wrote:

 please  anyone  can  help  me   about  querying  a  domain  
 like   whois  queries ?

 if  someone  has   got   a   script  ,  it's   acceptable 








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




Re: [PHP] Re: Cry for help

2002-09-12 Thread Chad Winger

Thanks for the reply :P

I found it actually. Now I have the apache and php running, and am able to
run my aforementioned test script locally. I am still looking through the
manual now for the syntaxes and such. I am also looking on the web for some
simple prewritten scripts to run and then try to dissect and deconstruct.

With my little test script I've written, there are a few things I'd like
to be able to try to do with it that I think would help my learning process
go on more smoothly, but i cant seem to figure out, what functions to even
begin to try to use.

I'll give an example.

This is the result of my little test script as printed into a txt file.

|Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola

So if i fill out the form again, and resubmit, i might get something like
this:

|Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
|Serie C2 Round 2|09.09.02|20.45|Gualdo|Florentia Viola

So for example, lets say I wanted to make another html form that has a form
field for List team by: and and select either home or away ... by
selecting home, the browser would print out the following:

Sangiovannese
Gualdo

so now I need to figure out how to get PHP to do the following:

#1 look at each line in the text file and treat it individually
#2 select the data after the 4th | from each line
#3 print it back to the browser

It's simple things like this that will get me going. I know for guys like
you, it would take about 3 minutes to type that up but to me its a little
tough trying to figure out how and where to use what. This manual isnt the
most well put together in my opinion, its tough to locate things. So if
someone or something would say to mewell for that operation, you need to
create function_whatever, then run a so_and_so then I could go to the
manual, and then learn how to write it. So this is my problem right now,
basically not knowing WHAT to learn first.

Thoughts?

Thanks again

-Tree
- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
Newsgroups: php.general
To: 'Chad Winger' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, September 12, 2002 3:01 PM
Subject: RE: [PHP] Re: Cry for help


 [snip]
 As far as Apache is concerned, I looked at the website, yet couldnt find
the
 exact server software, so if you could provide me with a direct link I'd
 appreciate it. It would be to my benefit however, if I could not only
serve
 myself html pages as http:// but also as file:// as internet costs here
are
 ridiculously high (no unilimited $24.99 2/7 packages here yet)
 [/snip]

 When you install apache locally (on your own system) you will be serving
 pages as http:// locally. Should help you to cut down on those unreal
 internet costs.

 What OS are you running now? Give us that and we can point you to a link.

 HTH! Peace ...

 Jay


Jay Blanchard [EMAIL PROTECTED] wrote in message
001901c25a5c$797161c0$8102a8c0@000347D72515">news:001901c25a5c$797161c0$8102a8c0@000347D72515...
 [snip]
 As far as Apache is concerned, I looked at the website, yet couldnt find
the
 exact server software, so if you could provide me with a direct link I'd
 appreciate it. It would be to my benefit however, if I could not only
serve
 myself html pages as http:// but also as file:// as internet costs here
are
 ridiculously high (no unilimited $24.99 2/7 packages here yet)
 [/snip]

 When you install apache locally (on your own system) you will be serving
 pages as http:// locally. Should help you to cut down on those unreal
 internet costs.

 What OS are you running now? Give us that and we can point you to a link.

 HTH! Peace ...

 Jay





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




Re: [PHP] Re: Cry for help

2002-09-12 Thread Adam Williams

You can use PHP and file() to do with, along with the str functions, but
if I were you and you already know what the filename of the file is you
are working on (or can submit it via a form) I would use the unix command
cut to do the operations on the file.  Use another exec() or system() and
have it run cut -d | -f 4 yourfile.txt and then return you the output.

Adam

On Thu, 12 Sep 2002, Chad Winger wrote:

 Thanks for the reply :P

 I found it actually. Now I have the apache and php running, and am able to
 run my aforementioned test script locally. I am still looking through the
 manual now for the syntaxes and such. I am also looking on the web for some
 simple prewritten scripts to run and then try to dissect and deconstruct.

 With my little test script I've written, there are a few things I'd like
 to be able to try to do with it that I think would help my learning process
 go on more smoothly, but i cant seem to figure out, what functions to even
 begin to try to use.

 I'll give an example.

 This is the result of my little test script as printed into a txt file.

 |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola

 So if i fill out the form again, and resubmit, i might get something like
 this:

 |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
 |Serie C2 Round 2|09.09.02|20.45|Gualdo|Florentia Viola

 So for example, lets say I wanted to make another html form that has a form
 field for List team by: and and select either home or away ... by
 selecting home, the browser would print out the following:

 Sangiovannese
 Gualdo

 so now I need to figure out how to get PHP to do the following:

 #1 look at each line in the text file and treat it individually
 #2 select the data after the 4th | from each line
 #3 print it back to the browser

 It's simple things like this that will get me going. I know for guys like
 you, it would take about 3 minutes to type that up but to me its a little
 tough trying to figure out how and where to use what. This manual isnt the
 most well put together in my opinion, its tough to locate things. So if
 someone or something would say to mewell for that operation, you need to
 create function_whatever, then run a so_and_so then I could go to the
 manual, and then learn how to write it. So this is my problem right now,
 basically not knowing WHAT to learn first.

 Thoughts?

 Thanks again

 -Tree
 - Original Message -
 From: Jay Blanchard [EMAIL PROTECTED]
 Newsgroups: php.general
 To: 'Chad Winger' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, September 12, 2002 3:01 PM
 Subject: RE: [PHP] Re: Cry for help


  [snip]
  As far as Apache is concerned, I looked at the website, yet couldnt find
 the
  exact server software, so if you could provide me with a direct link I'd
  appreciate it. It would be to my benefit however, if I could not only
 serve
  myself html pages as http:// but also as file:// as internet costs here
 are
  ridiculously high (no unilimited $24.99 2/7 packages here yet)
  [/snip]
 
  When you install apache locally (on your own system) you will be serving
  pages as http:// locally. Should help you to cut down on those unreal
  internet costs.
 
  What OS are you running now? Give us that and we can point you to a link.
 
  HTH! Peace ...
 
  Jay
 
 
 Jay Blanchard [EMAIL PROTECTED] wrote in message
 001901c25a5c$797161c0$8102a8c0@000347D72515">news:001901c25a5c$797161c0$8102a8c0@000347D72515...
  [snip]
  As far as Apache is concerned, I looked at the website, yet couldnt find
 the
  exact server software, so if you could provide me with a direct link I'd
  appreciate it. It would be to my benefit however, if I could not only
 serve
  myself html pages as http:// but also as file:// as internet costs here
 are
  ridiculously high (no unilimited $24.99 2/7 packages here yet)
  [/snip]
 
  When you install apache locally (on your own system) you will be serving
  pages as http:// locally. Should help you to cut down on those unreal
  internet costs.
 
  What OS are you running now? Give us that and we can point you to a link.
 
  HTH! Peace ...
 
  Jay
 
 






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




[PHP] PHP or Apache problem?

2002-09-12 Thread Aaron Gould

I have recently installed Apache 2.0.40 with PHP 4.2.3 on a development
server...

When I type the IP address of the server into my browser, all I see is PHP
code.  However, when I type the IP address, with the index.php, it works
perfectly!  Why would one work and not the other?

192.168.1.1   Doesn't work (displays the code in
index.php)
192.168.1.1/index.php   Does work!

I have these PHP-related entries in my httpd.conf file:

LoadModule php4_modulemodules/libphp4.so
DirectoryIndex index.php index.html.var
AddType application/x-httpd-php .php

Am I missing something important here?

--
Aaron Gould



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




Re: [PHP] Re: Cry for help

2002-09-12 Thread Chad Winger

I have no idea what that means, sorry :)

My point for wanting to do this isnt because I really want to make a list of
the home teams or whatnot. But obviously, at some point, I am going to have
to learn how to split different bits of information, how organize them in
certain ways, in certain orders etc. So if i can figure out how to get PHP
to select the certain bits of info, and then organize them, say,
alphabetically, that will teach me how to write some syntax, to use a few
different functions and to begin how to set variables.

in 85 when i had the old Apple IIe I was able to do stuff like this with the
if A$=whatever then goto ...  type stuff and it was easy back then. Now i
realize PHP is not BASIC, nor am I a little kid anymore, but the basic idea
of what i'd like to learn to do is there. So if i can just get used to
working with it, then it will come

-Tree

Adam Williams [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You can use PHP and file() to do with, along with the str functions, but
 if I were you and you already know what the filename of the file is you
 are working on (or can submit it via a form) I would use the unix command
 cut to do the operations on the file.  Use another exec() or system() and
 have it run cut -d | -f 4 yourfile.txt and then return you the output.

 Adam

 On Thu, 12 Sep 2002, Chad Winger wrote:

  Thanks for the reply :P
 
  I found it actually. Now I have the apache and php running, and am able
to
  run my aforementioned test script locally. I am still looking through
the
  manual now for the syntaxes and such. I am also looking on the web for
some
  simple prewritten scripts to run and then try to dissect and
deconstruct.
 
  With my little test script I've written, there are a few things I'd
like
  to be able to try to do with it that I think would help my learning
process
  go on more smoothly, but i cant seem to figure out, what functions to
even
  begin to try to use.
 
  I'll give an example.
 
  This is the result of my little test script as printed into a txt
file.
 
  |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
 
  So if i fill out the form again, and resubmit, i might get something
like
  this:
 
  |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
  |Serie C2 Round 2|09.09.02|20.45|Gualdo|Florentia Viola
 
  So for example, lets say I wanted to make another html form that has a
form
  field for List team by: and and select either home or away ... by
  selecting home, the browser would print out the following:
 
  Sangiovannese
  Gualdo
 
  so now I need to figure out how to get PHP to do the following:
 
  #1 look at each line in the text file and treat it individually
  #2 select the data after the 4th | from each line
  #3 print it back to the browser
 
  It's simple things like this that will get me going. I know for guys
like
  you, it would take about 3 minutes to type that up but to me its a
little
  tough trying to figure out how and where to use what. This manual isnt
the
  most well put together in my opinion, its tough to locate things. So if
  someone or something would say to mewell for that operation, you need
to
  create function_whatever, then run a so_and_so then I could go to the
  manual, and then learn how to write it. So this is my problem right now,
  basically not knowing WHAT to learn first.
 
  Thoughts?
 
  Thanks again
 
  -Tree
  - Original Message -
  From: Jay Blanchard [EMAIL PROTECTED]
  Newsgroups: php.general
  To: 'Chad Winger' [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Thursday, September 12, 2002 3:01 PM
  Subject: RE: [PHP] Re: Cry for help
 
 
   [snip]
   As far as Apache is concerned, I looked at the website, yet couldnt
find
  the
   exact server software, so if you could provide me with a direct link
I'd
   appreciate it. It would be to my benefit however, if I could not only
  serve
   myself html pages as http:// but also as file:// as internet costs
here
  are
   ridiculously high (no unilimited $24.99 2/7 packages here yet)
   [/snip]
  
   When you install apache locally (on your own system) you will be
serving
   pages as http:// locally. Should help you to cut down on those unreal
   internet costs.
  
   What OS are you running now? Give us that and we can point you to a
link.
  
   HTH! Peace ...
  
   Jay
  
  
  Jay Blanchard [EMAIL PROTECTED] wrote in message
  001901c25a5c$797161c0$8102a8c0@000347D72515">news:001901c25a5c$797161c0$8102a8c0@000347D72515...
   [snip]
   As far as Apache is concerned, I looked at the website, yet couldnt
find
  the
   exact server software, so if you could provide me with a direct link
I'd
   appreciate it. It would be to my benefit however, if I could not only
  serve
   myself html pages as http:// but also as file:// as internet costs
here
  are
   ridiculously high (no unilimited $24.99 2/7 packages here yet)
   [/snip]
  
   When you install apache locally (on your own system) you will be

RE: [PHP] PHP or Apache problem?

2002-09-12 Thread MET

The detailed answer, I have no idea.

The simple answer, currently there compatibility is NOT stable, but will
be soon

~ Matthew

-Original Message-
From: Aaron Gould [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 12, 2002 9:35 AM
To: PHP-GENERAL
Subject: [PHP] PHP or Apache problem?


I have recently installed Apache 2.0.40 with PHP 4.2.3 on a development
server...

When I type the IP address of the server into my browser, all I see is
PHP code.  However, when I type the IP address, with the index.php, it
works perfectly!  Why would one work and not the other?

192.168.1.1   Doesn't work (displays the code in
index.php)
192.168.1.1/index.php   Does work!

I have these PHP-related entries in my httpd.conf file:

LoadModule php4_modulemodules/libphp4.so
DirectoryIndex index.php index.html.var
AddType application/x-httpd-php .php

Am I missing something important here?

--
Aaron Gould



-- 
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] whois query

2002-09-12 Thread Andrew Brampton

If you can't do a exec or system call on your server, then look at the
many examples of whois scripts here:
http://www.hotscripts.com/PHP/Scripts_and_Programs/Networking_Tools/Whois/
some of which use sockets or other methods which might be allowed on your
server

Also for reference, www.hotscripts.com is a GREAT site which has tons of
PHP scripts, allways look there 9 times out of 10 you will find a script
you can use.

Andrew
- Original Message -
From: Adam Williams [EMAIL PROTECTED]
To: yasin inat [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, September 12, 2002 2:17 PM
Subject: Re: [PHP] whois query


 Have a php page that runs exec() or system() and does a whois query on
the
 domain you want and then have it output the text to a page.  Very simple
 to do, less then 2 minutes of coding.

 Adam

 On Thu, 12 Sep 2002, yasin inat wrote:

  please  anyone  can  help  me   about  querying  a  domain  
  like   whois  queries ?
 
  if  someone  has   got   a   script  ,  it's   acceptable 
 
 
 
 
 
 


 --
 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] Text from web form

2002-09-12 Thread Cory Hicks

Rick,

Someone had mentioned doing the following:

$name = $_POST['name'];
$message = $_POST['message'];
at the top of your script to enable the variables.


Or, you could try this at the top of every page:

global $HTTP_POST_VARS; 
global $HTTP_GET_VARS;  

and then use:

$_POST[field_name]

hth!~

Cory

 Rick King [EMAIL PROTECTED] 09/11/02 16:29 PM 
Apache: 1.3.26
PHP: 4.2.3
OS: HPUX-11

Hello PHP Guru's!

After successfully installing PHP and viewing the phpinfo page, I decided to
create a simple web-form. Just a basic Name Message web-form, when the
form is complete it is emailed to an account. Everything works, except I
don't see the filled in contents in the email message. I don't see the what
the person filled out. But I see Name: ane Message:

Any ideas?

Here's my config line for installing PHP:
CC=gcc ./configure --prefix=/opt/php \
--without-mysql \   (didn't have MySQL installed)
--with-apxs=/opt/apache/bin/apxs

Here's my config line for installing Apache:
CC=gcc ./configure --prefix=/opt/apache \
--enable-module=most \
--enable-shared=max

Any help would be greatly appreciated!

Rick



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




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




RE: [PHP] Re: Cry for help

2002-09-12 Thread Will Steffen

Heh - I know how you feel.

I'm an ex network tecchie fighting my way through a career change to web
developer - spent some time messing with various scripting tools and so
forth, but never really had any formal coding experience until I hit php
- if you want some advice on learning php mine is spend the next few
weeks/months just soaking up every tutorial you can lay your hands on -
the best libraries are on phpbuilder, devshed and zend imho - altho
webmonkey also has a couple of really 'beginner' ones (hello world
country) you might want to start out with.

Also one thing no-one ever really tells you about this is that one of
the most important things to learn if you plan on building sites with
php is not php - its html.  I know this is a bit duh!, but seriously -
php is about logical structures - and slapping together a few variables
- it aint that hard once you get in the groove, but if you don't know
your html well enough to handcode it and to deconstruct a fat mess of
tags in your head and visualize what its going to end up looking like on
screen - you're going to have a hard time coding scripts to generate the
stuff.


0.02 - actual mileage may vary - insert coin to generate more bs

Cheers
Will

 -Original Message-
 From: Chad Winger [mailto:[EMAIL PROTECTED]] 
 Sent: 12 September 2002 03:34 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: Cry for help
 
 
 I have no idea what that means, sorry :)
 
 My point for wanting to do this isnt because I really want to 
 make a list of the home teams or whatnot. But obviously, at 
 some point, I am going to have to learn how to split 
 different bits of information, how organize them in certain 
 ways, in certain orders etc. So if i can figure out how to 
 get PHP to select the certain bits of info, and then organize 
 them, say, alphabetically, that will teach me how to write 
 some syntax, to use a few different functions and to begin 
 how to set variables.
 
 in 85 when i had the old Apple IIe I was able to do stuff 
 like this with the if A$=whatever then goto ...  type stuff 
 and it was easy back then. Now i realize PHP is not BASIC, 
 nor am I a little kid anymore, but the basic idea of what i'd 
 like to learn to do is there. So if i can just get used to 
 working with it, then it will come
 
 -Tree
 
 Adam Williams [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
 te.ms.us...
  You can use PHP and file() to do with, along with the str 
 functions, 
  but if I were you and you already know what the filename of 
 the file 
  is you are working on (or can submit it via a form) I would use the 
  unix command cut to do the operations on the file.  Use 
 another exec() 
  or system() and have it run cut -d | -f 4 yourfile.txt and 
 then return 
  you the output.
 
  Adam
 
  On Thu, 12 Sep 2002, Chad Winger wrote:
 
   Thanks for the reply :P
  
   I found it actually. Now I have the apache and php 
 running, and am 
   able
 to
   run my aforementioned test script locally. I am still looking 
   through
 the
   manual now for the syntaxes and such. I am also looking 
 on the web 
   for
 some
   simple prewritten scripts to run and then try to dissect and
 deconstruct.
  
   With my little test script I've written, there are a few things 
   I'd
 like
   to be able to try to do with it that I think would help 
 my learning
 process
   go on more smoothly, but i cant seem to figure out, what 
 functions 
   to
 even
   begin to try to use.
  
   I'll give an example.
  
   This is the result of my little test script as printed 
 into a txt
 file.
  
   |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
  
   So if i fill out the form again, and resubmit, i might 
 get something
 like
   this:
  
   |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia 
 Viola Serie 
   |C2 Round 2|09.09.02|20.45|Gualdo|Florentia Viola
  
   So for example, lets say I wanted to make another html 
 form that has 
   a
 form
   field for List team by: and and select either home or 
 away ... 
   by selecting home, the browser would print out the following:
  
   Sangiovannese
   Gualdo
  
   so now I need to figure out how to get PHP to do the following:
  
   #1 look at each line in the text file and treat it 
 individually #2 
   select the data after the 4th | from each line #3 print 
 it back to 
   the browser
  
   It's simple things like this that will get me going. I 
 know for guys
 like
   you, it would take about 3 minutes to type that up but to me its a
 little
   tough trying to figure out how and where to use what. This manual 
   isnt
 the
   most well put together in my opinion, its tough to locate 
 things. So 
   if someone or something would say to mewell for that 
 operation, you 
   need
 to
   create function_whatever, then run a so_and_so then I could go to 
   the manual, and then learn how to write it. So this is my problem 
   right now, basically not knowing WHAT to learn first.
  
   Thoughts?
  
   Thanks 

[PHP] Better Images

2002-09-12 Thread [EMAIL PROTECTED]

Hi all,

One of my customers needs to show magazine  newspapers reviews of his
work, which are scanned in such a low res due to a file size matter, that
the images are not quite readable. Can I convert large size images to pdf
with PHP in order to show them faster on-the-fly? Will this be better? Is
there another quick and easy solution?

BTW, I do have access to GD lib if this should matter.

Thanks in advance,

César Aracena
On Dial-Up


mail2web - Check your email from the web at
http://mail2web.com/ .



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




Re: [PHP] PreCaching Db into Variables Slows it down?!??

2002-09-12 Thread M1tch

That's an expansive reply! Cheers Peter
Since I had to alter the db (quite simply) to include this tweak, I thought
best to do it now in dev phase (and keep it as an option), that mess around
with it later when lots of data exists.

It's my own code, and benchmarks show it to perform fast. However, in due
course I will try the Smarty template system, and compare it to that, but
from what (little) I've read on the subject, I don't know if it's best
suited to my needs (although the cache system sounds nice!).

You're right, it is early to be worrying about optimisation, but I tend to
get a bit obsessive about it. I take the view it's best to get it at least
half right during development phase, than make a mess and spend a lot longer
trying to rework production code.

You sound like you have some experience though, whats a decent page load
time? (from start of script to end of script)?
I'm aiming for sub 0.1 seconds, on IIS5 (it will be moved to RedHat for
production).

Thanks for you input, interesting read!
Andy

 I bet someone would have to look at the code. Are you writing your own
code or just gluing modules together? I'm using the
 Smarty template system which I really like, it caches templates.

 Personally I think you are going overboard in trying to optimize at this
point. I assume that your system is working, and so you
 need only tweak it. But it sounds as if you are still working out what the
system is.

 I have not done much work on High Traffic sites. One site was a skater
site and  big food producer was running a promo and
 had TV ads ... site performed fine even though it was just plain cgi
scripts hitting mysql at least 5 times for just about every
 page (I did not write the site but I had to modify,watch it).

 Another site was marked as troublesome, big book publisher. They just
threw hardware at it and all was well.

 Now Yahoo ... or Google ... that would be interesting. Why create a
solution for no problem?  I'd suggest looking at your
 templating system. Which one are you using? You didn't create your own did
you?

 Peter






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




Re: [PHP] Re: Cry for help

2002-09-12 Thread Chad Winger

Html is something i do in my sleep :P thankfully I've been good enough with
it to make a decent living with it. What you mention is quite logical, as i
would find myself correcting the ppl coding the databases and/or scripts by
saying, stuff like you realize that when the info is returned like that you
are going to need four colums in the html, not 3... and they'd be like,
geez..your right...and then they'd have to go back and code again...

So i am hoping that the html part that i know helps me gets me thru the
scripting phase a little easier, although the languages are apples and
oranges

iom looking thru the tuts now :P

cheers

-Tree


Will Steffen [EMAIL PROTECTED] wrote in message
000c01c25a63$e616a0e0$8000a8c0@william">news:000c01c25a63$e616a0e0$8000a8c0@william...
 Heh - I know how you feel.

 I'm an ex network tecchie fighting my way through a career change to web
 developer - spent some time messing with various scripting tools and so
 forth, but never really had any formal coding experience until I hit php
 - if you want some advice on learning php mine is spend the next few
 weeks/months just soaking up every tutorial you can lay your hands on -
 the best libraries are on phpbuilder, devshed and zend imho - altho
 webmonkey also has a couple of really 'beginner' ones (hello world
 country) you might want to start out with.

 Also one thing no-one ever really tells you about this is that one of
 the most important things to learn if you plan on building sites with
 php is not php - its html.  I know this is a bit duh!, but seriously -
 php is about logical structures - and slapping together a few variables
 - it aint that hard once you get in the groove, but if you don't know
 your html well enough to handcode it and to deconstruct a fat mess of
 tags in your head and visualize what its going to end up looking like on
 screen - you're going to have a hard time coding scripts to generate the
 stuff.


 0.02 - actual mileage may vary - insert coin to generate more bs

 Cheers
 Will

  -Original Message-
  From: Chad Winger [mailto:[EMAIL PROTECTED]]
  Sent: 12 September 2002 03:34 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Re: Cry for help
 
 
  I have no idea what that means, sorry :)
 
  My point for wanting to do this isnt because I really want to
  make a list of the home teams or whatnot. But obviously, at
  some point, I am going to have to learn how to split
  different bits of information, how organize them in certain
  ways, in certain orders etc. So if i can figure out how to
  get PHP to select the certain bits of info, and then organize
  them, say, alphabetically, that will teach me how to write
  some syntax, to use a few different functions and to begin
  how to set variables.
 
  in 85 when i had the old Apple IIe I was able to do stuff
  like this with the if A$=whatever then goto ...  type stuff
  and it was easy back then. Now i realize PHP is not BASIC,
  nor am I a little kid anymore, but the basic idea of what i'd
  like to learn to do is there. So if i can just get used to
  working with it, then it will come
 
  -Tree
 
  Adam Williams [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  te.ms.us...
   You can use PHP and file() to do with, along with the str
  functions,
   but if I were you and you already know what the filename of
  the file
   is you are working on (or can submit it via a form) I would use the
   unix command cut to do the operations on the file.  Use
  another exec()
   or system() and have it run cut -d | -f 4 yourfile.txt and
  then return
   you the output.
  
   Adam
  
   On Thu, 12 Sep 2002, Chad Winger wrote:
  
Thanks for the reply :P
   
I found it actually. Now I have the apache and php
  running, and am
able
  to
run my aforementioned test script locally. I am still looking
through
  the
manual now for the syntaxes and such. I am also looking
  on the web
for
  some
simple prewritten scripts to run and then try to dissect and
  deconstruct.
   
With my little test script I've written, there are a few things
I'd
  like
to be able to try to do with it that I think would help
  my learning
  process
go on more smoothly, but i cant seem to figure out, what
  functions
to
  even
begin to try to use.
   
I'll give an example.
   
This is the result of my little test script as printed
  into a txt
  file.
   
|Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
   
So if i fill out the form again, and resubmit, i might
  get something
  like
this:
   
|Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia
  Viola Serie
|C2 Round 2|09.09.02|20.45|Gualdo|Florentia Viola
   
So for example, lets say I wanted to make another html
  form that has
a
  form
field for List team by: and and select either home or
  away ...
by selecting home, the browser would print out the following:
   
Sangiovannese
Gualdo
   

[PHP] A question about .php file extension

2002-09-12 Thread LI DONG

Hello everyone,

It is a question about .php file extension. Is there any way to access PHP4 
script in Apache 1.3.x without .php extension? For example, how to use

http://localhost/phptest?id=22

instead of

http://localhost/phptest.php?id=22

Thanks a lot!

ld.

_
ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£http://www.hotmail.com/cn


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




Re: [PHP] A question about .php file extension

2002-09-12 Thread John Wards

make a .htaccess file like this

Files main
ForceType application/x-httpd-php
/Files
Files boards
ForceType application/x-httpd-php
/Files
Files read
ForceType application/x-httpd-php
/Files

This makes the file main boards read php files

What we do with it is make dynamic pages look like dirs for example
sportnetwork.net/main/s85.php would just be sportnetwork.net/main.php?s=85
we use eregs to get the values out.

Cheers
John Wards
- Original Message -
From: LI DONG [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 12, 2002 3:23 PM
Subject: [PHP] A question about .php file extension


 Hello everyone,

 It is a question about .php file extension. Is there any way to access
PHP4
 script in Apache 1.3.x without .php extension? For example, how to use

 http://localhost/phptest?id=22

 instead of

 http://localhost/phptest.php?id=22

 Thanks a lot!

 ld.

 _
 ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£http://www.hotmail.com/cn


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


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




Re: [PHP] A question about .php file extension

2002-09-12 Thread Adam Williams

make a directory called phptest and put a file, index.php in it...never
tried it tho.

On Thu, 12 Sep 2002, LI DONG wrote:

 Hello everyone,

 It is a question about .php file extension. Is there any way to access PHP4
 script in Apache 1.3.x without .php extension? For example, how to use

 http://localhost/phptest?id=22

 instead of

 http://localhost/phptest.php?id=22

 Thanks a lot!

 ld.

 _
 ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£http://www.hotmail.com/cn





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




RE: [PHP] Re: Cry for help

2002-09-12 Thread Will Steffen

Heh good so you're not a complete n00b then :P  Luckily I had a fairly
decent grounding in html and css as well when I got going - I'm just
putting the finishing touches on my first serious project atm using OO
style php which made the learning curve about 10 times steeper as I had
no previous experience with an OO language and the OO tuts as you will
find are pretty thin on the ground and of varying quality - thinking of
writing a few myself when I get a breather :-)

GL and happy reading :-)

Cheers
Will

 -Original Message-
 From: Chad Winger [mailto:[EMAIL PROTECTED]] 
 Sent: 12 September 2002 04:00 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: Cry for help
 
 
 Html is something i do in my sleep :P thankfully I've been 
 good enough with it to make a decent living with it. What you 
 mention is quite logical, as i would find myself correcting 
 the ppl coding the databases and/or scripts by saying, stuff 
 like you realize that when the info is returned like that 
 you are going to need four colums in the html, not 3... and 
 they'd be like, geez..your right...and then they'd have to go 
 back and code again...
 
 So i am hoping that the html part that i know helps me gets 
 me thru the scripting phase a little easier, although the 
 languages are apples and oranges
 
 iom looking thru the tuts now :P
 
 cheers
 
 -Tree


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




[PHP] Displaying PDF file

2002-09-12 Thread Joseph Szobody

I've made a website for a real estate appraiser, who wants to put all his appraisals 
for his clients online. I have stored these PDF documents in a folder outside of the 
webserver folder, for security. When a client successfully logs in and clicks the link 
to biew the PDF, I have a PHP script that does the following:

?
Header(Content-type: application/pdf);

include(../pdfs/whatever.pdf);
?

It worked great at first, and still does with some PDF documents. With others, it 
gives says something like...

Parse error:  parse error in /path/to/pdfs/whatever.pdf on line 410

Why does it work with some PDF docs, and not others? Is there a better way to display 
PDF files (without putting them in a web-accessible folder)?

Thanks,

Joseph



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




[PHP] numeric to word function

2002-09-12 Thread rainydays_sunshine

Hi..
anyone know any function to convert numeric values to word..
something like this:
1252 -- one thousand two hundred and fifty two

Thanks...




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




Re: [PHP] A question about .php file extension

2002-09-12 Thread Erwin

Adam Williams wrote:
 make a directory called phptest and put a file, index.php in
 it...never 
 tried it tho.

In that case you will have to call http://localhost/phptest/?id=22

Grtz Erwin



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




[PHP] Re: Displaying PDF file

2002-09-12 Thread Erwin

Joseph Szobody wrote:
 I've made a website for a real estate appraiser, who wants to put all
 his appraisals for his clients online. I have stored these PDF
 documents in a folder outside of the webserver folder, for security.
 When a client successfully logs in and clicks the link to biew the
 PDF, I have a PHP script that does the following:

 ?
 Header(Content-type: application/pdf);

 include(../pdfs/whatever.pdf);
 ?

Include is the statement used for including other php files. That means that
the pdf you're including will be parsed by the parser. I have no idea why
some document don't give errors.

You will have to use readfile instead:

readfile( ../pdfs/whatever.pdf);

HTH
Erwin


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




[PHP] Re: Displaying PDF file

2002-09-12 Thread Joseph Szobody

Thanks Erwin, that helps but I'm still not getting it to work. Should I still use 
the 

Header(Content-type: application/pdf);

line?

I tried using readfile() keeping the header. When I click the link to the PHP script 
that should show me the PDF, the IE status bar says something like Downloading from 
site .blah, then says Done. Nothing happens. I'm still on the previous page. No 
error, no pdf file... nothing.

I removed the Header line, and IE prompted me to download the file. That's not what I 
want.

What am I doing wrong?

Joseph


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




RE: [PHP] Re: Cry for help

2002-09-12 Thread joakim . andersson

 |Serie C2 Round 2|09.09.02|20.45|Sangiovannese|Florentia Viola
 |Serie C2 Round 2|09.09.02|20.45|Gualdo|Florentia Viola
 
 So for example, lets say I wanted to make another html form 
 that has a form
 field for List team by: and and select either home or away ... by
 selecting home, the browser would print out the following:
 
 Sangiovannese
 Gualdo
 
 so now I need to figure out how to get PHP to do the following:
 
 #1 look at each line in the text file and treat it individually
 #2 select the data after the 4th | from each line
 #3 print it back to the browser

$fd = fopen (/tmp/inputfile.txt, r); // Opens file for reading
while (!feof ($fd)) // Start of loop.
{
$buffer = fgets($fd, 4096); // Reads one line of maximum 4096 bytes
$arr = explode(|, $buffer); // Divides each row into separate elements
in an array.
echo $arr[4]; // Prints the 5th element of each row.
// The first element ($arr[0]) is actually  (an empty string) since each
line starts with |.
}
fclose ($fd);

Hopefully this will get you in the right direction.
Regards
Joakim Andersson

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




[PHP] Re: Displaying PDF file

2002-09-12 Thread Erwin

Joseph Szobody wrote:
 Thanks Erwin, that helps but I'm still not getting it to work.
 Should I still use the  
 
 Header(Content-type: application/pdf);
 
 line?
 
 I tried using readfile() keeping the header. When I click the link to
 the PHP script that should show me the PDF, the IE status bar says
 something like Downloading from site .blah, then says Done.
 Nothing happens. I'm still on the previous page. No error, no pdf
 file... nothing.
 
 I removed the Header line, and IE prompted me to download the file.
 That's not what I want. 
 
 What am I doing wrong?

That's weird, you should keep the 
Header( Content-Type: application/pdf );
line...

You could also try to add the 
Header( Content-Disposition: attachment; filename=whatever.pdf);
and
Header( Content-Disposition: filename=whatever.pdf );

HTH
Erwin


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




[PHP] php nuke problem

2002-09-12 Thread Ryan A

Hey guys,
I just setup php nuke (damn,thats a big package) but the problem is that i cannot 
create a super user ,go the admin, or do anything

when i go to index.php it tells me to create a super user by clicking the link,after i 
click that link i go to admin.php and when i fill that form,it just displays the same 
form over and over again...the super user/ admin user does not get created...

on the left of the page i have  a list of modules when i click on any of the modules 
i get this...
Sorry, you can't access this file directly...

Whats the problem?

Please help,
Cheers,
-Ryan.




[PHP] Re: php nuke problem

2002-09-12 Thread Erwin

Ryan A wrote:
 Hey guys,
 I just setup php nuke (damn,thats a big package) but the problem is
 that i cannot create a super user ,go the admin, or do anything

 when i go to index.php it tells me to create a super user by clicking
 the link,after i click that link i go to admin.php and when i fill
 that form,it just displays the same form over and over again...the
 super user/ admin user does not get created...

Probably it requires register_globals to be turned On??? Did you checked
that?

HTH
Erwin


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




Re: [PHP] php nuke problem

2002-09-12 Thread Geoff Hankerson

I think you  need change permissions the file that holds configurations 
settings for php-nuke.
Read the install instructions it's in there
chmod 665 config.ini
or whatever the name of the file is

Ryan A wrote:

Hey guys,
I just setup php nuke (damn,thats a big package) but the problem is that i cannot 
create a super user ,go the admin, or do anything

when i go to index.php it tells me to create a super user by clicking the link,after 
i click that link i go to admin.php and when i fill that form,it just displays the 
same form over and over again...the super user/ admin user does not get created...

on the left of the page i have  a list of modules when i click on any of the 
modules i get this...
Sorry, you can't access this file directly...

Whats the problem?

Please help,
Cheers,
-Ryan.


  





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




RE: [PHP] Extracting Numbers from a string.

2002-09-12 Thread David Buerer

OK y'all, go ahead and shoot me, but this is what I'd do:

$mystring=enters $56.55 for example;
$mynumber=$mystring+1-1;

$mynumber now equals 56.55  If you want the . to go to, use the other
methods.

-Original Message-
From: Jason Caldwell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 3:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Extracting Numbers from a string.


I need to extract the numbers only from a field.

For example:  I have an AMOUNT field and so that I can filter out any user
typo's I would like to extract the numbers only.

If the user enters $56.55 for example or just $56 then I would like to be
able to remove the $ and the . keeping just the 56 or 5655.

Can I use eregi_replace() to do this -- I've been trying but it doesn't seem
to work right.

Thanks.
Jason



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




[PHP] Windows Authoring Tools

2002-09-12 Thread Seán Dillon

As an fan of Homesite for many years I'm a little annoyed I can
no-longer purchase the product seperately, so am going to be
stuck with v5.0 as I don't fancy the idea of forking out
for Dreamweaver MX.

I'm looking for (hopefully) a GNU/GPL Open source product that
supports PHP syntax (and preferably with support for additional
languages with ad-ins or plugins).

Currently I'm looking at HTML-Kit (http://www.chami.com/html-kit/)
which seems to come with a vast array of add-ins and seems very
'extensible'.

In the past I've been using TextPad and UltraEdit but really want
something that picks up on PHP syntax and function spelling (eg
Homesite would 'bold' a function word if it was splt correctly).

I'd be interested to hear what others are using so I can take a
look at them before I change my main authoring product.


Seán


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




[PHP] local and global variables

2002-09-12 Thread skitum

Hi all,

Maybe a stupid question, but i have to make it:
How can a local variable pass its value to a global one? 
Is it possible?

Thanks in advance.

Peace  Love
skitum



[PHP] error handling

2002-09-12 Thread Mattia

I'm writing a web app with php, and would like to do the following:
when an error occures (a php/apache error or an application error) the error
is logged to a log file. The user is displayed a page that says 500 internal
server error, and nothig more. I have access to .htacces and no access to
php.ini.

i set these values

error_log logfile.txt
log_errors On
error_reporting Off

tia
Mattia




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




[PHP] Re: Displaying PDF file

2002-09-12 Thread Joseph Szobody

Ok I think it's working now. When I click the link going directly to the PHP 
script, it's displaying the PDF file in the browser appropriately. Exactly what I want.

Now some of these PDF docs are so big, they could take a while to show up if a 
client is on a slow connection. So now I want to make a 'middle' page that says 
something like 'dowloading... please be patient' while the PDF is downloading. So 
here's what I've done.

The file getpdf1.php is the following:

meta http-equiv=refresh content=0;URL=getapdf2.php
Please be patient... downloading

getpdf2.php is:

Header(Content-type: application/pdf);
$file = fopen(../pdfs/whatever.pdf,rb);
fpassthru($file);
fclose($file);

(Thanks to James for this little bit of code)

Now... if I link directly to getpdf2.php, it works great. However if I link to 
getpdf1.php, which redirects to getpdf2.php, IE show the download file dialog. This is 
NOT what I want, why is this? Weird.

Joseph


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




[PHP] unless something...

2002-09-12 Thread Magnus Solvang

I'm used to the unless-statement in perl... How do I do this:

  if string A or B are NOT in string C, then do something and quit.

In perl, I would do this:

unless ($c =~ /$a|$b/) {
  blabla
  exit 0
}

- M

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




[PHP] Read/Write Pieces of a Binary File

2002-09-12 Thread Bob Bowker

I have a large binary file (50+ megs) ... I want to read the first 1k 
bytes, make changes, and write a new file with the new 1k bytes plus the 
balance of the original file unchanged.

I've tried several different ways of doing this, but nothing works, and I'm 
out of ideas - any suggestions as to the sequence I should be following?

Thanks --

Bob.


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




[PHP] Re: local and global variables

2002-09-12 Thread Neophyte

eg ...

$var = 'value';

function myFunction($var2)
{
GLOBAL $var;
$var = $var2;
}

Skitum [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi all,

Maybe a stupid question, but i have to make it:
How can a local variable pass its value to a global one?
Is it possible?

Thanks in advance.

Peace  Love
skitum




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




[PHP] Re: whois query

2002-09-12 Thread yasin inat

Thanx   friends 




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




[PHP] Re: unless something...

2002-09-12 Thread Neophyte

if ($A != $C || $B != $C) {

I think, but im fairly new


Magnus Solvang [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm used to the unless-statement in perl... How do I do this:

   if string A or B are NOT in string C, then do something and quit.

 In perl, I would do this:

 unless ($c =~ /$a|$b/) {
   blabla
   exit 0
 }

 - M



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




[PHP] Building PHP for windows

2002-09-12 Thread Richard Black

Sorry if this question has been asked before...

Is it possible to build PHP on Windows using Borland's C++ Builder? All
the docs I've seen talk about MS Visual C++, so I wondered if that's the
only compiler that will build it. I've not seen any mention of other
compilers.

Cheers,

Richy

==
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED] 


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




[PHP] OT - SQL string to get value by latest date only in a join

2002-09-12 Thread Merritt, Dave

All,

I apologize up front for being off topic, but I don't want to have to
subscribe to other lists unless necessary.  I know that someone on this list
should be able to help me out.

I have the SQL string below that I am running.  The problem I'm having is
that the history table being called in the join has multiple entries
referencing back to the single entry in the customer table.  What I want to
be able to do is return only the latest/newest entry by date in the history
table and not older entries.  I assume that I need to add some conditional
to the outer join.  The problem I have is that I don't know what the
conditional would be to allow returning the latest row by date.

Thanks in advance, and again I apologize for the OT question,

Dave Merritt
[EMAIL PROTECTED]

currently running this string:

SELECT customer.customer_id, customer.customer_name,
business_unit.business_unit, customer.created_date, CONCAT_WS(, ,
username.last_name, username.first_name), history.modify_date, CONCAT_WS(,
, modified.last_name, modified.first_name), history.description
FROM `customer` 
LEFT OUTER JOIN `business_unit` ON business_unit.bu_id = customer.bu_id 
LEFT OUTER JOIN `username` ON username.user_id = customer.creator_id 
LEFT OUTER JOIN `history` ON ( history.item_id = customer.customer_id  AND
history.module_id = 1003 )
LEFT OUTER JOIN `username` AS modified ON modified.user_id =
history.modifier_id 
WHERE customer.customer_id LIKE %man% 
OR customer.customer_name LIKE %man% 
OR customer.created_date LIKE %man% 
OR business_unit.business_unit LIKE %man% 
OR username.first_name LIKE %man% 
OR username.last_name LIKE %man% 
OR history.modify_date LIKE %man%
OR history.description LIKE %man%
OR modified.first_name LIKE %man% 
OR modified.last_name LIKE %man% 
ORDER BY customer.customer_name

which returns the following results:

'1040','Allmand Bros. Inc.','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','2002-11-12 10:53:23','Burnstingle,
Robert','Additional changes made','1003',
'1040','Allmand Bros. Inc.','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','2002-11-09 13:15:34','Merritt, Dave','A test of
history','1003',
'1050','Ameritool Manufacturing','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL',
'1053','Ammann-Yanmar','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL',
'1065','Art's Way Manufacturing','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL', .


What I'm trying to achieve is the above results both with only one row
returned for the 1040 item like so, and the row returned should be the row
with the latest/newest modified date:

1040','Allmand Bros. Inc.','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','2002-11-12 10:53:23','Burnstingle,
Robert','Additional changes made','1003',
'1050','Ameritool Manufacturing','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL',
'1053','Ammann-Yanmar','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL',
'1065','Art's Way Manufacturing','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL', .




**
Any views, opinions or authorizations contained in this email are solely those of the 
author and do not necessarily represent those of ArvinMeritor, Inc. If you are not 
familiar with the corporate authority of the author, please obtain confirmation in 
writing 
of the content of this email prior to taking any action on the basis of the 
information. If 
you are not the intended recipient, you are hereby notified that any disclosure, 
copying 
or distribution of the information enclosed is strictly prohibited. 
**


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




RE: [PHP] OT - SQL string to get value by latest date only in a join

2002-09-12 Thread Jay Blanchard

[snip]
SELECT customer.customer_id, customer.customer_name,
business_unit.business_unit, customer.created_date, CONCAT_WS(, ,
username.last_name, username.first_name), history.modify_date, CONCAT_WS(,
, modified.last_name, modified.first_name), history.description
FROM `customer`
LEFT OUTER JOIN `business_unit` ON business_unit.bu_id = customer.bu_id
LEFT OUTER JOIN `username` ON username.user_id = customer.creator_id
LEFT OUTER JOIN `history` ON ( history.item_id = customer.customer_id  AND
history.module_id = 1003 )
LEFT OUTER JOIN `username` AS modified ON modified.user_id =
history.modifier_id
WHERE customer.customer_id LIKE %man%
OR customer.customer_name LIKE %man%
OR customer.created_date LIKE %man%
OR business_unit.business_unit LIKE %man%
OR username.first_name LIKE %man%
OR username.last_name LIKE %man%
OR history.modify_date LIKE %man%
OR history.description LIKE %man%
OR modified.first_name LIKE %man%
OR modified.last_name LIKE %man%
ORDER BY customer.customer_name
[/snip]

Try this;

SELECT customer.customer_id, customer.customer_name,
business_unit.business_unit, customer.created_date, CONCAT_WS(, ,
username.last_name, username.first_name), MAX(history.modify_date),
CONCAT_WS(,
, modified.last_name, modified.first_name), history.description
FROM `customer`
LEFT OUTER JOIN `business_unit` ON business_unit.bu_id = customer.bu_id
LEFT OUTER JOIN `username` ON username.user_id = customer.creator_id
LEFT OUTER JOIN `history` ON ( history.item_id = customer.customer_id  AND
history.module_id = 1003 )
LEFT OUTER JOIN `username` AS modified ON modified.user_id =
history.modifier_id
WHERE customer.customer_id LIKE %man%
OR customer.customer_name LIKE %man%
OR customer.created_date LIKE %man%
OR business_unit.business_unit LIKE %man%
OR username.first_name LIKE %man%
OR username.last_name LIKE %man%
OR history.modify_date LIKE %man%
OR history.description LIKE %man%
OR modified.first_name LIKE %man%
OR modified.last_name LIKE %man%
GROUP BY customer.customer_name
ORDER BY customer.customer_name

Note the MAX(history.modify_date) in the SELECT and the GROUP BY
customer_name

HTH! Peace ...

Jay



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




[PHP] Help with pattern matching.

2002-09-12 Thread Will

Hi,
 
I'm looking for somebody to give me a hand to create some expressions to
extract my information out of an ebay auction page. So that I can manage
them more effectively. 
I've try lost of patterns but can't seem to get the hang of it. 
 
Is there anybody willing to lone their brain to a php newbie before my
computer gets both barrels?
 
Thanks
 
Will



RE: [PHP] Windows Authoring Tools

2002-09-12 Thread Dave at Sinewaves.net


snip
In the past I've been using TextPad and UltraEdit but really want
something that picks up on PHP syntax and function spelling (eg
Homesite would 'bold' a function word if it was splt correctly).
/snip


Just download the PHP syntax file for TextPad.

Dave




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




[PHP] Need help with PDFlib under Linux

2002-09-12 Thread Cameron Thorne

First some background.  I have two servers:
1) Windows XP with Apache 1.3.26 and PHP 4.2.2
2) GNU/Linux with Apache 1.3.26 and PHP 4.2.3 compiled in statically

Both are working well, but I now want to add PDFlib support to both servers.
On the win32 machine it was as easy as uncommenting out php_pdf.dll line in
php.ini and it was working great.

What is the best/easiest way to get PDFlib working on my Linux server?  I
don't have PDFlib itself installed on EITHER system (other than the
precompiled DLL on Windows).  Does the PHP source come with all the code
necessary to compile php_pdf.so or do I need to install PDFlib, libtiff,
libjpeg, libpng, libzall from their respective sources in order to do
this?

Thanks.

-- Cameron




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




Re: [PHP] Windows Authoring Tools

2002-09-12 Thread Geoff Hankerson

jEdit is nice
www.jedit.org

Seán Dillon wrote:

As an fan of Homesite for many years I'm a little annoyed I can
no-longer purchase the product seperately, so am going to be
stuck with v5.0 as I don't fancy the idea of forking out
for Dreamweaver MX.

I'm looking for (hopefully) a GNU/GPL Open source product that
supports PHP syntax (and preferably with support for additional
languages with ad-ins or plugins).

Currently I'm looking at HTML-Kit (http://www.chami.com/html-kit/)
which seems to come with a vast array of add-ins and seems very
'extensible'.

In the past I've been using TextPad and UltraEdit but really want
something that picks up on PHP syntax and function spelling (eg
Homesite would 'bold' a function word if it was splt correctly).

I'd be interested to hear what others are using so I can take a
look at them before I change my main authoring product.

Seán

--
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] can you recommned a simple banner rotator in PHP

2002-09-12 Thread Peter J. Schoenster

Hi,

I've got a customer who needs a banner rotation system. I don't want to 
recreate any wheels and I'm tryin to avoid a lot of research.

I'd like one that doesn't use globals, it uses PEAR classes and preferably 
uses the Smarty template system or another template system, or you've used 
it and it works like a charm :) I would like something that has some statistics, 
works with MySQL, but they'd prefer a freebie or low cost. They don't need a 
super duper package at this time.

Thanks,

Peter

http://www.coremodules.com/
Web Development and Support  at Affordable Prices
901-757-8322[EMAIL PROTECTED]




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




RE: [PHP] Re: unless something...

2002-09-12 Thread Johnson, Kirk

There is no 'unless' in PHP, so you just have to grind it out. If you are
searching for known strings, rather than string *patterns*, use the strstr()
function here: http://www.php.net/manual/en/function.strstr.php.

So, something like:

if(!strstr($c,$a)  !strstr($c,$b)) {
  bla;
  exit;
}

Completely untested ;) If you are looking for patterns, see preg_match(),
linked to from the link above.

Kirk

 Magnus Solvang [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I'm used to the unless-statement in perl... How do I do this:
 
if string A or B are NOT in string C, then do something and quit.
 
  In perl, I would do this:
 
  unless ($c =~ /$a|$b/) {
blabla
exit 0
  }

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




RE: [PHP] Re: unless something...

2002-09-12 Thread David Buerer

True, but isn't unless just a negated while?


q.e.d.

while ($c==$a OR $c==$b) 
{
  blabla
  exit 0
}


-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 10:28 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: unless something...


There is no 'unless' in PHP, so you just have to grind it out. If you are
searching for known strings, rather than string *patterns*, use the strstr()
function here: http://www.php.net/manual/en/function.strstr.php.

So, something like:

if(!strstr($c,$a)  !strstr($c,$b)) {
  bla;
  exit;
}

Completely untested ;) If you are looking for patterns, see preg_match(),
linked to from the link above.

Kirk

 Magnus Solvang [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I'm used to the unless-statement in perl... How do I do this:
 
if string A or B are NOT in string C, then do something and quit.
 
  In perl, I would do this:
 
  unless ($c =~ /$a|$b/) {
blabla
exit 0
  }

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




RE: [PHP] Re: unless something...

2002-09-12 Thread Johnson, Kirk

Indeed, it is a negated something or other.

 -Original Message-
 From: David Buerer [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 12, 2002 11:23 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: [PHP] Re: unless something...
 
 
 True, but isn't unless just a negated while?

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




RE: [PHP] can you recommned a simple banner rotator in PHP

2002-09-12 Thread Seán Dillon

 -Original Message-
 From: Peter J. Schoenster [mailto:[EMAIL PROTECTED]]

 Hi,

 I've got a customer who needs a banner rotation system. I don't want to
 recreate any wheels and I'm tryin to avoid a lot of research.

Have a look at phpAdsNew
http://sourceforge.net/projects/phpadsnew/

Seán


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




[PHP] Problem updating post on a basic weblog system

2002-09-12 Thread Jesse Lawrence

Hello all,

I've got a bit of a code problem that's been baffling
me for a while now.

I'm working on a basic weblog system for personal use,
using MySQL.  I've got the new post and delete a
post aspects working fine, but for some reason, I
can't get the update a post part happening.  

What happens is I select a post to update, and then
the post comes up in a textarea box.  You then make
your update, and submit.

Doing this calls the following function:

 function updateBlog($input,$edit_blog) { 


 include 'db_connect.php';
$update_query = update $table set blog='$input'
where id='$edit_blog';
if(mysql_db_query ($database, $update_query,
$link)) {
   print Successfully Edited!!;
}else{
print no;

}   

 The variables being passed to the function are:
  $input = The body of the post
 and
  $edit_blog =  id # of post

At this point everything appears to have been a
success.  The Successfully Edited!! confirmation
appears, and everything seems fine, but when I look at
my database, nothing has been updated or changed in
any way.

Does anyone have any suggestions or help they could
lend me?  I've been facing this problem for a while
now, and can't seem to get my head around it.

You can view the entire code here:
http://soniceast.d2g.ca/~jalaw/blog/admin.txt

Thanks a bunch for any help,

Jesse Lawrence
 

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] mysql_query() mail() - something weird is going on !

2002-09-12 Thread Chris Knipe

Lo all,

I get a timeout on line 523 of my code (posted and marked below).  However,
I fail to see where the timeout is occurring, and even debugging
(mysql_error()) doesn't report anything wrong!

I'm baffled as to what exactly is causing this timeout  The code is
currently on Apache (Win32) with PHP 4.2.3.  When I move the code over to a
*nix system, it works perfectly via sendmail_path in php.ini, but when it
calls the SMTP server via a remote address, it fails.

The mail server's exim-3.36, receiver and sender verification has been
turned off.  The mail does go through the mail server.  I also tried
bouncing the messages through a local Exchange server, and the result of
this, is that the email get's additional headers that becomes part of the
body!

Line 523 is indicated with a **

SNIP
// Insert the Technical Administrator's details into the Database as the
Company
// Administrator.
$MakePassword = new GeneratePassword(16,5);
$Password = $MakePassword-makePassword();

$SQL  = INSERT INTO CompanyContacts (ContactActive, CompanyID, ;
$SQL .= ContactName, IDNumber, EMailAddress, CellNumber, Password)
VALUES ('1', ';
$SQL .= mysql_escape_string($CompanyID) . ', ' .
mysql_escape_string($_POST['TechName']) . ', ';
$SQL .= mysql_escape_string($_POST['TechID']) . ', ' .
mysql_escape_string($_POST['TechEMail']) . ', ';
$SQL .= mysql_escape_string($_POST['TechCell']) . ', PASSWORD(' .
mysql_escape_string($Password) . '));;
$TechRegisterSQL = mysql_query($SQL) or die(mysql_error());

// Mail the login details for the Company Administrator, Redirect him to
the login
// page, and we're done!.
$msg = ;
$msg .= Dear  . $_POST['TechName'] . ,\n;
$msg .= \n;
$msg .= Below follows your login details for MegaMonitor.  As the
registrar of\n;
$msg .=  . $_POST['CompanyName'] . ,\n;
$msg .=  you have been given the rights of Company Administrator.\n;
$msg .= \n;
$msg .= This allows you to log in at the MegaMonitor web site, and add
further\n;
$msg .= configurations for your company.  These may include account
contacts, \n;
$msg .= technical contacts, time periods, service checks, and
everything else \n;
$msg .= needed to setup monitoring for your company.\n;
$msg .= \n;
$msg .= You also may request for any number of additional services from
MegaLAN\n;
$msg .= Corporate Networking Services, including access to a wider
spectrum of\n;
$msg .= monitoring by purchasing more licenses for IP addresses.\n;
$msg .= \n;
$msg .= MegaLAN Corporate Networking Services also will be offering
other\n;
$msg .= excellent value added services over the not to distant future.
We are\n;
$msg .= hard at work to get these up and running, and as a client, we
will notify\n;
$msg .= you when they become available.  Some of these services
include:\n;
$msg .= \n;
$msg .=   - MegaMAIL, a e-mail virus scanning service for corporates.
We scan all\n;
$msg .=   in and outgoing e-mails on your behalf to ensure
your company\n;
$msg .=   does not get infected with viruses via
e-mail.\n;
$msg .=   - MegaDNS,  a DNS hosting and administrating service for
corporates,\n;
$msg .=   where we will provide access to DNS
administrative tools, as\n;
$msg .=   well as secondary domain hosting - free of
charge.\n;
$msg .= \n;
$msg .= To log in to MegaMonitor and configure your company's profile,
please visit\n;
$msg .= http://www.imadethis.co.za/login.php\n;;
$msg .= \n;
$msg .= Your Username:  . $_POST['TechEMail'] . \n;
$msg .= Your Password:  . $Password . \n;
$msg .= \n;
$msg .= You may change your password at anytime via our administrative
interface on\n;
$msg .= our web site.\n;
$msg .= \n;
$msg .= Thank you for your interest in MegaMonitor, and we hope we will
benefit\n;
$msg .= your company tremendously.\n;
$msg .= \n;
$msg .= MegaLAN Customer Support.\n;
$msg .= \n;
mail($_POST['TechEMail'], MegaMonitor Registration Details, $msg,
 From: MegaLAN Customer Support [EMAIL PROTECTED]\r\n);

// Mail everything to MegaLAN support for confirmation.
// Look up the bank name in the Database.
**$BankQuery = mysql_query(SELECT BankName FROM GlobalBankNames WHERE
BankID=' . mysql_escape_string($_POST['BankInstitution']) . ';) or die
(mysql_error());
while ($BankList = mysql_fetch_array($BankQuery)) {
  $BankLongName = $BankList['BankName'];
}
if ($_POST['BankAccountType'] == 3) {
  $BankAccountTypeLong = Cheque Account;
} elseif ($_POST['BankAccountType'] == 2) {
  $BankAccountTypeLong = Transmission Account;
} elseif ($_POST['BankAccountType'] == 1) {
  $BankAccountTypeLong = Savings Account;
} else {
  // We should never get this!!!
  $BankAccountTypeLong = Error - Confirm with Client;
}

$msg  = ;
$msg .= New 

[PHP] Processing PHP in Template File

2002-09-12 Thread [-^-!-%-


Hello everyone.

I want to implement templates in a site, but am having trouble processing
php within the template file. The application flow is as follow:

-open the template file (which has some place holders) with
$fileHandler =  file($file_name)

-Replace placeholders (within the template files) with
 $fileHandler = ereg_replace(--PlaceHolder--,New content,$Handler)
 //disregard syntax errors...

-Then display the content of the modified template
 $fileHandler = implode('',$fileHandler)
 echo $fileHandler;


The above process works, as far as replace the place holders, and printing
the new content (which is an HTML file). However, it will not process PHP
scripts, within the template.

For example, if my template has

html
 ..
body

   ?php
 echo hello!;
   ?
pblah blah blah
/body
/html

the above process will display the PHP code within the HTML file, without
processing.

How can I process the PHP codes that's in the template?


-john



=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.



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




Re: [PHP] Processing PHP in Template File

2002-09-12 Thread Chris Boget

 The above process works, as far as replace the place holders, and printing
 the new content (which is an HTML file). However, it will not process PHP
 scripts, within the template.

If it's really a template, why does it have PHP scripts within?  Why not just
replace those scripts with place holders and process as you would normally?

Chris



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




[PHP] HELP - fwrite(...PHP code...)

2002-09-12 Thread Hankley, Chip

I have an application where I need to write PHP code to a file that will be
used later...but it's not working the way I'd expect.

When I issue the following:

fwrite($fp, ? echo $LayerScale);

If $LayerScale is defined, then fwrite outputs the value of $LayerScale to
the target, NOT the string $LayerScale.

How can I overcome this?

Chip

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




Re: [PHP] Processing PHP in Template File

2002-09-12 Thread Support @ Fourthrealm.com

John

Include your template this way:

$file_name=templates/somefile.php
$New_Content1 = 'This is the new text';
$New_Content2 = 'This is the other text';
include $file_name;


In the template file, have ?php echo $New_Content; ? etc wherever the 
content should appear.

Then you can put other php code in the template file as well.

I use this all the time.


Peter


At 12:00 PM 9/12/2002 -0700, you wrote:

Hello everyone.

I want to implement templates in a site, but am having trouble processing
php within the template file. The application flow is as follow:

-open the template file (which has some place holders) with
$fileHandler =  file($file_name)

-Replace placeholders (within the template files) with
  $fileHandler = ereg_replace(--PlaceHolder--,New content,$Handler)
  //disregard syntax errors...

-Then display the content of the modified template
  $fileHandler = implode('',$fileHandler)
  echo $fileHandler;


The above process works, as far as replace the place holders, and printing
the new content (which is an HTML file). However, it will not process PHP
scripts, within the template.

For example, if my template has

.. ?php echo hello!; ?

blah blah blah
the above process will display the PHP code within the HTML file, without
processing.

How can I process the PHP codes that's in the template?


-john



=P e p i e  D e s i g n s
  www.pepiedesigns.com
  Providing Solutions That Increase Productivity

  Web Developement. Database. Hosting. Multimedia.



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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] HELP - fwrite(...PHP code...)

2002-09-12 Thread Chris Wesley

On Thu, 12 Sep 2002, Hankley, Chip wrote:

 fwrite($fp, ? echo $LayerScale);
 If $LayerScale is defined, then fwrite outputs the value of $LayerScale to
 the target, NOT the string $LayerScale.
 How can I overcome this?

fwrite($fp, ? echo \$LayerScale);

g.luck,
~Chris


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




  1   2   >