RE: [PHP] Displaying Multidimensional Arrays

2003-08-25 Thread Chris W. Parker
Jason Williard 
on Monday, August 25, 2003 2:00 PM said:

> Would anyone be able to offer some assistance on this front?

Sure... if you give us more info. (i.e. maybe the array layout?)



c.

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



[PHP] verifying sql INSERTs

2003-08-25 Thread Chris W. Parker
Hi!

(MySQL)

What's the best way to determine a sql INSERT statement has executed
successfully?

What I've got is a function whose sole purpose is to add new staff
members to an app. I've written. There's a basic form that the user
fills out (first name, last name, email address) and submits. Only one
record per email address is allowed.

Here is a pseudo code version of what I have right now.

function insertStaffer($fname, $lname, $email)
{
$sql = "SELECT table WHERE email = '$email'";

if(1 or more records are found)
{
return 0; // means email address is already used
}
else
{
$sql = "INSERT INTO table ...";

return 1; // assume record inserted correctly
}
}

Now for my question: Should I just assume the INSERT INTO has worked
correctly (like I'm currently doing) and return a 1? Or should I verify
that the INSERT worked correctly (by using the MySQL last_insert_id()
function)?

Alternatively... maybe the mysql_query() function returns a true/false
status based on what happens? Hmm... I should look into that.


I'd appreciate any advice you have to give.


Thanks,
Chris.

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



RE: [PHP] Problem with date('w')

2003-08-25 Thread Jennifer Goodie
> I have a problem with the date function
>
>   $theday = date("Y-m-d", time());
>   echo date((w), $theday);
> ?>

I'm pretty sure the optional second argument for date is a unix timestamp
that you would generate by using either time or mktime or strtotime.  You
are passing it something in the form of Y-m-d, or 2003-08-23 when it is
expecting 1061852640.
http://www.php.net/manual/en/function.date.php

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



RE: [PHP] [Newbie Guide] For the benefit of new members

2003-08-25 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Monday, August 25, 2003 5:11 AM said:

> 5. Provide a clear descriptive subject line. Avoid general subjects
> like "Help!!", "A Question" etc.

Change to:

5. Provide a clear descriptive subject line. Avoid general subjects like
"Help!!", "A Question", etc. Especially avoid blank subjects. Many
people see this as rude and will ignore your mail outright, myself
included.


(Does it make sense to put "urgent help needed!" in your subject? Isn't
everyone's email "urgent" to one degree or another?)

8. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question.


.02

Chris.

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



RE: [PHP] ob_start and transparent sessions 4.3.2

2003-08-25 Thread Wouter van Vliet
Hi,

I too am running PHP4.3.2 and never took any notice about the session id's
being appended and stuff .. after reading your message I got a little
alarmed, since I'm also using output buffering. So, I turned off my cookies,
restarted my browser and saw that indeed no session id's were appended. Now,
when I checked php.ini, the value appeared to be '0'. That was quite an
explanation. I changed it to '1' and it all worked.

Maybe this makes your problem a little weirder.. But the problem is not on
the PHP version. You might want to check if session.use_trans_sid is really
set to 'On'. If it is, try changing it to '1', restart apache and see if it
works now. Also, check if your cookies are turned off, since with them
turned on, there's no need for php to add the session ID and thus it won't
happen.

Wouter

 -> -Oorspronkelijk bericht-
 -> Van: Miek Lohmann [mailto:[EMAIL PROTECTED]
 -> Verzonden: vrijdag 22 augustus 2003 18:41
 -> Aan: [EMAIL PROTECTED]
 -> Onderwerp: [PHP] ob_start and transparent sessions 4.3.2
 ->
 ->
 -> Hi,
 ->
 -> I've got a strange problem with enabled transparent sessions
 -> for my scripts.
 -> Before upgrading to PHP 4.3.2 I could use output buffering
 -> (ob_start()) and
 -> sessions without problems. Meanwhile with this new version the
 -> PHPSESSID is
 -> NOT appended to any link like html - tag (a href or something
 -> like that).
 ->
 -> I found a solution by writing my own session-handling and using regular
 -> expressions to append the session-id to any link, after outputting the
 -> content of the buffer, but this is not a really good solution, I think.
 ->
 -> (Btw. session.use_trans_id is on ;))
 ->
 -> Has someone found a solution or has had an equal problem with 4.3.2?
 ->
 ->
 ->
 -> Thanks.
 ->
 -> Mike
 ->
 ->
 -> Mike Lohmann
 ->
 -> [werk01]
 ->
 ->
 ->
 ->
 -> --
 -> 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] Window.status message

2003-08-25 Thread Chris W. Parker
murugesan 
on Monday, August 25, 2003 1:51 AM said:

> echo "Click here ";

Google* is your friend

http://hotwired.lycos.com/webmonkey/96/40/index3a.html?tw=programming


Chris.


* search terms used were "window.status"

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



[PHP] ob_start and transparent sessions 4.3.2

2003-08-25 Thread Miek Lohmann
Hi,

I've got a strange problem with enabled transparent sessions for my scripts.
Before upgrading to PHP 4.3.2 I could use output buffering (ob_start()) and
sessions without problems. Meanwhile with this new version the PHPSESSID is
NOT appended to any link like html - tag (a href or something like that).

I found a solution by writing my own session-handling and using regular
expressions to append the session-id to any link, after outputting the
content of the buffer, but this is not a really good solution, I think.

(Btw. session.use_trans_id is on ;))

Has someone found a solution or has had an equal problem with 4.3.2?



Thanks.

Mike


Mike Lohmann

[werk01]




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



[PHP] Re: how to keep decimals from rounding

2003-08-25 Thread DvDmanDT
use floor(), I think that rounds it down... ceil() rounds it up...

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
"Rob Yelvington" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Is there a way to surpress round() or number_format() from rounding
> decimal places?
>
> I have a value of ".253338" being returned via a calc function.
>
> I take that value and multiply by 100 because I want "25.333" to be
> displayed.
>
> I've used round(), sprintf(), and number_format() and each of them
> rounds the value up.
>
> I had a problem with precision earlier which I solved...my 'precision'
> setting in php.ini was set too low.  Is there something in php.ini that
> controls rounding?
>
> Any heads up are appreciated!
>
> Thanks,
>
> ~Rob

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



[PHP] preg_match bug

2003-08-25 Thread Christian Calloway
Hey I wanted to see if anyone was getting the same problem. Using preg_match
in the following pattern:

"/(.|\n)+?<\/tr>/"

PHP seems to be crashing. I get a "Page cannot be displayed" message from
the browser. I've come across this before, and I just upgraded to 4.3.3, and
no difference.

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



[PHP] Displaying Multidimensional Arrays

2003-08-25 Thread Jason Williard
I am trying to create a function that will take a multidimensional array and
turn it into a form based off the information in the array.  I have run into
a bit of a road block when it comes to displaying the array.  Would anyone
be able to offer some assistance on this front?

 - Jason

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



[PHP] Uploading by email

2003-08-25 Thread Wouter van Vliet
Hi,

I know it's slightly not totally about PHP.. but since I wanna do it with
PHP, i'll post it here. I was wondering if anybody can help me to accomplish
the following:

- Somebody sends an email to, for example, [EMAIL PROTECTED] This
email has some attachments, being photo's to be added to some system.
- Sendmail recievers the email, and sends it to some PHP script
- This script parses the input it gets, ...

Now, what would I need to do for all this to happen?
Wouter

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



[PHP] PHP permissions problem

2003-08-25 Thread Lowell Allen
My commercial host is set up with the public root directory, "public_html",
owned by user: userid, group: nobody. Directories I create within
public_html are owned by user: userid, group: userid. As a result, PHP does
not have permission to create files or write to files in public_html, but it
does within its subdirectories.

Is this a common setup? Are there security problems with changing the
ownership of public_html to user: userid, group: userid so PHP can create
files within the root directory? Advice, opinions, and links to relevant
information are requested.

PHP 4.3.2/Linux/Apache 1.3.28

--
Lowell Allen

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



[PHP] how to keep decimals from rounding

2003-08-25 Thread Rob Yelvington
Is there a way to surpress round() or number_format() from rounding 
decimal places?

I have a value of ".253338" being returned via a calc function.

I take that value and multiply by 100 because I want "25.333" to be 
displayed.

I've used round(), sprintf(), and number_format() and each of them 
rounds the value up.

I had a problem with precision earlier which I solved...my 'precision' 
setting in php.ini was set too low.  Is there something in php.ini that 
controls rounding?

Any heads up are appreciated!

Thanks,

~Rob

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


Re: [PHP] "back" works in opera but not in internet explorer

2003-08-25 Thread Eric Wood
To fix this, I put:

  session_cache_limiter ('private, must-revalidate');

at the beginning of all my pages.  Seems to work.

-eric wood


anders thoresson wrote:
> When I push the back buttom in Opera, I get back to the previous
> (database/php-generated) page in my site, but when I'm using IE and
> push back, I get a message saying that the page isn't valid any more.
> 
> Is this an internal IE-issue, or could I make my php-script
> IE-friendly? 
> 
> --
> anders thoresson

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



php-general Digest 25 Aug 2003 19:14:55 -0000 Issue 2258

2003-08-25 Thread php-general-digest-help

php-general Digest 25 Aug 2003 19:14:55 - Issue 2258

Topics (messages 160645 through 160677):

Re: Unable to get the values in next page
160645 by: murugesan
160646 by: Cody Phanekham
160654 by: murugesan
160657 by: murugesan

Use PHP or MySQL
160647 by: Sid

include () problems
160648 by: Mjec
160676 by: Jim Lucas

Re: Reading an MS Access Database file on *NIX platform using PHP
160649 by: Ernest E Vogelsinger
160662 by: Wouter van Vliet

ob_start and transparent sessions 4.3.2
160650 by: Miek Lohmann

php5 and mysql
160651 by: Harry Wiens

Window.status message
160652 by: murugesan

window.status
160653 by: murugesan

Problem with date('w')
160655 by: BEOI 7308
160661 by: Danielle van Gladbach

Unix end of line versus windows end of line
160656 by: Bohdan Blaha

[Newbie Guide] For the benefit of new members
160658 by: tech.leatherlink.net

Re: CMS question.
160659 by: Jay Blanchard
160666 by: Edmond Baroud

Re: mail() question
160660 by: Matthias Wulkow
160671 by: Alister

Re: In need of a script
160663 by: Jason Sheets

PHP 4.3.3 released
160664 by: Ilia Alshanetsky

Cookie saving path on Clinet
160665 by: Binay Agarwal

Re: How to open random Flash page with hyperlink?
160667 by: Curt Zirzow

Re: script not terminating on user abort
160668 by: Dennis Jacobfeuerborn

Re: HTML form handling
160669 by: sven

Recursive Object Troubles
160670 by: Joshua Groboski

Session problem in back button
160672 by: murugesan

mysql or php timestamp arithmatic
160673 by: Christian Calloway

Re: Use PHP or MySQL for MD5 function
160674 by: Daevid Vincent

querystring and frameset issue
160675 by: Irvin Amoraal

HIPAA EDI X12 stuff?
160677 by: Richard Lynch

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
Thanks for the reply.Actually I don't know that I have to include the
start_session in every page.
I GOT it ATLAST.

Regards
-murugesan.


- Original Message -
From: "Cody Phanekham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 12:26 PM
Subject: [PHP] RE: Unable to get the values in next page


> main.php
> -
> echo $failed;// this is null here
> ->

did you start the session in main.php before "echo $failed;"? eg



> -Original Message-
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 25 August 2003 16:46
> To: Cody Phanekham; [EMAIL PROTECTED]
> Subject: Unable to get the values in next page
>
>
> I did as what you said. But the problem now is that I am not
> able to get the
> values in the next page.
>
> index.php
> --
> session_name("mysessionname");
> session_start();
> --->
>
> auth.php
> -
> $failed="yes";
> session_register('failed');
> header ("Location: /main.php");
> ->
>
> main.php
> -
> echo $failed;// this is null here
> ->
>
> What might be the problem ?
>
> Thanks in advance,
> Murugesan.
>
>
>
> > Murugesan,
> >
> > I'll assume your redirecting the user to main.php because
> (s)he has passed
> > the authentication routine... in that case just store the
> username and
> > password as a session variable that way you wont need to
> pass the username
> > and password via the url.
> >
> > auth.php, [just before the call to header()]:
> >  >   session_register('empid');
> >   session_register('pwd');
> >   header ("Location: /main.php");
> > ?>
> >
> > then in main.php you need to start your session to access
> the session
> > variables
> >  >   session_name("yoursessionname");
> >   session_start();
> >   // you now have access to $empid and $pwd
> >   echo "your employee id = $empid and the password you typed was
> $pwd";
> > ?>
> >
> >
> > > -Original Message-
> > > From: murugesan [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, 25 August 2003 15:18
> > > To: Cody Phanekham; [EMAIL PROTECTED]
> > > Subject: Re: [PHP] How to open random Flash page with hyperlink?
> > >
> > >
> > > Thanks for the information.
> > > In the code you provided
> > >
> > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > >  {
> > >   .
> > >
> > > Actually I have implemented this in a separate page.
> > >
> > > That is upon sign up of the  in the index page
> > > I call a new page auth.php
> > > In that file
> > > I have done this authentication and called the function
> > > header ("Location: /main.php?empid=$empid&pwd=$pwd");
> > >
> > > Actually when passing this URL the password appears in the
> > > address bar.
> >

[PHP] HIPAA EDI X12 stuff?

2003-08-25 Thread Richard Lynch
I don't suppose anybody has any HIPAA stuff implementing something like:
ASC X12N 270/271 (004010X092) or its subsequent standards in PHP?...

Email off-list if you have any idea what I'm talking about, since *I*
don't even want to really do this, so I doubt too many others are
interested...

What I *really* want is to just curl POST to their web-server, or
something similar, but I've been bounced through 4 different
departments/people, and am reduced to reading the 270/271 specs for "fun"
while waiting for them to give me a single straight answer.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] include () problems

2003-08-25 Thread Jim Lucas
If you are having a problem that tells you that output was displayed on a
given line in a given file.  And you found this because after the output you
tried sending headers, then look in that file on that given line, and you
will see the problem.

It could be a simple as a

?>


To: <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 12:56 AM
Subject: [PHP] include () problems


> Hi,
>
> When I run the line:
>
> include ("fnord.php");
>
> with the file looking like:
>
>  define ("fnord_included", true);
> function fnord ($arg = true) {
>
> // 450 lines
> return $msg;
>
> }
> ?>
>
> it prints out the return of fnord() (i.e. $msg).  I've checked, and
there's
> no echo or print statemetns anywhere...
>
> Oh, yeah, FYI, the pattern goes like this:
>
> file: index.php
> 
> file: standard.php
>  ("Content-type: text/html; encoding=utf-8"); ?>
>
> and it prints it right up the top of index.php, causing an error with the
> "header" statement (although it says the error is in fnord.php - which
> contains NO header statemtns).
>
> ideas?
>
> Regards,
>
> mjec
>
> -- 
> 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] querystring and frameset issue

2003-08-25 Thread Irvin Amoraal
Can somebody tell me how to pass a value between two php pages within a
frameset.

I have a simple two column framset: navbar on the left, content on the
right.

I have two pages that are displayed in the content area. Both are PHP pages.
I would like to pass an ID value from the first page(a list page) to the
second (a detail page). I tried renaming the frameset page and associated
links with a php extention but that didn't work.

The link from the list page does contain the ID var in the querystring but
it is not recieved in the display page where I try to echo the querystring
var.

Any ideas?
Does the frameset page need to have a php extention?


Thanks.

Irvin <><

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



RE: [PHP] Use PHP or MySQL for MD5 function

2003-08-25 Thread Daevid Vincent
Well, IMHO it's better to use PHP. My reasoning is this: you want to hit the
db and get out of there as quick as possible since you have limited threads.
Plus, I try to keep my code as db agnostic as possible, so that it's
portable. Having said that, if it's a quick project or something simple, I'd
probably use the mysql version just for the ease of use factor. 

If you really care, just make a program like this and do some MD5() calls in
both mysql and php to see which is faster. I'd be curious to know as well...
You'll have to modify appropriately, and only do a single MD5 check because
I think looping 1 mysql MD5 calls will be slower automatically since
there is the connection to the db and stuff to contend with, so keep that in
mind.


Daevid Vincent
http://daevid.com

--- test ---


blah 
version one: \t$time1 seconds\n";
echo "version two: \t$time2 seconds\n";
?>

 

> -Original Message-
> From: Sid [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 25, 2003 1:25 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Use PHP or MySQL
> 
> 
> Hello,
> 
> This question has been lingering in my mind for some time -
> Say we have a function such as MD5, which is available on 
> both PHP and MySQL? Which is faster - the PHP version or the 
> MySQL one. Have any benchmarks been made on this? We can use 
> the same question for say... arithmetic operations, string 
> contentation...
> 
> Thanks in advance.
> 
> - Sid 
> 

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



[PHP] mysql or php timestamp arithmatic

2003-08-25 Thread Christian Calloway
Hey everyone,

I am writing an application to keep track of employee vacation leave. I have
two timestamp(14) database fields, lets call them start and end, signifying
when start and end of a vacation leave, respectively. What I am trying to do
is get the number of hours between start and end, for example if vacation
started at 12pm on wednesday and ended at 5 pm wednesday, then the total
should be 5 hours (Of course the date ranges are going to be alot more
complicated than that). I attempted to solve this problem in the query,
using the following:

FLOOR((end-start)/3600) as hours

but the values that I am getting are wrong. For example, on what should be a
5 hour span, I am getting back the value 13. Any ideas?

Christian

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



[PHP] Session problem in back button

2003-08-25 Thread murugesan
Hello all,
Now i have a problem in back button.
After signing in when I click back button It goes to login page. But
when I click the forward button it is going to the main page.
How can I prevent this.

-murugesan

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



Re: [PHP] mail() question

2003-08-25 Thread Alister
On Mon, 25 Aug 2003 14:24:25 +0200
Matthias Wulkow <[EMAIL PROTECTED]> wrote:

> A> Did you install postfix _after_ PHP?  Did you have a sendmail
> A> binary in place before you configured PHP?  If it's not there are
> A> configure time, it won't even compile the 'mail' function.
> Yes and there was no sendmail binary before...
> 
> A> I've had the same problem before - now that PHP can recognise it's
> A> got a way to send email, re-running ./configure / make / make
> A> install should work.  It did for me.
> 
> I did that, but I forgot to do 'make clean'... now it seems to work.
> But I have still one question:
> when sending mail with this sendmail binary, is it possible to pass
> the mail to a local mail server instead of sending it directly to the
> recipient?

Thats a mail configuration issue.  Alternatively you can have the send
the email by SMTP to your primary mail server which then sends it on
from there. 

Alister

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



[PHP] Recursive Object Troubles

2003-08-25 Thread Joshua Groboski
I am building a recursive Menu object.  Inside each menu item there is an array which 
should allow me to add submenu items and so on.  I am having trouble, though, with 
getting the submenus to stay.  They are disappearing as I go along.

Here is the menu class:  (part of it anyway)

class Menu {
 var $iMenuId;
 var $iParentId;
 var $iMasterId;
 var $sMenuName;
 var $sMenuType;
 var $bStatus;
 var $vecMenu;   // <- This is the array of submenus which 
 //will each have their own submenus
 
 function Menu ($iMI, $iPI, $iMstI, $sMN, $sMT, $bS){
  $this->iMenuId   = $iMI;
  $this->iParentId  = $iPI;
  $this->iMasterId = $iMstI;
  $this->sMenuName = $sMN;
  $this->sMenuType = $sMT;
  $this->bStatus  = $bS;
  $this->vecMenu  = array();
  
 // Used as static variable since PHP4 doesn't support them.
  global $menuCount; 
  $menuCount++;
 }
 
 function bIsMaster(){
  return ($this->iMasterId == $this->iMenuId);
 }
 
 function bIsParent(){
  return ($this->iParentId == $this->iMenuId);
 }
 
 function bAddMenu(&$m) {
  
  if ($m->bIsParent() && $m->bIsMaster())
   return false;
  
  if ($this->iMenuId == $m->iParentId){
   $this->vecMenu[] = &$m;  //  <-  This is a guess.  
//  Added into vector by reference?
   return true;
  }
  
  for ($i=0; $i < count($this->vecMenu); $i++){
   $tmpMenu = $this->vecMenu[$i];
   if ($tmpMenu->bAddMenu (&$m))
return true;
  }
  
  return false; 
 }
  
 
} //END Menu Class



Should this work?  Am I just doing something completely wrong?  I know someone out 
there knows, please let me know if you have any ideas.  I really appreciate any help I 
can get.

Thanks in advance.

-- 
Joshua Groboski
Programmer Analyst
SAVVIS Communications Inc.
http://www.savvis.net

[PHP] Re: HTML form handling

2003-08-25 Thread sven
Chris Baxter wrote:
> Hi,
>
> I am trying to send the results of a form to my email account and am
> having difficulty carrying the form variable through if I use an html
> mime type.
>
> Basically, if I send the form using a plain text format, the form
> results are sucessfully copied to the email, however, if I change to
> mime type to HTML (becuase I want to include a company logo and make
> the form a little easier to read by using tabulation and bold text),
> I only seem to get the HTML, not the php variables that carry the
> from info.
>
> Below is an example of the script for the body of the email, which I
> am then sending using the mail() function:
>
> $body =  
> 
> 
>
>   Applicant 1 Forename:
>
> 
> 
>   Applicant 1 Surname:
>
> 
> 
>   Applicant 2 Forename:
>
> 
> 
>   Applicant 2 Surname: 
>
> 
> 
> 
> ;

hi chris,

okay, you try to put your html-code into a string '$body', which will be
used by mail().
but, did you look at $body before sending? i'm afraid your vars are already
missing here?
maybe you have to change your code to this:





Applicant 1 Forename:
' . $App_1_Forename . ' ...';
?>

or this:





Applicant 1 Forename:
$App_1_Forename ...";
?>

look at the quotes. which style you want to use depends on you (i prefer the
1st)

ciao SVEN

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



Re: [PHP] script not terminating on user abort

2003-08-25 Thread Dennis Jacobfeuerborn
On Mon, 2003-08-25 at 01:15, Curt Zirzow wrote:
> * Thus wrote Dennis Jacobfeuerborn ([EMAIL PROTECTED]):
> > Hi!
> > The connection_* function don't seem to work for me and I can no longer
> > determine when the user has aborted the script. When I close the browser
> > window the script just keeps running. (see bug #23163)
> > 
> > The body of the script essentially looks like this:
> > 
> > while( !$done ) {
> > $con->sendMessage("x"); # Send msg to Jabber server
> > sleep(1);
> > }
> > 
> > I made an interesting and somewhat weird observation though:
> > If I use the print or echo command in the while-loop once (!) then the
> > script will terminate after the loop has run *exactly* three times after
> > the abort.
> > 
> > If I put more than one print/echo in the loop (2->inf) then the script
> > will terminate after *exactly* 2 (!) iterations of the loop after the
> > script has aborted.
>  
> how is it your knowing the number of times it is going through the
> loop when the conneciton is aborted?

By counting the number of "x" messages I receive on the other end of the
Jabber connection.

>  If you know that the
> connection is aborted why isn't it breaking out of the loop? Do you
> have some code that can show this?
> 

this code will just continue to send "x" messages after an abort:

while( !$done ) {
$con->sendMessage("x"); # Send msg to Jabber server
sleep(1);
}

this code will send exactly 3 "x" messages after an abort:

while( !$done ) {
$con->sendMessage("x"); # Send msg to Jabber server
sleep(1);
print "foobar";
}

this code will send exactly 2 "x" messages after an abort:

while( !$done ) {
$con->sendMessage("x"); # Send msg to Jabber server
sleep(1);
print "foobar";
print "foobar"; # any additional number of print/echo commands will
do
}

I hope this helps.

regards,
  Dennis

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



Re: [PHP] How to open random Flash page with hyperlink?

2003-08-25 Thread Curt Zirzow
* Thus wrote Cody Phanekham ([EMAIL PROTECTED]):
> Murugesan,
> 
> main.php:
>  session_name("mysessionname");
> session_start();
> if (!$s_authed) // check access
> {
>   // user hasnt been authorised, therefore redirect to login page

This is exactly why register globals is turned off by default now.

This is a major security hole, I can simply put in the url:
  http://host/main.php?s_authed=1

And I would be considered authenticated, throughout the site.

Please turn register_globals off and use the $_SESSION variable to
access your session vars.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] CMS question.

2003-08-25 Thread Edmond Baroud
On August 25, 2003 08:13 am, Jay Blanchard wrote:

> What makes you think that the developer did something unethical?

It looks like you're familiar with this particular case and the developper 
happens to be your friend so you're defending him?
Anyways, I believe I said "to make a long stroy short". but if you insist on 
knowing why I said that he did something unethical (let me add to that 
"unprofessional" ); he sold an intellectual property which he was paid to 
developpe to competitors in the business.


> I have seen those small icons used by numerous developers, but I don't
> know if they are available for uncredited or uncompensated works. Other
> than that those screenshots look like dozens of packages I have seen.

Thanks for the feedback.

> Capable to upload what in a batch?

Have you ever seen anyone upload bananas or oranges on the net? the most 
obvious word that could be placed here is "files", excuse me for forgetting 
to mention it!

BTW: thanks for the your time Jay.

Ed.

-- 
Edmond Baroud 
Senior UNIX sysadmin mailto:[EMAIL PROTECTED]
Fingerprint  140F 5FD5 3FDD 45D9 226D  9602 8C3D EAFB 4E19 BEF9
"UNIX is very user friendly, it's just picky about who its friends are."

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



[PHP] Cookie saving path on Clinet

2003-08-25 Thread Binay Agarwal
Hi Everybody

I know this is vague but couldn't find the answer.

Where (i mean system path) cookies are saved on Client's machine.

I though it is in windows/temp or temporaray internet files (in win 2000) but it 
wasn't there.

Please tell me.

Thanks
Binay


[PHP] PHP 4.3.3 released

2003-08-25 Thread Ilia Alshanetsky
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

After a lengthy QA process, PHP 4.3.3 is finally out! This maintenance
release solves a fair number of bugs found in prior PHP versions and
addresses several security issues. All users are *strongly* advised to
upgrade to 4.3.3 as soon as possible.

PHP 4.3.3 contains, among others, following important fixes, additions and
improvements:

* Improved the engine to use POSIX/socket IO where feasible.
* Fixed several potentially hazardous integer and buffer overflows.
* Fixed corruption of multibyte character including 0x5c as second byte in 
multipart/form-data.
* Fixed each() to be binary safe for keys.
* Major improvements to the NSAPI SAPI
* Improvements to the IMAP extension
* Improvements to the InterBase extension
* Added DBA handler 'inifile' to support ini files.
* Added long options into CLI & CGI (e.g. --version).
* Added a new parameter to preg_match*() that can be used to specify the 
starting offset in the subject string to match from.
* Upgraded the bundled Expat library to version 1.95.6
* Upgraded the bundled PCRE library to version 4.3
* Upgraded the bundled GD library to version GD 2.0.15
* Over 100 various bug fixes!

For a full list of changes in PHP 4.3.2, see the NEWS file.
(http://www.php.net/ChangeLog-4.php#4.3.3).

md5sums:

1171d96104e2ff2cff9e19789a4a1536php-4.3.3.tar.bz2
fe3fede4115354155fc6185522f7c6b2php-4.3.3.tar.gz
c3497c394b3f5829136eb2ff614da241php-4.3.3-Win32.zip
140b98d796e81402776a133f273f0b38php-4.3.3-installer.exe

Have fun,

Ilia Alshanetsky
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/ShTMLKekh381/CERAn5VAJ9SlW4lGGwGMXGpvs2blhS8R6Sl5ACcCkPV
wWiX4ZLugm1K8xVIj2e0sKo=
=xxIX
-END PGP SIGNATURE-

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



Re: [PHP] In need of a script

2003-08-25 Thread Jason Sheets
One thing to be aware of, Location: /newpage.php will probably work with 
most browsers (I know it works with IE, Mozilla and Opera) but the spec 
requires an absolute path  to the file you are redirecting to including 
protocol, server, path and file.  As Wouter demonstrated you should 
always die() after a redirect request because it is just that, a request 
that the client is not required to follow.

Jason

Wouter van Vliet wrote:

Though no parse error, it can result in an notice about 'undefined index' ..
I'd prefer

Taking care of three things:
- No undifined index notice
- the cookie can also have a value that evaluates to false
- the 'die;' makes sure the script really ends .. sometimes, somehow for
some
  undefined reason it does not stop after a header..
Wouter

-> -Oorspronkelijk bericht-
-> Van: Curt Zirzow [mailto:[EMAIL PROTECTED]
-> Verzonden: zondag 24 augustus 2003 20:22
-> Aan: [EMAIL PROTECTED]
-> Onderwerp: Re: [PHP] In need of a script
->
->
-> * Thus wrote Stevie D Peele ([EMAIL PROTECTED]):
-> > Heres what I wrote --
-> >
-> >  > if ($_COOKIE['pagename'])
-> > {
-> > header('Location: http://www.net-riches.com/800x600.html');
-> > }
-> > ?>
-> >
-> > and I got a parse error on line 4, but I do not see what is
-> wrong on line
-> > 4!
->
-> There is no parse error in that code.
->
-> Curt
-> --
-> "I used to think I was indecisive, but now I'm not so sure."
->
-> --
-> 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] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Wouter van Vliet
So, while overnight everybody has said something about this.. Let me add a
few lines. Also because I just want to keep the discussion running, since
I'm having pretty much the same kind of situation.

First of all, what I get fro your description is that your friend wants to
make changes to access 'offline'. That means: when he's not connected to the
server that should parse the MS Access file. Makes me believe that he will
have to upload the Access file to the server which parses it. Even though
there's huge bandwidths nowadays, that's really not what you want for a ms
access file. Those fella's get HUGE.

I'd suggest you use XML for the talking. Haven't tried it yet, but I know
there's VB functions availabel within MS Access to save the data from a
table to XML. Then, almost any language can read PHP and thus parse it.
Other benefits are that there's just one button to click on, and the
interface will create XML files for all of your tables. Those files will
always be smaller than your MS Access file, since the latter also has
queries, forms and a lot of kbytes nobody knows where they come from.

As for what I'm running into is this. The frontend for the database is MS
Access, the data comes from PostgreSQL (using PosgresODBC to connect) and
there are four possible places where the user can access and make changes to
the database.
- 1+2: Connected to the server, using SAMBA to access the filesystem
- 3+4: Locations where there's no internet connection whatsoever whil
  editting. Data syncing happens over a swappable harddisk.

Any ideas what might be the best way to handle it. On each location edits
and additions are possible, on data should ever get lost for any reason
thinkable and thus all changes made at any place should get into the main
PostgreSQL server.

Hoping to have helped and to recieve help in return I am saluting you all :D
Wouter

 -> -Oorspronkelijk bericht-
 -> Van: Weston Cann [mailto:[EMAIL PROTECTED]
 -> Verzonden: maandag 25 augustus 2003 3:18
 -> Aan: [EMAIL PROTECTED]
 -> Onderwerp: Re: [PHP] Reading an MS Access Database file on *NIX platform
 -> using PHP
 ->
 ->
 ->
 -> On Sunday, August 24, 2003, at 05:31 PM, Giz wrote:
 ->
 -> > Access is a pc database.  It doesn't run on unix.  Why people
 -> insist on
 -> > beating their heads against the wall in this manner I will never know.
 -> > Ignorance I suppose.  The alternative is to have your friend use a
 -> > relational database and have a few simple forms that will allow him to
 -> > insert/update/delete.  Best of both worlds, and the open source/free
 -> > databases mysql/postgresql are used on thousands of websites
 -> every day.
 ->
 -> I share a low regard for Access, and I've got a set of standard
 -> forms/code I use to set up a nice interface to MySQL, and I
 -> showed it to
 -> my friend. He likes that, but there's a problem:
 ->
 -> He wants to be able to make changes offline, and then sync up.
 ->
 -> This isn't an uncommon desire... I've run into people wanting
 -> to do this
 -> before (with Excel spreadsheets, no less).  And in fact, it's probably
 -> the most convenient way of doing things, as long as they're
 -> warned about
 -> certain dangers (overwrites from competing unsynced database files).
 -> There's a certain cumbersome nature about web forms and the time delay
 -> involved in HTTP transactions.
 ->
 -> So anyway, that's the motivation for using Access here.
 ->
 -> David Otton <[EMAIL PROTECTED]> wrote:
 ->
 -> > Suggestion: go backwards. Set up the data in, say, MySQL with an ODBC
 -> > driver, and use Access as a front-end onto that data (Access makes a
 -> > good
 -> > front-end for manipulating other databases). I've done this with SQL
 -> > Server,
 -> > but it should be possible with anything that can talk ODBC.
 -> >
 -> > He gets the interface he's used to, you get a database that can run
 -> > under
 -> > BSD. Of course, changes will be reflected in the site in real-time,
 -> > which
 -> > may be a good thing or a bad thing.
 -> >
 -> > Either that or export the data from Access in a readable format, and
 -> > import
 -> > it at the other end.
 ->
 -> These ideas might work better; especially the latter. If COM doesn't
 -> work under UNIX and ODBC can only talk to FoxPro, Access, and other
 -> document (rather than server) oriented databases with the help of some
 -> special Win32 control panel/dll, then it would seem that the
 -> only way to
 -> do offline updates that are then synced would be exporting from Access
 -> in some standard format.
 ->
 -> But it seems somewhat odd to me that there aren't any UNIXy (PHP, Perl,
 -> something) for parsing Access files. I know there's a few CPAN
 -> modules for Excel, but it's interesting that there's apparently nothing
 -> for Access.
 ->
 ->
 -> ~ == ~
 -> http://weston.canncentral.org/
 ->
 -> --
 -> PHP General Mailing List (http://www.php.net/)
 -> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Gen

[PHP] Re: Problem with date('w')

2003-08-25 Thread Danielle van Gladbach
Hi,

Try:



Danielle

Beoi 7308 wrote:

> Hi
>
> I have a problem with the date function
>
>   $theday = date("Y-m-d", time());
>   echo date((w), $theday);
> ?>
>
> should print 1 if today is monday, 2 if today is tuesday ...
> though it's printing 4 and today is monday !
>
> any idea ?

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



Re: [PHP] mail() question

2003-08-25 Thread Matthias Wulkow
Hallo Alister,

am Montag, 25. August 2003 um 03:27 hast Du Folgendes gekritzelt:


A> Did you install postfix _after_ PHP?  Did you have a sendmail binary in
A> place before you configured PHP?  If it's not there are configure time,
A> it won't even compile the 'mail' function.

Yes and there was no sendmail binary before...

A> I've had the same problem before - now that PHP can recognise it's got a
A> way to send email, re-running ./configure / make / make install should
A> work.  It did for me.

I did that, but I forgot to do 'make clean'... now it seems to work.
But I have still one question:
when sending mail with this sendmail binary, is it possible to pass
the mail to a local mail server instead of sending it directly to the
recipient? I ask, because I have a mail server in the network
(different machine than the one running the webserver), but I'd like
the mail not to go outside the network (I have no nameserver!)...

[10 minutes later...]

I don't get the error anymore, but no mail has been sent. No errors in
apache-logs... nothing. I'm trying to sniff the network data transfer
with ethereal, but I don't find any connection to any port 25...

In php.ini, I haven't uncomment the sendmail part (sendmail_path =
...) because there is written that default is sendmail -t -i which
should be ok...

SvT




-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



RE: [PHP] CMS question.

2003-08-25 Thread Jay Blanchard
[snip]
I have a friend who have paid a developper to build him a CMS. This
honest 
programmer did that (supposedly developped it on his own), encoded the
CMS 
with Ioncube and did some other unethical activities as well. To make a
long 
story short, I have read some articles about decoding and cracking the
source 
/ reverse engineering, and it looks like it is time consuming and also 
illegal.
[/snip]

What makes you think that the developer did something unethical? 

[snip]
I have taken snapshots of the CMS and put them available to whoever is 
interested in giving me a hand to see if this CMS is an open source one?
note the php files: categories_list.php, content_list.php and 
content_edit.php.
[/snip]

I have seen those small icons used by numerous developers, but I don't
know if they are available for uncredited or uncompensated works. Other
than that those screenshots look like dozens of packages I have seen.

[snip]
the CM is also capable to upload in batch... ?
[/snip]

Capable to upload what in a batch?

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



[PHP] [Newbie Guide] For the benefit of new members

2003-08-25 Thread tech
=
This message is for the benefit of new subscribers and those new to PHP.  
Those who  do not want to be bothered just filter out the [Newbie Guide] 
mails. Please feel free to add more points and send to the list.
==
1. If you have any queries/problems about PHP try http://www.php.net/manual/en 
first. You can download a copy and use it offline also.

2. If you can not get answer here try http://www.google.com next. Try 
searching for "php YOUR QUERY" and you may be lucky to get an answer within 
the first 10 results.

3. Glancing through the list archive at 
http://marc.theaimsgroup.com/?l=php-general , you can find many of the 
common topics discussed repeatedly and can get your answer from those 
discussions. 

4. If you are stuck with a script and do not understand what is wrong, instead 
of posting the whole script, try doing some research yourself. One useful 
trick is to print the variable/sql query using print or echo command and 
check whether you get what you expected. 

After diagnosing the problem, send the details of your efforts (following 
steps 1,2 & 3) and ask for help in the list.

5. Provide a clear descriptive subject line. Avoid general subjects like 
"Help!!", "A Question" etc. 

6. When you want to start a new topic, open a new mail and enter the mailing 
list address [EMAIL PROTECTED] instead of replyting to an existing 
thread and replacing the subject and body with your message.

7. PHP is a server side scripting language. Whatever processing PHP does takes 
place BEFORE the output reaches the client. Therefore, it is not possible to 
access the users'  computer related information (OS, screen size etc) using 
PHP. You need to go for Java Script and ask the question in a Java Script 
list.

Hope you have a good time programming with PHP.

Best regards,

-- 
Ma Siva Kumar,

INTEGRATED MANAGEMENT TOOLS FOR LEATHER INDUSTRY
BSG LeatherLink,
Chennai.
Ph: +91 44 55191757
URL : http://www.leatherlink.net

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



Re: [PHP] Unable to get the values in next page

2003-08-25 Thread murugesan
Thanks for the help.
I got it worked. The mistake I did was that I failed to call session_start()
in the next page.

-Murugesan
- Original Message -
From: "Burhan" <[EMAIL PROTECTED]>
To: "murugesan" <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 3:29 PM
Subject: Re: [PHP] Unable to get the values in next page


> Quoting murugesan <[EMAIL PROTECTED]>:
>
> [ trim ]
>
> > main.php
> > -
> > echo $failed;// this is null here
> > ->
>
> Try echo $_SESSION['failed'];
>
> --
> Burhan
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
>

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



[PHP] Unix end of line versus windows end of line

2003-08-25 Thread Bohdan Blaha
Hi,

I use PHP with apache on two systems..
(linux and windows)

when I use PHP on linux, it is ok.. I get Unix end of line, when I write to the file 
with fwrite function...
when I run the same script on windows machine, I get Unix end of line too, but I need 
there windows end of line,...

is it configuration of php.ini?? or how can I set it???

thx for help
BB


---
Odchozí zpráva neobsahuje viry.
Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
Verze: 6.0.512 / Virová báze: 309 - datum vydání: 19.8.2003

[PHP] Problem with date('w')

2003-08-25 Thread BEOI 7308
Hi

I have a problem with the date function



should print 1 if today is monday, 2 if today is tuesday ...
though it's printing 4 and today is monday !

any idea ?

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

Re: [PHP] RE: Unable to get the values in next page

2003-08-25 Thread murugesan
 I thought of including the script in all the files.Thanks for the message.

Regards,
Murugesan

- Original Message -
From: "Cody Phanekham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 12:50 PM
Subject: RE: [PHP] RE: Unable to get the values in next page


NP.

You only have to start a session if you want to access any session variable.
You could always including the code in a header.inc file that gets included
in every php script, that way you wont forget to start the session.

> -Original Message-
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 25 August 2003 17:14
> To: Cody Phanekham; [EMAIL PROTECTED]
> Subject: Re: [PHP] RE: Unable to get the values in next page
>
>
> Thanks for the reply.Actually I don't know that I have to include the
> start_session in every page.
> I GOT it ATLAST.
>
> Regards
> -murugesan.
>
>
> - Original Message -
> From: "Cody Phanekham" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, August 25, 2003 12:26 PM
> Subject: [PHP] RE: Unable to get the values in next page
>
>
> > main.php
> > -
> > echo $failed;// this is null here
> > ->
>
> did you start the session in main.php before "echo $failed;"? eg
>  session_name("mysessionname");
> session_start();
> ?>
>
>
> > -Original Message-
> > From: murugesan [mailto:[EMAIL PROTECTED]
> > Sent: Monday, 25 August 2003 16:46
> > To: Cody Phanekham; [EMAIL PROTECTED]
> > Subject: Unable to get the values in next page
> >
> >
> > I did as what you said. But the problem now is that I am not
> > able to get the
> > values in the next page.
> >
> > index.php
> > --
> > session_name("mysessionname");
> > session_start();
> > --->
> >
> > auth.php
> > -
> > $failed="yes";
> > session_register('failed');
> > header ("Location: /main.php");
> > ->
> >
> > main.php
> > -
> > echo $failed;// this is null here
> > ->
> >
> > What might be the problem ?
> >
> > Thanks in advance,
> > Murugesan.
> >
> >
> >
> > > Murugesan,
> > >
> > > I'll assume your redirecting the user to main.php because
> > (s)he has passed
> > > the authentication routine... in that case just store the
> > username and
> > > password as a session variable that way you wont need to
> > pass the username
> > > and password via the url.
> > >
> > > auth.php, [just before the call to header()]:
> > >  > >   session_register('empid');
> > >   session_register('pwd');
> > >   header ("Location: /main.php");
> > > ?>
> > >
> > > then in main.php you need to start your session to access
> > the session
> > > variables
> > >  > >   session_name("yoursessionname");
> > >   session_start();
> > >   // you now have access to $empid and $pwd
> > >   echo "your employee id = $empid and the password
> you typed was
> > $pwd";
> > > ?>
> > >
> > >
> > > > -Original Message-
> > > > From: murugesan [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, 25 August 2003 15:18
> > > > To: Cody Phanekham; [EMAIL PROTECTED]
> > > > Subject: Re: [PHP] How to open random Flash page with hyperlink?
> > > >
> > > >
> > > > Thanks for the information.
> > > > In the code you provided
> > > >
> > > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > > >  {
> > > >   .
> > > >
> > > > Actually I have implemented this in a separate page.
> > > >
> > > > That is upon sign up of the  in the index page
> > > > I call a new page auth.php
> > > > In that file
> > > > I have done this authentication and called the function
> > > > header ("Location: /main.php?empid=$empid&pwd=$pwd");
> > > >
> > > > Actually when passing this URL the password appears in the
> > > > address bar.
> > > > How to over come this? It will be very much usefull if I get
> > > > the answer.
> > > >
> > > > Thanks in advance
> > > > -Murugesan
> > > > --
> > > > --
> > > > --
> > > > --
> > > > -
> > > > Ok lets say you want every user to login before they can
> > > > access other parts
> > > > of your site.
> > > >
> > > > index.php:
> > > >  > > > session_name("mysessionname");
> > > > session_start();
> > > > session_register("s_authed");
> > > > $s_authed = 0; // initialize session flag
> > > >
> > > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > > > {
> > > >   // display login form
> > > >   ...
> > > > }
> > > > else
> > > > {
> > > >   // retrieve database username and password here
> > > >   ...
> > > >   // check if they match
> > > >   if (($db_passwd == $passwd) && ($db_username == $username))
> > > >   {
> > > > $s_authed = 1; // user has been authorised
> > > > // redirect to real page
> > > > echo "
> > > > 
> > > >   window.location='main.php'
> > > > ";
> > > >   }
> > > > }
> > > > ?>
> > > >
> > > > main.php:
>

[PHP] window.status

2003-08-25 Thread murugesan
Hello all,
I have cleared the stage of changing the window status on mouse over
and on mouse out.
echo "Click here";
When I keep on pressing my left mouse button it is displaying the URL in the
status bar.
How to remove the status?
Any one there to help me?

-Murugesan

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



[PHP] Window.status message

2003-08-25 Thread murugesan
Hello all,
I have  a proble in showing the window message

[snip]
echo "Click here ";

Here on mouse over it is not displaying hai message in the status bar.
Instead when I move the mouse on the link and then after moving the mouse
apart from the link it displays the hai message in the status bar.
What might be the problem?

-murugesan

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



[PHP] php5 and mysql

2003-08-25 Thread Harry Wiens
i've got a wamp with php5. is there any possibility to activate or
reinstall, etc. the mysql extension?

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Ernest E Vogelsinger
At 03:18 25.08.2003, Weston Cann said:
[snip]
>I share a low regard for Access, and I've got a set of standard 
>forms/code I use to set up a nice interface to MySQL, and I showed it to 
>my friend. He likes that, but there's a problem:
>
>He wants to be able to make changes offline, and then sync up.
>
>This isn't an uncommon desire... I've run into people wanting to do this 
>before (with Excel spreadsheets, no less).  And in fact, it's probably 
>the most convenient way of doing things, as long as they're warned about 
>certain dangers (overwrites from competing unsynced database files).  
>There's a certain cumbersome nature about web forms and the time delay 
>involved in HTTP transactions.
>
>So anyway, that's the motivation for using Access here.
[snip] 

You could do that without too much effort. Export the data to be synced
from MS Access to a CSV style export format, upload it to the server and
process it. There are a couple of examples how to handle CSV style data on
SourceForge, I believe.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/

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



[PHP] include () problems

2003-08-25 Thread Mjec
Hi,

When I run the line:

include ("fnord.php");

with the file looking like:



it prints out the return of fnord() (i.e. $msg).  I've checked, and there's
no echo or print statemetns anywhere...

Oh, yeah, FYI, the pattern goes like this:

file: index.php

file: standard.php


and it prints it right up the top of index.php, causing an error with the
"header" statement (although it says the error is in fnord.php - which
contains NO header statemtns).

ideas?

Regards,

mjec

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



[PHP] Use PHP or MySQL

2003-08-25 Thread Sid
Hello,

This question has been lingering in my mind for some time -
Say we have a function such as MD5, which is available on both PHP and MySQL? Which is 
faster - the PHP version or the MySQL one. Have any benchmarks been made on this? We 
can use the same question for say... arithmetic operations, string contentation...

Thanks in advance.

- Sid 


RE: [PHP] RE: Unable to get the values in next page

2003-08-25 Thread Cody Phanekham
NP.

You only have to start a session if you want to access any session variable. You could 
always including the code in a header.inc file that gets included in every php script, 
that way you wont forget to start the session.

> -Original Message-
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 25 August 2003 17:14
> To: Cody Phanekham; [EMAIL PROTECTED]
> Subject: Re: [PHP] RE: Unable to get the values in next page
> 
> 
> Thanks for the reply.Actually I don't know that I have to include the
> start_session in every page.
> I GOT it ATLAST.
> 
> Regards
> -murugesan.
> 
> 
> - Original Message -
> From: "Cody Phanekham" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, August 25, 2003 12:26 PM
> Subject: [PHP] RE: Unable to get the values in next page
> 
> 
> > main.php
> > -
> > echo $failed;// this is null here
> > ->
> 
> did you start the session in main.php before "echo $failed;"? eg
>  session_name("mysessionname");
> session_start();
> ?>
> 
> 
> > -Original Message-
> > From: murugesan [mailto:[EMAIL PROTECTED]
> > Sent: Monday, 25 August 2003 16:46
> > To: Cody Phanekham; [EMAIL PROTECTED]
> > Subject: Unable to get the values in next page
> >
> >
> > I did as what you said. But the problem now is that I am not
> > able to get the
> > values in the next page.
> >
> > index.php
> > --
> > session_name("mysessionname");
> > session_start();
> > --->
> >
> > auth.php
> > -
> > $failed="yes";
> > session_register('failed');
> > header ("Location: /main.php");
> > ->
> >
> > main.php
> > -
> > echo $failed;// this is null here
> > ->
> >
> > What might be the problem ?
> >
> > Thanks in advance,
> > Murugesan.
> >
> >
> >
> > > Murugesan,
> > >
> > > I'll assume your redirecting the user to main.php because
> > (s)he has passed
> > > the authentication routine... in that case just store the
> > username and
> > > password as a session variable that way you wont need to
> > pass the username
> > > and password via the url.
> > >
> > > auth.php, [just before the call to header()]:
> > >  > >   session_register('empid');
> > >   session_register('pwd');
> > >   header ("Location: /main.php");
> > > ?>
> > >
> > > then in main.php you need to start your session to access
> > the session
> > > variables
> > >  > >   session_name("yoursessionname");
> > >   session_start();
> > >   // you now have access to $empid and $pwd
> > >   echo "your employee id = $empid and the password 
> you typed was
> > $pwd";
> > > ?>
> > >
> > >
> > > > -Original Message-
> > > > From: murugesan [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, 25 August 2003 15:18
> > > > To: Cody Phanekham; [EMAIL PROTECTED]
> > > > Subject: Re: [PHP] How to open random Flash page with hyperlink?
> > > >
> > > >
> > > > Thanks for the information.
> > > > In the code you provided
> > > >
> > > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > > >  {
> > > >   .
> > > >
> > > > Actually I have implemented this in a separate page.
> > > >
> > > > That is upon sign up of the  in the index page
> > > > I call a new page auth.php
> > > > In that file
> > > > I have done this authentication and called the function
> > > > header ("Location: /main.php?empid=$empid&pwd=$pwd");
> > > >
> > > > Actually when passing this URL the password appears in the
> > > > address bar.
> > > > How to over come this? It will be very much usefull if I get
> > > > the answer.
> > > >
> > > > Thanks in advance
> > > > -Murugesan
> > > > --
> > > > --
> > > > --
> > > > --
> > > > -
> > > > Ok lets say you want every user to login before they can
> > > > access other parts
> > > > of your site.
> > > >
> > > > index.php:
> > > >  > > > session_name("mysessionname");
> > > > session_start();
> > > > session_register("s_authed");
> > > > $s_authed = 0; // initialize session flag
> > > >
> > > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > > > {
> > > >   // display login form
> > > >   ...
> > > > }
> > > > else
> > > > {
> > > >   // retrieve database username and password here
> > > >   ...
> > > >   // check if they match
> > > >   if (($db_passwd == $passwd) && ($db_username == $username))
> > > >   {
> > > > $s_authed = 1; // user has been authorised
> > > > // redirect to real page
> > > > echo "
> > > > 
> > > >   window.location='main.php'
> > > > ";
> > > >   }
> > > > }
> > > > ?>
> > > >
> > > > main.php:
> > > >  > > > session_name("mysessionname");
> > > > session_start();
> > > > if (!$s_authed) // check access
> > > > {
> > > >   // user hasnt been authorised, therefore redirect to 
> login page
> > > >   echo "
> > > >   
> > > > window.location='index.php'
> > > >   ";
> > 

Re: [PHP] RE: Unable to get the values in next page

2003-08-25 Thread murugesan
Thanks for the reply.Actually I don't know that I have to include the
start_session in every page.
I GOT it ATLAST.

Regards
-murugesan.


- Original Message -
From: "Cody Phanekham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 12:26 PM
Subject: [PHP] RE: Unable to get the values in next page


> main.php
> -
> echo $failed;// this is null here
> ->

did you start the session in main.php before "echo $failed;"? eg



> -Original Message-
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 25 August 2003 16:46
> To: Cody Phanekham; [EMAIL PROTECTED]
> Subject: Unable to get the values in next page
>
>
> I did as what you said. But the problem now is that I am not
> able to get the
> values in the next page.
>
> index.php
> --
> session_name("mysessionname");
> session_start();
> --->
>
> auth.php
> -
> $failed="yes";
> session_register('failed');
> header ("Location: /main.php");
> ->
>
> main.php
> -
> echo $failed;// this is null here
> ->
>
> What might be the problem ?
>
> Thanks in advance,
> Murugesan.
>
>
>
> > Murugesan,
> >
> > I'll assume your redirecting the user to main.php because
> (s)he has passed
> > the authentication routine... in that case just store the
> username and
> > password as a session variable that way you wont need to
> pass the username
> > and password via the url.
> >
> > auth.php, [just before the call to header()]:
> >  >   session_register('empid');
> >   session_register('pwd');
> >   header ("Location: /main.php");
> > ?>
> >
> > then in main.php you need to start your session to access
> the session
> > variables
> >  >   session_name("yoursessionname");
> >   session_start();
> >   // you now have access to $empid and $pwd
> >   echo "your employee id = $empid and the password you typed was
> $pwd";
> > ?>
> >
> >
> > > -Original Message-
> > > From: murugesan [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, 25 August 2003 15:18
> > > To: Cody Phanekham; [EMAIL PROTECTED]
> > > Subject: Re: [PHP] How to open random Flash page with hyperlink?
> > >
> > >
> > > Thanks for the information.
> > > In the code you provided
> > >
> > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > >  {
> > >   .
> > >
> > > Actually I have implemented this in a separate page.
> > >
> > > That is upon sign up of the  in the index page
> > > I call a new page auth.php
> > > In that file
> > > I have done this authentication and called the function
> > > header ("Location: /main.php?empid=$empid&pwd=$pwd");
> > >
> > > Actually when passing this URL the password appears in the
> > > address bar.
> > > How to over come this? It will be very much usefull if I get
> > > the answer.
> > >
> > > Thanks in advance
> > > -Murugesan
> > > --
> > > --
> > > --
> > > --
> > > -
> > > Ok lets say you want every user to login before they can
> > > access other parts
> > > of your site.
> > >
> > > index.php:
> > >  > > session_name("mysessionname");
> > > session_start();
> > > session_register("s_authed");
> > > $s_authed = 0; // initialize session flag
> > >
> > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > > {
> > >   // display login form
> > >   ...
> > > }
> > > else
> > > {
> > >   // retrieve database username and password here
> > >   ...
> > >   // check if they match
> > >   if (($db_passwd == $passwd) && ($db_username == $username))
> > >   {
> > > $s_authed = 1; // user has been authorised
> > > // redirect to real page
> > > echo "
> > > 
> > >   window.location='main.php'
> > > ";
> > >   }
> > > }
> > > ?>
> > >
> > > main.php:
> > >  > > session_name("mysessionname");
> > > session_start();
> > > if (!$s_authed) // check access
> > > {
> > >   // user hasnt been authorised, therefore redirect to login page
> > >   echo "
> > >   
> > > window.location='index.php'
> > >   ";
> > > }
> > > else
> > > {
> > >   // display page
> > >   ...
> > > }
> > > ?>
> > >
> > >
> > > if a user tries to access main.php directly without logging
> > > in they will be
> > > redirected to index.php
> > >
> > > checkout http://www.php.net/manual/en/ref.session.php for
> > > more information
> > >
> > >
> > > >
> > > >
> > > > Thanks for the message.
> > > > Can you please tell me how to do session authentication?.
> > > >
> > > > -murugesan
>



*
This e-mail, including any attachments to it, may contain confidential
and/or personal information.
If you have received this e-mail in error, you must not copy, distribute, or
disclose it, use or take any action
based on the information contained within it.

Please notify the sender immediately by 

php-general Digest 25 Aug 2003 06:56:24 -0000 Issue 2257

2003-08-25 Thread php-general-digest-help

php-general Digest 25 Aug 2003 06:56:24 - Issue 2257

Topics (messages 160599 through 160644):

Probably has already been asked... Remote commands
160599 by: Richard D. Marriner II

Re: Reading an MS Access Database file on *NIX platform using PHP
160600 by: Travis Kroh
160603 by: David Otton
160609 by: Giz
160614 by: Curt Zirzow
160615 by: Paul Fitzpatrick
160617 by: jabber.raditha.com
160618 by: jabber.raditha.com
160619 by: Curt Zirzow
160620 by: Curt Zirzow
160622 by: Weston Cann

Re: In need of a script
160601 by: Wouter van Vliet

script not terminating on user abort
160602 by: Dennis Jacobfeuerborn
160606 by: Curt Zirzow

php NEWBIE Question
160604 by: Dennis Dujan - Partycult.de
160607 by: Curt Zirzow
160610 by: Dennis Dujan - Partycult.de
160611 by: Dennis Dujan - Partycult.de

mail() question
160605 by: Matthias Wulkow
160608 by: Curt Zirzow
160613 by: Matthias Wulkow
160616 by: Stevie D Peele
160621 by: Alister
160625 by: Curt Zirzow

Re: Using PHP on an .html file
160612 by: Mike Migurski
160623 by: Curt Zirzow

Re: How to open random Flash page with hyperlink?
160624 by: Cody Phanekham
160636 by: murugesan
160638 by: Cody Phanekham
160642 by: murugesan

mysql_connect error
160626 by: Mjec
160627 by: John W. Holmes
160628 by: Mjec
160632 by: murugesan

php & qmail
160629 by: Kris Reid
160630 by: Manuel Lemos
160633 by: Kris Reid
160635 by: Manuel Lemos
160640 by: Curt Zirzow

Passing values from one page to another
160631 by: murugesan
160634 by: Chris Shiflett

Re: 2 questions
160637 by: Binay Agarwal

(Drupal function) getting error : "notice : Undefined index ?"
160639 by: fatih olcer
160641 by: Curt Zirzow

Unable to get the values in next page
160643 by: murugesan
160644 by: Cody Phanekham

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
I'm sure this has been asked but I need clearification.  I would like to
create a script that can run remote programs and edit remote files on Linux
(both hosts are linux).   The reason is I would like to make a web hosting
control panel using PHP that I can have my mail & dns server on one machine
and web on the other.  Is there any way possible to do this with PHP?

I searched the arhives and found something about ssh_agent but couldn't find
a lot of information from google.  Any help would be appreciated.   I have
php experience just not very much...

Anything would be appreciated!
Thank You
Richard Marriner II
--- End Message ---
--- Begin Message ---
This is a widespread problem. One which we faced, and eventually solved by
deciding to just write the application in .NET instead.

Some links that may be helpful...
This link deals with problems trying to use PHP's built-in function
"odbc_connect" on a Linux box:
http://forums.devshed.com/t37357/s.html

These links mention using database functions within this PHP include
library (adodb.inc.php) and skipping ODBC altogether:
http://www.devshed.com/Server_Side/PHP/ADODB
http://php.weblogs.com/ADODB

The basic problem is trying to get something on a nix box to play nice with
Jet. We never found an elegant way of doing it. (Some brief thought was
given to writing a VB app to live on the windows box, conveniently leaving a
port open to listen for requests from our PHP script and return results.
Humorous, yet ever-so-brief thought. :)

Good luck.
-trav

>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Sunday, August 24, 2003 1:55 PM
>To: [EMAIL PROTECTED]
>Cc: [EMAIL PROTECTED]
>Subject: Reading an MS Access Database file on *NIX platform using PHP
>
>
>I'm building a small web application for a friend using PHP. He'd like to
>use MS Access to keep the data in, and update the data on the site
>by FTP'ing
>Access files he edits on his machine up to the web host.
>
>The web host is unix-based (FreeBSD, slightly hacked by Verio, I
>believe), so
>this means COM functions aren't available. ODBC was my next
>thought, but I've
>never used it, and there are a few things I don't understand. Setting up a
>DSN is one of them -- apparently this isn't as simple as
>constructing a string,
>and all the tutorials I can find seem to involve going into a
>Windows control
>panel and making a setting. This of course will not be possible,
>since there
>are no windows control panels on FreeBSD.
>
>In short: can anyone offer any quick tips on how to use the odbc
>database functions or PE

[PHP] RE: Unable to get the values in next page

2003-08-25 Thread Cody Phanekham
> main.php
> -
> echo $failed;// this is null here
> ->

did you start the session in main.php before "echo $failed;"? eg



> -Original Message-
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 25 August 2003 16:46
> To: Cody Phanekham; [EMAIL PROTECTED]
> Subject: Unable to get the values in next page
> 
> 
> I did as what you said. But the problem now is that I am not 
> able to get the
> values in the next page.
> 
> index.php
> --
> session_name("mysessionname");
> session_start();
> --->
> 
> auth.php
> -
> $failed="yes";
> session_register('failed');
> header ("Location: /main.php");
> ->
> 
> main.php
> -
> echo $failed;// this is null here
> ->
> 
> What might be the problem ?
> 
> Thanks in advance,
> Murugesan.
> 
> 
> 
> > Murugesan,
> >
> > I'll assume your redirecting the user to main.php because 
> (s)he has passed
> > the authentication routine... in that case just store the 
> username and
> > password as a session variable that way you wont need to 
> pass the username
> > and password via the url.
> >
> > auth.php, [just before the call to header()]:
> >  >   session_register('empid');
> >   session_register('pwd');
> >   header ("Location: /main.php");
> > ?>
> >
> > then in main.php you need to start your session to access 
> the session
> > variables
> >  >   session_name("yoursessionname");
> >   session_start();
> >   // you now have access to $empid and $pwd
> >   echo "your employee id = $empid and the password you typed was
> $pwd";
> > ?>
> >
> >
> > > -Original Message-
> > > From: murugesan [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, 25 August 2003 15:18
> > > To: Cody Phanekham; [EMAIL PROTECTED]
> > > Subject: Re: [PHP] How to open random Flash page with hyperlink?
> > >
> > >
> > > Thanks for the information.
> > > In the code you provided
> > >
> > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > >  {
> > >   .
> > >
> > > Actually I have implemented this in a separate page.
> > >
> > > That is upon sign up of the  in the index page
> > > I call a new page auth.php
> > > In that file
> > > I have done this authentication and called the function
> > > header ("Location: /main.php?empid=$empid&pwd=$pwd");
> > >
> > > Actually when passing this URL the password appears in the
> > > address bar.
> > > How to over come this? It will be very much usefull if I get
> > > the answer.
> > >
> > > Thanks in advance
> > > -Murugesan
> > > --
> > > --
> > > --
> > > --
> > > -
> > > Ok lets say you want every user to login before they can
> > > access other parts
> > > of your site.
> > >
> > > index.php:
> > >  > > session_name("mysessionname");
> > > session_start();
> > > session_register("s_authed");
> > > $s_authed = 0; // initialize session flag
> > >
> > > if ((!$passwd) || (!$username)) // user hasnt logged in
> > > {
> > >   // display login form
> > >   ...
> > > }
> > > else
> > > {
> > >   // retrieve database username and password here
> > >   ...
> > >   // check if they match
> > >   if (($db_passwd == $passwd) && ($db_username == $username))
> > >   {
> > > $s_authed = 1; // user has been authorised
> > > // redirect to real page
> > > echo "
> > > 
> > >   window.location='main.php'
> > > ";
> > >   }
> > > }
> > > ?>
> > >
> > > main.php:
> > >  > > session_name("mysessionname");
> > > session_start();
> > > if (!$s_authed) // check access
> > > {
> > >   // user hasnt been authorised, therefore redirect to login page
> > >   echo "
> > >   
> > > window.location='index.php'
> > >   ";
> > > }
> > > else
> > > {
> > >   // display page
> > >   ...
> > > }
> > > ?>
> > >
> > >
> > > if a user tries to access main.php directly without logging
> > > in they will be
> > > redirected to index.php
> > >
> > > checkout http://www.php.net/manual/en/ref.session.php for
> > > more information
> > >
> > >
> > > >
> > > >
> > > > Thanks for the message.
> > > > Can you please tell me how to do session authentication?.
> > > >
> > > > -murugesan
> 


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to

[PHP] Unable to get the values in next page

2003-08-25 Thread murugesan
I did as what you said. But the problem now is that I am not able to get the
values in the next page.

index.php
--
session_name("mysessionname");
session_start();
--->

auth.php
-
$failed="yes";
session_register('failed');
header ("Location: /main.php");
->

main.php
-
echo $failed;// this is null here
->

What might be the problem ?

Thanks in advance,
Murugesan.



> Murugesan,
>
> I'll assume your redirecting the user to main.php because (s)he has passed
> the authentication routine... in that case just store the username and
> password as a session variable that way you wont need to pass the username
> and password via the url.
>
> auth.php, [just before the call to header()]:
>session_register('empid');
>   session_register('pwd');
>   header ("Location: /main.php");
> ?>
>
> then in main.php you need to start your session to access the session
> variables
>session_name("yoursessionname");
>   session_start();
>   // you now have access to $empid and $pwd
>   echo "your employee id = $empid and the password you typed was
$pwd";
> ?>
>
>
> > -Original Message-
> > From: murugesan [mailto:[EMAIL PROTECTED]
> > Sent: Monday, 25 August 2003 15:18
> > To: Cody Phanekham; [EMAIL PROTECTED]
> > Subject: Re: [PHP] How to open random Flash page with hyperlink?
> >
> >
> > Thanks for the information.
> > In the code you provided
> >
> > if ((!$passwd) || (!$username)) // user hasnt logged in
> >  {
> >   .
> >
> > Actually I have implemented this in a separate page.
> >
> > That is upon sign up of the  in the index page
> > I call a new page auth.php
> > In that file
> > I have done this authentication and called the function
> > header ("Location: /main.php?empid=$empid&pwd=$pwd");
> >
> > Actually when passing this URL the password appears in the
> > address bar.
> > How to over come this? It will be very much usefull if I get
> > the answer.
> >
> > Thanks in advance
> > -Murugesan
> > --
> > --
> > --
> > --
> > -
> > Ok lets say you want every user to login before they can
> > access other parts
> > of your site.
> >
> > index.php:
> >  > session_name("mysessionname");
> > session_start();
> > session_register("s_authed");
> > $s_authed = 0; // initialize session flag
> >
> > if ((!$passwd) || (!$username)) // user hasnt logged in
> > {
> >   // display login form
> >   ...
> > }
> > else
> > {
> >   // retrieve database username and password here
> >   ...
> >   // check if they match
> >   if (($db_passwd == $passwd) && ($db_username == $username))
> >   {
> > $s_authed = 1; // user has been authorised
> > // redirect to real page
> > echo "
> > 
> >   window.location='main.php'
> > ";
> >   }
> > }
> > ?>
> >
> > main.php:
> >  > session_name("mysessionname");
> > session_start();
> > if (!$s_authed) // check access
> > {
> >   // user hasnt been authorised, therefore redirect to login page
> >   echo "
> >   
> > window.location='index.php'
> >   ";
> > }
> > else
> > {
> >   // display page
> >   ...
> > }
> > ?>
> >
> >
> > if a user tries to access main.php directly without logging
> > in they will be
> > redirected to index.php
> >
> > checkout http://www.php.net/manual/en/ref.session.php for
> > more information
> >
> >
> > >
> > >
> > > Thanks for the message.
> > > Can you please tell me how to do session authentication?.
> > >
> > > -murugesan

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



Re: [PHP] How to open random Flash page with hyperlink?

2003-08-25 Thread murugesan
Really thanks for the support. It worked well.

-regards,
Murugesan

- Original Message -
From: "Cody Phanekham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 11:06 AM
Subject: RE: [PHP] How to open random Flash page with hyperlink?


Murugesan,

I'll assume your redirecting the user to main.php because (s)he has passed
the authentication routine... in that case just store the username and
password as a session variable that way you wont need to pass the username
and password via the url.

auth.php, [just before the call to header()]:


then in main.php you need to start your session to access the session
variables
your employee id = $empid and the password you typed was $pwd";
?>


> -Original Message-
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 25 August 2003 15:18
> To: Cody Phanekham; [EMAIL PROTECTED]
> Subject: Re: [PHP] How to open random Flash page with hyperlink?
>
>
> Thanks for the information.
> In the code you provided
>
> if ((!$passwd) || (!$username)) // user hasnt logged in
>  {
>   .
>
> Actually I have implemented this in a separate page.
>
> That is upon sign up of the  in the index page
> I call a new page auth.php
> In that file
> I have done this authentication and called the function
> header ("Location: /main.php?empid=$empid&pwd=$pwd");
>
> Actually when passing this URL the password appears in the
> address bar.
> How to over come this? It will be very much usefull if I get
> the answer.
>
> Thanks in advance
> -Murugesan
> --
> --
> --
> --
> -
> Ok lets say you want every user to login before they can
> access other parts
> of your site.
>
> index.php:
>  session_name("mysessionname");
> session_start();
> session_register("s_authed");
> $s_authed = 0; // initialize session flag
>
> if ((!$passwd) || (!$username)) // user hasnt logged in
> {
>   // display login form
>   ...
> }
> else
> {
>   // retrieve database username and password here
>   ...
>   // check if they match
>   if (($db_passwd == $passwd) && ($db_username == $username))
>   {
> $s_authed = 1; // user has been authorised
> // redirect to real page
> echo "
> 
>   window.location='main.php'
> ";
>   }
> }
> ?>
>
> main.php:
>  session_name("mysessionname");
> session_start();
> if (!$s_authed) // check access
> {
>   // user hasnt been authorised, therefore redirect to login page
>   echo "
>   
> window.location='index.php'
>   ";
> }
> else
> {
>   // display page
>   ...
> }
> ?>
>
>
> if a user tries to access main.php directly without logging
> in they will be
> redirected to index.php
>
> checkout http://www.php.net/manual/en/ref.session.php for
> more information
>
>
> >
> >
> > Thanks for the message.
> > Can you please tell me how to do session authentication?.
> >
> > -murugesan
>



*
This e-mail, including any attachments to it, may contain confidential
and/or personal information.
If you have received this e-mail in error, you must not copy, distribute, or
disclose it, use or take any action
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then
delete the original e-mail.

The information contained within this e-mail may be solely the opinion of
the sender and may not necessarily
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to
Salmat's anti-virus systems.

For more information, visit our website at  www.salmat.com.au.

*

--
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] (Drupal function) getting error : "notice : Undefined index ?"

2003-08-25 Thread Curt Zirzow
* Thus wrote fatih olcer ([EMAIL PROTECTED]):
> hi,
> 
> 
> i think i have a configuration problem. but i couldn't find any
> solution. i can run the same code without any problems on win98 (phpdev5
> installed)
> i have changed some php.ini settings like display_errors = off 
> but still getting errors.

IMO, turning errors of is a bad thing, a program should run
smoothly without errors.  Although with 3rd party packages
sometimes this is hard to avoid.

> 
> 
> - what causes "Undefined index" error?

An undefined index error is caused when accessing an index that
doesnt exist, so if you have an array as follows:
  $var = array('index1' => 'value');

And you try to access:
  echo $var['index2'];

The error will get displayed.

> - what is the problem on "function node_page()" (see below) ?

Sorry unable to help you with this.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] php & qmail

2003-08-25 Thread Curt Zirzow
* Thus wrote Kris Reid ([EMAIL PROTECTED]):
> Hi
> 
> I'm trying to build a program using PHP to increase the performance of Qmail.
> 
> I'm trying to use PHP to send an email qmail-remote which connects directly to the 
> recipients mail server.
> If this fails it will then add it to the queue normally so it can retry later.
> 
> Here is what I have so far (Note this runs on the command line)
> 
> function sendMail($host, $to, $from, $message) {
> 
>  $prog = "/var/qmail/bin/qmail-remote $host $from $to";
>  echo "Program = $prog \r\n";
> 
>  $handle = popen ($prog, "w");
> // fwrite($handle, $message) ;
>  pclose($handle);
>  }
> 
> The problem I have is I don't know how to write the message.
> When you manually run qmail-remote $host $from $to
> You then have to type the message then press control + D
> Just like the standard mail function in UNIX

Actually the mail function usually uses '.' on a line by iteself to
terminate a message.

> 
> How can I type "Message control + D" into the program ?

the '^D' character is the end of file marker on unix. it has the
ordinal value of 0x04 so you can append to your mail message
something like:

$mailmessage .= chr(4);


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] (Drupal function) getting error : "notice : Undefined index ?"

2003-08-25 Thread fatih olcer
hi,


i have installed drupal 4.2.0 without any problems. but when i try to
connect to
my local webserver i get errors: "notice : Undefined index"
i couldnt  get any reply to my messages from drupal.com.

i think i have a configuration problem. but i couldn't find any
solution. i can run the same code without any problems on win98 (phpdev5
installed)
i have changed some php.ini settings like display_errors = off 
but still getting errors.


- what causes "Undefined index" error?
- what is the problem on "function node_page()" (see below) ?

i'm php newbie.  thanks for help.

op. system  :  RH9 (with apache,php on it)
drupal version :  4.2.0

thanks .
Fatih Olcer.


// here is a sample code to generate the error:
function node_page() {
global $id, $user, $or, $and;

 $op = $_POST["op"]; //error line error line  error line error line  error
line
 $edit = $_POST["edit"];

 if (user_access("access content")) {
   if (empty($op)) {
 $op = arg(1);
   }

   if ($op == "feed") {
 node_feed();
 return;
   }

   if ($op == "view") {
 $node = node_load(array("nid" => arg(2), "status" => 1),
$_GET["revision"]);
   }

   theme("header", $node->title);

   $name = module_invoke(arg(2), "node", "name");

   switch ($op) {
 case "add":
   theme("box", t("Submit $name"), node_add(arg(2)));
   break;
 case "edit":
   theme("box", t("Edit $name"), node_edit(arg(2)));
   break;
 case "view":
   print node_show($node, arg(3));
   break;
 case t("Preview"):
   $edit = node_validate($edit, $error);
   theme("box", t("Preview $name"), node_preview($edit, $error));
   break;
 case t("Submit"):
   theme("box", t("Submit $name"), node_submit($edit));
   break;
 case t("Delete"):
   theme("box", t("Delete $name"), node_delete($edit));
   break;
 default:
   $result = pager_query("SELECT nid, type FROM {node} WHERE
promote = '1' AND status = '1' ORDER BY static DESC, created DESC",
variable_get("default_nodes_main", 10));

   while ($node = db_fetch_object($result)) {
 node_view(node_load(array("nid" => $node->nid, "type" =>
$node->type)), 1);
   }
   print pager_display(NULL, variable_get("default_nodes_main",
10));
   }

   theme("footer");
 }
 else {
   theme("header");
   theme("box", t("Access denied"), message_access());
   theme("footer");
 }

}

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



RE: [PHP] How to open random Flash page with hyperlink?

2003-08-25 Thread Cody Phanekham
Murugesan,

I'll assume your redirecting the user to main.php because (s)he has passed the 
authentication routine... in that case just store the username and password as a 
session variable that way you wont need to pass the username and password via the url.

auth.php, [just before the call to header()]:


then in main.php you need to start your session to access the session variables
your employee id = $empid and the password you typed was $pwd";
?>


> -Original Message-
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Monday, 25 August 2003 15:18
> To: Cody Phanekham; [EMAIL PROTECTED]
> Subject: Re: [PHP] How to open random Flash page with hyperlink?
> 
> 
> Thanks for the information.
> In the code you provided
> 
> if ((!$passwd) || (!$username)) // user hasnt logged in
>  {
>   .
> 
> Actually I have implemented this in a separate page.
> 
> That is upon sign up of the  in the index page
> I call a new page auth.php
> In that file
> I have done this authentication and called the function
> header ("Location: /main.php?empid=$empid&pwd=$pwd");
> 
> Actually when passing this URL the password appears in the 
> address bar.
> How to over come this? It will be very much usefull if I get 
> the answer.
> 
> Thanks in advance
> -Murugesan
> --
> --
> --
> --
> -
> Ok lets say you want every user to login before they can 
> access other parts
> of your site.
> 
> index.php:
>  session_name("mysessionname");
> session_start();
> session_register("s_authed");
> $s_authed = 0; // initialize session flag
> 
> if ((!$passwd) || (!$username)) // user hasnt logged in
> {
>   // display login form
>   ...
> }
> else
> {
>   // retrieve database username and password here
>   ...
>   // check if they match
>   if (($db_passwd == $passwd) && ($db_username == $username))
>   {
> $s_authed = 1; // user has been authorised
> // redirect to real page
> echo "
> 
>   window.location='main.php'
> ";
>   }
> }
> ?>
> 
> main.php:
>  session_name("mysessionname");
> session_start();
> if (!$s_authed) // check access
> {
>   // user hasnt been authorised, therefore redirect to login page
>   echo "
>   
> window.location='index.php'
>   ";
> }
> else
> {
>   // display page
>   ...
> }
> ?>
> 
> 
> if a user tries to access main.php directly without logging 
> in they will be
> redirected to index.php
> 
> checkout http://www.php.net/manual/en/ref.session.php for 
> more information
> 
> 
> >
> >
> > Thanks for the message.
> > Can you please tell me how to do session authentication?.
> >
> > -murugesan
> 


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

For more information, visit our website at  www.salmat.com.au.
*

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



Re: [PHP] 2 questions

2003-08-25 Thread Binay Agarwal


- Original Message -
From: "Thomas Hochstetter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 24, 2003 12:54 AM
Subject: RE: [PHP] 2 questions


> The register globals is on with the live server, and off at home (my
version
> is 4.3.2, the other is 4.1.2). does that matter?
yes, it does matter .. Show me the snippet where u regestering/getting the
session variables if possible.

> Thanks for the other tip, shall try that ...
>
> Thomas
>
> - Original Message -
> From: "Thomas Hochstetter" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, August 23, 2003 5:33 PM
> Subject: [PHP] 2 questions
>
>
> > Hi guys.
> >
> > I have two questions for you today:
> >
> > 1. Weired login problem
> > I am developinig a site for a conference where i have a login page for
> > members. This page is called index.php and includes different types of
> modules,
> > according to the type of user logged on. The problem is now following:
> > i have a login function hidden in a class, this function registers a
bunch
> > of variables. After the user has submited the details, index.php (which
> calls
> > the session_start()) calls the login function. Then i check whether a
> session
> > variable is present ($_SESSION['name']). If yes, we include the members
> > area, otherwise we include the login table again. Now: on my test server
> > (XP/Apache/php4.3.2) all is well. However, on the real server
> (Linux/Apache/php4.0.x)
> > it just includes the login table anyway, even if the login was
successful.
> I
> > then have to click on the menu link again to include the member script.
> > Why is that?
>
> Check your register_globals setting in both ur test server and real server
> and let me know.
>
> >
> > 2. Save a large amount of text to a file
> > On the same page i have some type of cms going. The admin users can
change
> > txt files which relate to text on some of the general pages. I have now
> found
> > that it is only transmits a certain amount of text via GET to the
function
> > that writs to the files. Is there a restriction on passing text via url?
> If yes
> > (which will be the case), how could i do this otherwise?
>
> Use POST instead of GET method... POST method allows u to even extend the
> size of data being posted.
>
> Hope this helps...
>
> >
> > Thanks so long...
> >
> > Thomas
> > P.S: this list still rocks
> >
> > --
> > COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
> > --
> > 1. GMX TopMail - Platz 1 und Testsieger!
> > 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
> > 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
> e-Post
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
> --
> 1. GMX TopMail - Platz 1 und Testsieger!
> 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
> 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
e-Post
>
> --
> 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] How to open random Flash page with hyperlink?

2003-08-25 Thread murugesan
Thanks for the information.
In the code you provided

if ((!$passwd) || (!$username)) // user hasnt logged in
 {
  .

Actually I have implemented this in a separate page.

That is upon sign up of the  in the index page
I call a new page auth.php
In that file
I have done this authentication and called the function
header ("Location: /main.php?empid=$empid&pwd=$pwd");

Actually when passing this URL the password appears in the address bar.
How to over come this? It will be very much usefull if I get the answer.

Thanks in advance
-Murugesan


-
Ok lets say you want every user to login before they can access other parts
of your site.

index.php:

  window.location='main.php'
";
  }
}
?>

main.php:

window.location='index.php'
  ";
}
else
{
  // display page
  ...
}
?>


if a user tries to access main.php directly without logging in they will be
redirected to index.php

checkout http://www.php.net/manual/en/ref.session.php for more information


>
>
> Thanks for the message.
> Can you please tell me how to do session authentication?.
>
> -murugesan

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



Re: [PHP] Re: php & qmail

2003-08-25 Thread Manuel Lemos
Hello,

On 08/25/2003 01:34 AM, Kris Reid wrote:
Thanks for the advice however I want to use qmail-remote as I believe it
will suit my needs better.
I have been reading a great deal about tweaking qmail. I run a newsletter
and the fastest way is to try remote deliveries and only add them to the
queue if this fails.
Maybe I was not clear but my SMTP class does remote deliveries when you 
enable the direct delivery mode, so it acts exactly as qmail-remote. If 
you doubt it, just try it. Here is the address again in case you missed it:

http://www.phpclasses.org/smtpclass


The function that I wrote works I just don't know how to insert the message
content.
That is what the MIME message composing and sending class does. It 
composes the message headers and body and calls functions to send messages.

It comes with specialized sub-classes for deliverying the messages 
through various methods. It supports delivery the mail(), sendmail 
program, SMTP either relaying to an intermedite or delivering direcly to 
the recipient SMTP server, or even qmail via qmail-queue.

I use this class for sending newsletters for tens of thousands of users 
every day. The direct delivery mode, I only use for urgent messages, 
like messages to let the users choose their initial passwords.

I could add support to deliver alternatively via qmail-remote but I 
would have to see a good reason to do that instead of using the SMTP 
class in direct delivery mode.

For newsletters I only use the sub class to deliver via qmail-queue 
because those messages are not urgent. The advantage of using 
qmail-queue is that it can run many tens of simultaneous deliveries 
calling qmail-remote. I could run qmail-remote directly from PHP, but I 
doubt it would be as efficient as qmail-queue.

Here it is the MIME composing and sending class address in case you want 
to try it yourself, as you need.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Passing values from one page to another

2003-08-25 Thread Chris Shiflett
--- murugesan <[EMAIL PROTECTED]> wrote:
> Enter
...
> >

http://www.php.net/register_globals

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Re: php & qmail

2003-08-25 Thread Kris Reid
Manuel

Thanks for the advice however I want to use qmail-remote as I believe it
will suit my needs better.

I have been reading a great deal about tweaking qmail. I run a newsletter
and the fastest way is to try remote deliveries and only add them to the
queue if this fails.

The function that I wrote works I just don't know how to insert the message
content.

Thanks

Kris

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



Re: [PHP] mysql_connect error

2003-08-25 Thread murugesan
This is working for me.

---
  define('db_host','localhost');
  define('db_name','mydb') ;
  define('db_user','use1') ;
  define('db_pass','pwd1') ;
  $h = @mysql_pconnect(db_host,db_user,db_pass);
  if($h)
  mysql_select_db (db_name) or die ("could not select db");;
---
-murugesan

- Original Message -
From: "Mjec" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 7:53 AM
Subject: Re: [PHP] mysql_connect error


on 25/08/2003 12:11 PM, John W. Holmes at [EMAIL PROTECTED] wrote:

> Mjec wrote:
>
>> Hi,
>>
>> again this line is causing problems:
>>
>> $h =
>>
mysql_connect('localhost',constant("mysql_user"),constant("mysql_password"))
>> ;
>>
>> Aparantly a parse error.  Idaes?
>
> Is there a reason you're using constant()??
>
> Try: $h = mysql_connect('localhost', mysql_user, mysql_password);
>
> One thing to note about parse errors. If PHP says you have a parse error
> on line 8 (for example), that means there is an error somewhere before
> OR on line 8. The line PHP gives is just the point where it realized
> something was wrong, but the cause could be on a previous line.

Error line 43 (or 42 if 43 commented out and 42 uncommented)

 38: define("mysql_password", "did you think");
 39: define("mysql_user", 'i would say this');
 40:
 41: // Initialize MySQL database
 42: // $h =
mysql_connect('localhost',constant("mysql_user"),constant("mysql_password"))
;
 43: $h = mysql_connect('localhost',mysql_user,mysql_password);
 44: mysql_select_db('mjec_mjecnet', $h);

ideas?

--mjec

--
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] Passing values from one page to another

2003-08-25 Thread murugesan
Hello all,

[snip]


//Page0.php
Enter



//page1.php

function submitform()
{
   //Check for empty values in text box
}




>






//page2.php


In page 1 I am able to get the value 1 of empid.
But in page 2 I am not  able to get it.
Any solutions

-murugesan

[PHP] Re: php & qmail

2003-08-25 Thread Manuel Lemos
Hello,

On 08/25/2003 12:43 AM, Kris Reid wrote:
I'm trying to build a program using PHP to increase the performance of Qmail.

I'm trying to use PHP to send an email qmail-remote which connects directly to the 
recipients mail server.
If this fails it will then add it to the queue normally so it can retry later.
Here is what I have so far (Note this runs on the command line)

function sendMail($host, $to, $from, $message) {

 $prog = "/var/qmail/bin/qmail-remote $host $from $to";
 echo "Program = $prog \r\n";
 $handle = popen ($prog, "w");
// fwrite($handle, $message) ;
 pclose($handle);
 }
The problem I have is I don't know how to write the message.
When you manually run qmail-remote $host $from $to
You then have to type the message then press control + D
Just like the standard mail function in UNIX
How can I type "Message control + D" into the program ?
If you want to send a message directly to recipient SMTP server, you may 
want to try this SMTP class enabling the direct delivery mode.

http://www.phpclasses.org/smtpclass

To actually compose the message you want to send, you would better use 
that in class in conjunction with this other class for composing and 
sending e-mail messages. It comes with a sub-class specialized in 
deliverying via SMTP that using the class above.

http://www.phpclasses.org/mimemessage



--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php & qmail

2003-08-25 Thread Kris Reid
Hi

I'm trying to build a program using PHP to increase the performance of Qmail.

I'm trying to use PHP to send an email qmail-remote which connects directly to the 
recipients mail server.
If this fails it will then add it to the queue normally so it can retry later.

Here is what I have so far (Note this runs on the command line)

function sendMail($host, $to, $from, $message) {

 $prog = "/var/qmail/bin/qmail-remote $host $from $to";
 echo "Program = $prog \r\n";

 $handle = popen ($prog, "w");
// fwrite($handle, $message) ;
 pclose($handle);
 }

The problem I have is I don't know how to write the message.
When you manually run qmail-remote $host $from $to
You then have to type the message then press control + D
Just like the standard mail function in UNIX

How can I type "Message control + D" into the program ?

Thanks

Kris



Re: [PHP] mysql_connect error

2003-08-25 Thread Mjec
on 25/08/2003 12:11 PM, John W. Holmes at [EMAIL PROTECTED] wrote:

> Mjec wrote:
> 
>> Hi,
>> 
>> again this line is causing problems:
>> 
>> $h = 
>> mysql_connect('localhost',constant("mysql_user"),constant("mysql_password"))
>> ;
>> 
>> Aparantly a parse error.  Idaes?
> 
> Is there a reason you're using constant()??
> 
> Try: $h = mysql_connect('localhost', mysql_user, mysql_password);
> 
> One thing to note about parse errors. If PHP says you have a parse error
> on line 8 (for example), that means there is an error somewhere before
> OR on line 8. The line PHP gives is just the point where it realized
> something was wrong, but the cause could be on a previous line.

Error line 43 (or 42 if 43 commented out and 42 uncommented)

 38: define("mysql_password", "did you think");
 39: define("mysql_user", 'i would say this');
 40: 
 41: // Initialize MySQL database
 42: //$h = 
mysql_connect('localhost',constant("mysql_user"),constant("mysql_password"))
;
 43: $h = mysql_connect('localhost',mysql_user,mysql_password);
 44: mysql_select_db('mjec_mjecnet', $h);

ideas?

--mjec

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



Re: [PHP] mysql_connect error

2003-08-25 Thread John W. Holmes
Mjec wrote:

Hi,

again this line is causing problems:

$h = 
mysql_connect('localhost',constant("mysql_user"),constant("mysql_password"))
;

Aparantly a parse error.  Idaes?
Is there a reason you're using constant()??

Try: $h = mysql_connect('localhost', mysql_user, mysql_password);

One thing to note about parse errors. If PHP says you have a parse error 
on line 8 (for example), that means there is an error somewhere before 
OR on line 8. The line PHP gives is just the point where it realized 
something was wrong, but the cause could be on a previous line.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[PHP] mysql_connect error

2003-08-25 Thread Mjec
Hi,

again this line is causing problems:

$h = 
mysql_connect('localhost',constant("mysql_user"),constant("mysql_password"))
;

Aparantly a parse error.  Idaes?

Thanks,

Mjec

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



Re: [PHP] mail() question

2003-08-25 Thread Curt Zirzow
* Thus wrote Matthias Wulkow ([EMAIL PROTECTED]):
> Hallo Curt,
> 
> am Montag, 25. August 2003 um 01:35 hast Du Folgendes gekritzelt:
> 
> >> I have followig error reported:
> >> 
> >> Fatal error: Call to undefined function: mail() in /usr/local/www/login.php on 
> >> line 235
> >> 
> >> What is the trouble here?  If I would have trouble because of
> >> delivery, normally mail would return false. But here...
> 
> CZ> mail() wasn't compiled into php.
> 
> >> 
> >> I have php4.3.1 running on linux. I just installed postfix to have the
> >> sendmail binary at the right place.
> 
> CZ> You'll have to recompile php. the first time you compiled it php it
> CZ> couldnt find sendmail, so it left it out in the binary.
> 
> Well, that makes sense to me. But I just recompiled the same way I did
> it first time (config.nice), but I still get the same error reported.
> I looked in ./configure --help to see if there are specific arguments
> I need to add, but couldn't find any... and this time sendmail is
> there (/usr/sbin/sendmail).
> 
> What's wrong?

When you configure PHP it uses your $PATH envirmonment (plus som
e standard paths.)  

To get more detailed on the situation There is a file in your surce
tree:
  main/php_config.h:

there should be a line (around line #972) that says something like:
  #define HAVE_SENDMAIL 1

If it says 'undef HAVE_SENDMAIL', that generaly means that your
configure script can't find it.

If this is the case I would strongly encourge a search/report at
bugs.php.net to find out how to resolve this.

As long as your sendmail is in a common place you shouldn't have
any problems.



Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



RE: [PHP] How to open random Flash page with hyperlink?

2003-08-25 Thread Cody Phanekham
Murugesan,

Ok lets say you want every user to login before they can access other parts of your 
site.

index.php:

  window.location='main.php'
";
  }
}
?>

main.php:

window.location='index.php'
  ";
}
else
{
  // display page
  ...
}
?>


if a user tries to access main.php directly without logging in they will be redirected 
to index.php

checkout http://www.php.net/manual/en/ref.session.php for more information


> -Original Message-
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Friday, 22 August 2003 20:04
> To: Cody Phanekham; [EMAIL PROTECTED]
> Subject: Re: [PHP] How to open random Flash page with hyperlink?
> 
> 
> Thanks for the message.
> Can you please tell me how to do session authentication?.
> 
> -murugesan


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

For more information, visit our website at  www.salmat.com.au.
*

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



Re: [PHP] Using PHP on an .html file

2003-08-25 Thread Curt Zirzow
* Thus wrote Mike Migurski ([EMAIL PROTECTED]):
> >> Better to do this in an .htaccess file, so you don't incur PHP
> >> processing overhead on the entire server (if there are others using
> >> it).
> >
> >Apache suggests not using .htaccess files at all because they require a
> >recursive traversing of directories looking for .htaccess files, because
> >some supersede others or something like that.
> 
> The only way to eliminate the overhead of searching for .htaccess files is
> to set the Allowoverride directive to 'None' in your httpd.conf file -
> otherwise, they will be checked for on every request whether they exist or
> not. The question is: does the additional benefit of using per-directory
> configuration and selective .html-as-.php handling outweigh the speed gain
> of not looking for .htaccess files? This depends on the server, how it's
> used, and how important raw performance is vs. ease of use.

I believe the only time it become a perfomance issue is when you
have a complex sub directory structure:
 http://host/dir1/dir2/dir3/dir4

apache will look at each directory (dirX) and apply .htaccess rules
overriding each dir from from document root.

> 
> Just to quickly return to the original question, I would not use either
> method - instead I would turn multiviews on, and not use file extensions
> in URL's at all.
> 
> http://httpd.apache.org/docs/content-negotiation.html

This is very interesting and I'm surprized I've overlooked this
option.  Unfortantly, apache doesn't provide a good example of what
this actaully does. A Quick google search didn't result in too good
of results. Do you have any other references on how this
'multiview' option work?


Thanks, 

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Weston Cann
On Sunday, August 24, 2003, at 05:31 PM, Giz wrote:

Access is a pc database.  It doesn't run on unix.  Why people insist on
beating their heads against the wall in this manner I will never know.
Ignorance I suppose.  The alternative is to have your friend use a
relational database and have a few simple forms that will allow him to
insert/update/delete.  Best of both worlds, and the open source/free
databases mysql/postgresql are used on thousands of websites every day.
I share a low regard for Access, and I've got a set of standard 
forms/code I use to set up a nice interface to MySQL, and I showed it to 
my friend. He likes that, but there's a problem:

He wants to be able to make changes offline, and then sync up.

This isn't an uncommon desire... I've run into people wanting to do this 
before (with Excel spreadsheets, no less).  And in fact, it's probably 
the most convenient way of doing things, as long as they're warned about 
certain dangers (overwrites from competing unsynced database files).  
There's a certain cumbersome nature about web forms and the time delay 
involved in HTTP transactions.

So anyway, that's the motivation for using Access here.

David Otton <[EMAIL PROTECTED]> wrote:

Suggestion: go backwards. Set up the data in, say, MySQL with an ODBC
driver, and use Access as a front-end onto that data (Access makes a 
good
front-end for manipulating other databases). I've done this with SQL 
Server,
but it should be possible with anything that can talk ODBC.

He gets the interface he's used to, you get a database that can run 
under
BSD. Of course, changes will be reflected in the site in real-time, 
which
may be a good thing or a bad thing.

Either that or export the data from Access in a readable format, and 
import
it at the other end.
These ideas might work better; especially the latter. If COM doesn't 
work under UNIX and ODBC can only talk to FoxPro, Access, and other 
document (rather than server) oriented databases with the help of some 
special Win32 control panel/dll, then it would seem that the only way to 
do offline updates that are then synced would be exporting from Access 
in some standard format.

But it seems somewhat odd to me that there aren't any UNIXy (PHP, Perl, 
something) for parsing Access files. I know there's a few CPAN 
modules for Excel, but it's interesting that there's apparently nothing 
for Access.

~ == ~
http://weston.canncentral.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mail() question

2003-08-25 Thread Alister
> On Mon, 25 Aug 2003 01:09:29 +0200 Matthias Wulkow <[EMAIL PROTECTED]>
> writes:
> > 
> > Hi php-general,
> > I have followig error reported:
> > 
> > Fatal error: Call to undefined function: mail() in 
> > /usr/local/www/login.php on line 235
> > What is the trouble here?  If I would have trouble because of
> > delivery, normally mail would return false. But here...

> > I have php4.3.1 running on linux. I just installed postfix to have 
> > the
> > sendmail binary at the right place.

Did you install postfix _after_ PHP?  Did you have a sendmail binary in
place before you configured PHP?  If it's not there are configure time,
it won't even compile the 'mail' function.

I've had the same problem before - now that PHP can recognise it's got a
way to send email, re-running ./configure / make / make install should
work.  It did for me.

Alister

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
> Hi,
> 
> The simplest way i know of to use access from linux is to use mdbtools 
> (a free download at sourceforge). Haven't tried to invoke this from PHP 
> but it would not be all that difficult to create a MDB module.
> 
yeah, I saw a reference to that with some google searches.  Also
some references of using 'wine' but that seemed to be a little
overkill just to communicate with ms access.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Curt Zirzow
* Thus wrote David Otton ([EMAIL PROTECTED]):
> On Sun, 24 Aug 2003 14:54:41 -0400 (EDT), you wrote:
> 
> >I'm building a small web application for a friend using PHP. He'd like to
> >use MS Access to keep the data in, and update the data on the site by FTP'ing 
> 
> Suggestion: go backwards. Set up the data in, say, MySQL with an ODBC
> driver, and use Access as a front-end onto that data (Access makes a good
> front-end for manipulating other databases). I've done this with SQL Server,
> but it should be possible with anything that can talk ODBC.

I would  also suggest this. Basically you create a MS Access on his
computer and link (with odbc) mysql tables into the MS Access.

The only problem I forsee is granting remote access to the server.
Seeing that this is on a verio machine, I doubt they'll allow
access remotely. Perhaps there is a chance if your friend has a
static ip.

> Either that or export the data from Access in a readable format, and import
> it at the other end.

Yep, and this would be my alternative :)  Using CSV files of
course!


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Reading an MS Access Database file on *NIX platform usingPHP

2003-08-25 Thread [EMAIL PROTECTED]
Hi,

One of these ' tricky' windows linux bridging techniques is with JDBC. 
But that only works for sql server and not for access. This works like a 
dream if you are on J2EE. can be used with php as well if you don't mind 
mixing java and php classed. I have also had success with 'ODBC socket 
server' they renamed themselves and i am not sure of the new name though.

It wouldn't matter so much if people wanted to use ms SQL server instead 
they alsays insist on access :-((



Paul Fitzpatrick wrote:

* Thus wrote Giz ([EMAIL PROTECTED]):
 

Access is a pc database.  It doesn't run on unix.  Why people insist
   

on
 

beating their heads against the wall in this manner I will never know.
Ignorance I suppose.  The alternative is to have your friend use a
relational database and have a few simple forms that will allow him to
insert/update/delete.  Best of both worlds, and the open source/free
databases mysql/postgresql are used on thousands of websites every
   

day.

Programmers often get their heads banged against a wall 'by' clients.

I recently had to go through the whole issue of trying to use a client's
favorite Access DB on a Linux server with no success.  I tried
convincing him to switch to MySQL etc. but of course he wanted to stay
with what he knew.
Maybe try for some MSSQL capable hosting with this job, PEAR and ADODB
are great for ODBC, the only issue is setting up an ACCESS DSN, which
can't be done on a Unix box at this time.  I have heard of tricky
windows/linux bridging techniques though, but what ISP is going to set
up an extra windows box for one Access db?
Cheers,
Paul
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Reading an MS Access Database file on *NIX platform usingPHP

2003-08-25 Thread [EMAIL PROTECTED]
Hi,

The simplest way i know of to use access from linux is to use mdbtools 
(a free download at sourceforge). Haven't tried to invoke this from PHP 
but it would not be all that difficult to create a MDB module.



Curt Zirzow wrote:

* Thus wrote Giz ([EMAIL PROTECTED]):
 

Access is a pc database.  It doesn't run on unix.  Why people insist on
beating their heads against the wall in this manner I will never know.
Ignorance I suppose.  The alternative is to have your friend use a
relational database and have a few simple forms that will allow him to
insert/update/delete.  Best of both worlds, and the open source/free
databases mysql/postgresql are used on thousands of websites every day.
   

First off, Access has nothing to do with a pc, it is the
communication layer that causes the problem. And the only drivers
available for this layer are for MS Windows. 

PC !=  MS Windows

Second, Not every solution can be solved by plopping a
mysql/postregsql database server somewhere and use it. There are
multiple reasons why people choose one database over the other,
like costs, familiarity, and quickness of results.
MS Access is used on thousands of websites every day too.



Curt
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mail() question

2003-08-25 Thread Stevie D Peele
What is on line 235?? That would help us -


SDP


On Mon, 25 Aug 2003 01:09:29 +0200 Matthias Wulkow <[EMAIL PROTECTED]>
writes:
> 
> Hi php-general,
> 
> I have followig error reported:
> 
> Fatal error: Call to undefined function: mail() in 
> /usr/local/www/login.php on line 235
> 
> What is the trouble here?  If I would have trouble because of
> delivery, normally mail would return false. But here...
> 
> I have php4.3.1 running on linux. I just installed postfix to have 
> the
> sendmail binary at the right place.
> 
> Thx for help
> 
> SvT
> 
> -- 
> Who is the ennemy?
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

RE: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Paul Fitzpatrick


* Thus wrote Giz ([EMAIL PROTECTED]):
> Access is a pc database.  It doesn't run on unix.  Why people insist
on
> beating their heads against the wall in this manner I will never know.
> Ignorance I suppose.  The alternative is to have your friend use a
> relational database and have a few simple forms that will allow him to
> insert/update/delete.  Best of both worlds, and the open source/free
> databases mysql/postgresql are used on thousands of websites every
day.


Programmers often get their heads banged against a wall 'by' clients.

I recently had to go through the whole issue of trying to use a client's
favorite Access DB on a Linux server with no success.  I tried
convincing him to switch to MySQL etc. but of course he wanted to stay
with what he knew.

Maybe try for some MSSQL capable hosting with this job, PEAR and ADODB
are great for ODBC, the only issue is setting up an ACCESS DSN, which
can't be done on a Unix box at this time.  I have heard of tricky
windows/linux bridging techniques though, but what ISP is going to set
up an extra windows box for one Access db?

Cheers,
Paul

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Curt Zirzow
* Thus wrote Giz ([EMAIL PROTECTED]):
> Access is a pc database.  It doesn't run on unix.  Why people insist on
> beating their heads against the wall in this manner I will never know.
> Ignorance I suppose.  The alternative is to have your friend use a
> relational database and have a few simple forms that will allow him to
> insert/update/delete.  Best of both worlds, and the open source/free
> databases mysql/postgresql are used on thousands of websites every day.

First off, Access has nothing to do with a pc, it is the
communication layer that causes the problem. And the only drivers
available for this layer are for MS Windows. 

PC !=  MS Windows

Second, Not every solution can be solved by plopping a
mysql/postregsql database server somewhere and use it. There are
multiple reasons why people choose one database over the other,
like costs, familiarity, and quickness of results.

MS Access is used on thousands of websites every day too.




Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] mail() question

2003-08-25 Thread Matthias Wulkow
Hallo Curt,

am Montag, 25. August 2003 um 01:35 hast Du Folgendes gekritzelt:

>> I have followig error reported:
>> 
>> Fatal error: Call to undefined function: mail() in /usr/local/www/login.php on line 
>> 235
>> 
>> What is the trouble here?  If I would have trouble because of
>> delivery, normally mail would return false. But here...

CZ> mail() wasn't compiled into php.

>> 
>> I have php4.3.1 running on linux. I just installed postfix to have the
>> sendmail binary at the right place.

CZ> You'll have to recompile php. the first time you compiled it php it
CZ> couldnt find sendmail, so it left it out in the binary.

Well, that makes sense to me. But I just recompiled the same way I did
it first time (config.nice), but I still get the same error reported.
I looked in ./configure --help to see if there are specific arguments
I need to add, but couldn't find any... and this time sendmail is
there (/usr/sbin/sendmail).

What's wrong?

Thx

SvT


-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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