php-general Digest 15 Oct 2002 12:30:45 -0000 Issue 1645

Topics (messages 119971 through 120010):

Re: two submit buttons redirecting to two scripts
        119971 by: Peter Houchin
        119975 by: Sonal Patel

Re: passing mysql_error() out put to a different page?
        119972 by: Brad Bonkoski
        119973 by: Peter Houchin
        119974 by: John W. Holmes
        119981 by: Peter Houchin

Re: crypt() function
        119976 by: Marco Tabini

Re: Storing/passing variables through multiple-part function/casestatement
        119977 by: Verdon Vaillancourt
        119979 by: John W. Holmes
        119980 by: Verdon Vaillancourt

Re: __file__ and __line__
        119978 by: David T-G

Inserting a variable into a mysql_query() statement
        119982 by: Phil Clark
        119983 by: Timothy Hitchens
        119995 by: Jason Wong

PHP Upgrade
        119984 by: Ramesh Nagendra Pillai
        119991 by: Chris Hewitt
        120007 by: Simon Taylor

Re: People who searched this also searched this!
        119985 by: Simon Taylor

Getting the highest number in a column
        119986 by: Phil Schwarzmann
        119988 by: Simon Taylor
        119990 by: David Freeman

if conditional
        119987 by: Muhammad Khairuzzaman
        119998 by: Maxim Maletsky
        119999 by: Bob Irwin

Shipping problem...
        119989 by: Steve Jackson
        119993 by: Jason Wong

preg_grep
        119992 by: Mark Harwood

Code management
        119994 by: José León Serna

Re: Argh! nulls un stuff..
        119996 by: Francis

Content-Disposition IE bug
        119997 by: Francis
        120010 by: Aaron Gould

include "http"
        120000 by: Dan Healy
        120003 by: Maxim Maletsky

Re: How to setcookie with two domains
        120001 by: Marek Kilimajer

regular expression
        120002 by: Noodle Snacks
        120004 by: Ns_Andy
        120005 by: Noodle Snacks

Re: php mail()
        120006 by: Juhan Kundla

lynx and crontab
        120008 by: adrian murphy
        120009 by: Jon Haworth

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 ---
make sure there is nothing before the if statements
for example

<?php
if ($b1) {
 redirct to script1
}
elseif ($b2) {
redirct to script2
}
<HTML>
etc
</HTML>

and that should work fine regardless if your using the Header( Location...)
other means

> -----Original Message-----
> From: Sonal Patel [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 15 October 2002 8:06 AM
> To: Anup
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Re: two submit buttons redirecting to two scripts
>
>
> sorry, earlier I did not send the message to the group.
>
> Anup, I tried your solution which works exactly same as mine,
> and it also gives me error when I try to redirect.
> As far as echoing which button was selected --it was fine and both
> scripts work same.
> But redirect does not work.
>
> here is the error message,
> Warning: Cannot add header information - headers already sent by
> (output started at /home3/www/antriksh/resources/action2.php:5) in
> /home3/www/antriksh/resources/action2.php on line 13
>
> any help?
>
>
>
> On Monday, October 14, 2002, at 05:49 PM, Anup wrote:
>
> > you have this:
> > <input type="submit" value="b1" name="action" />
> >
> > <input type="submit" value="b2" name="action" />
> >
> > change the name of the buttons to b1 and b2, respectively, and give
> > them
> > some non-null value (as you have it)
> > Then in action.php you will have the following code:
> > if ($b1) {
> > redirct to script1
> > }
> > elseif ($b2) {
> > redirct to script2
> > }
> >
> > /*Either b1 OR b2 will have a value, not both, and use header() to
> > redirect
> > the sctipt*/
> >
> >
> >
> >
> > "Sonal Patel" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> Hello,
> >>
> >> I am very new to this group.
> >>
> >> I have a very simple question.
> >> Please look at this form,
> >> http://antriksh.com/resources/2_submit_button_form.shtml
> >>
> >> here I want to change the echo statement in the script "action.php" to
> >> redirect it to another script.
> >>
> >> ie, I want to change the form action dynamically.  How can I modify
> >> this form to do so?
> >>
> >> I tried few PHP tricks that did not work for me.  So I am asking this
> >> questions to anyone who may be able to help.
> >>
> >> Thank you ,
> >> Sonal
> >>
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>

--- End Message ---
--- Begin Message ---
thank you all for your help, now my form works and does what I expect 
it to do,---
here is the new version which redirects to two scripts with the revised 
  code--
http://antriksh.com/resources/2_submit_button_form2.shtml

Sonal


On Monday, October 14, 2002, at 08:44 PM, Peter Houchin wrote:

> make sure there is nothing before the if statements
> for example
>
> <?php
> if ($b1) {
>  redirct to script1
> }
> elseif ($b2) {
> redirct to script2
> }
> <HTML>
> etc
> </HTML>
>
> and that should work fine regardless if your using the Header( 
> Location...)
> other means
>
>> -----Original Message-----
>> From: Sonal Patel [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, 15 October 2002 8:06 AM
>> To: Anup
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: [PHP] Re: two submit buttons redirecting to two scripts
>>
>>
>> sorry, earlier I did not send the message to the group.
>>
>> Anup, I tried your solution which works exactly same as mine,
>> and it also gives me error when I try to redirect.
>> As far as echoing which button was selected --it was fine and both
>> scripts work same.
>> But redirect does not work.
>>
>> here is the error message,
>> Warning: Cannot add header information - headers already sent by
>> (output started at /home3/www/antriksh/resources/action2.php:5) in
>> /home3/www/antriksh/resources/action2.php on line 13
>>
>> any help?
>>
>>
>>
>> On Monday, October 14, 2002, at 05:49 PM, Anup wrote:
>>
>>> you have this:
>>> <input type="submit" value="b1" name="action" />
>>>
>>> <input type="submit" value="b2" name="action" />
>>>
>>> change the name of the buttons to b1 and b2, respectively, and give
>>> them
>>> some non-null value (as you have it)
>>> Then in action.php you will have the following code:
>>> if ($b1) {
>>> redirct to script1
>>> }
>>> elseif ($b2) {
>>> redirct to script2
>>> }
>>>
>>> /*Either b1 OR b2 will have a value, not both, and use header() to
>>> redirect
>>> the sctipt*/
>>>
>>>
>>>
>>>
>>> "Sonal Patel" <[EMAIL PROTECTED]> wrote in message
>>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>>> Hello,
>>>>
>>>> I am very new to this group.
>>>>
>>>> I have a very simple question.
>>>> Please look at this form,
>>>> http://antriksh.com/resources/2_submit_button_form.shtml
>>>>
>>>> here I want to change the echo statement in the script "action.php" 
>>>> to
>>>> redirect it to another script.
>>>>
>>>> ie, I want to change the form action dynamically.  How can I modify
>>>> this form to do so?
>>>>
>>>> I tried few PHP tricks that did not work for me.  So I am asking 
>>>> this
>>>> questions to anyone who may be able to help.
>>>>
>>>> Thank you ,
>>>> Sonal
>>>>
>>>
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>

--- End Message ---
--- Begin Message ---
Very interesting question....

The only thing I can come up with right now is if you detect an error
(one of the functions returning FALSE,)
you can write the contents of mysql_error() to a file log and display that
file on another page?  Or pass the output of that (mysql_error()) as an
HTTP/form variable to another page?
...spark any additional ideas??
-Brad

Peter Houchin wrote:

> howdy,
>
> I have a page that I want to control the errors etc for a site, now what I
> want is to perform a query on one page but if there's an error it opens a
> different page with the error message on it including the out put from
> mysql_error() can this be done?
>
> Cheers
>
> Peter
> "the only dumb question is the one that wasn't asked"
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
i have tried this .. but am getting errors at the moment .. (the sql error
is deliberate)

function new_user() {

   $res = mysql_query("INSERT INTO users WHERE uname='$_POST[uname]' ,
passwd='$_POST[pass]', firstname='$_POST[firstname]',
lastname='$_POST[lastname]', email='$_POST[email]' ")

// pass error onto logerror page

or die ('<form> <input type=hidden name=mysqlerror value=\"<?php echo
mysql_error();?>\"></form>' Header("Location:
logerror.php?op=insert_error"));

// insert into db worked  redirect
Header("Location: index.php");
}

but so far it's not likeing the Header inside the die that's fair enough I
can figure out why.. but other wise i can't figure out how to pass the die
value through if i make the error redirect  out side the die and have it in
a if statement or the like...

> -----Original Message-----
> From: Brad Bonkoski [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 15 October 2002 11:07 AM
> To: Peter Houchin
> Cc: php_gen
> Subject: Re: [PHP] passing mysql_error() out put to a different page?
>
>
> Very interesting question....
>
> The only thing I can come up with right now is if you detect an error
> (one of the functions returning FALSE,)
> you can write the contents of mysql_error() to a file log and display that
> file on another page?  Or pass the output of that (mysql_error()) as an
> HTTP/form variable to another page?
> ...spark any additional ideas??
> -Brad
>
> Peter Houchin wrote:
>
> > howdy,
> >
> > I have a page that I want to control the errors etc for a site,
> now what I
> > want is to perform a query on one page but if there's an error
> it opens a
> > different page with the error message on it including the out put from
> > mysql_error() can this be done?
> >
> > Cheers
> >
> > Peter
> > "the only dumb question is the one that wasn't asked"
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
Maybe you should just save the error message into a cookie or session
and then use header() to redirect to the error page.

---John Holmes...

> -----Original Message-----
> From: Peter Houchin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 14, 2002 9:22 PM
> To: Brad Bonkoski
> Cc: php_gen
> Subject: RE: [PHP] passing mysql_error() out put to a different page?
> 
> i have tried this .. but am getting errors at the moment .. (the sql
error
> is deliberate)
> 
> function new_user() {
> 
>    $res = mysql_query("INSERT INTO users WHERE uname='$_POST[uname]' ,
> passwd='$_POST[pass]', firstname='$_POST[firstname]',
> lastname='$_POST[lastname]', email='$_POST[email]' ")
> 
> // pass error onto logerror page
> 
> or die ('<form> <input type=hidden name=mysqlerror value=\"<?php echo
> mysql_error();?>\"></form>' Header("Location:
> logerror.php?op=insert_error"));
> 
> // insert into db worked  redirect
> Header("Location: index.php");
> }
> 
> but so far it's not likeing the Header inside the die that's fair
enough I
> can figure out why.. but other wise i can't figure out how to pass the
die
> value through if i make the error redirect  out side the die and have
it
> in
> a if statement or the like...
> 
> > -----Original Message-----
> > From: Brad Bonkoski [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, 15 October 2002 11:07 AM
> > To: Peter Houchin
> > Cc: php_gen
> > Subject: Re: [PHP] passing mysql_error() out put to a different
page?
> >
> >
> > Very interesting question....
> >
> > The only thing I can come up with right now is if you detect an
error
> > (one of the functions returning FALSE,)
> > you can write the contents of mysql_error() to a file log and
display
> that
> > file on another page?  Or pass the output of that (mysql_error()) as
an
> > HTTP/form variable to another page?
> > ...spark any additional ideas??
> > -Brad
> >
> > Peter Houchin wrote:
> >
> > > howdy,
> > >
> > > I have a page that I want to control the errors etc for a site,
> > now what I
> > > want is to perform a query on one page but if there's an error
> > it opens a
> > > different page with the error message on it including the out put
from
> > > mysql_error() can this be done?
> > >
> > > Cheers
> > >
> > > Peter
> > > "the only dumb question is the one that wasn't asked"
> > >
> > > --
> > > 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


--- End Message ---
--- Begin Message ---
I think that should work but for some reason nothing is getting written into
the session

function new_user() {

   $res = mysql_query("INSERT INTO users WHERE uname='$_POST[uname]' ,
passwd='$_POST[pass]', firstname='$_POST[firstname]',
lastname='$_POST[lastname]', email='$_POST[email]',
company='$_POST[company]'")
//I get out put here in mysql_error() when uncommented
//or die (mysql_error());

//no output from mysql_error() in $_SESSION['mysqlerror'] when i call
$_SESSION['mysqlerror'] but does take the redirect

or die ($_SESSION['mysqlerror'] = mysql_error() && Header("Location:
logerror.php?op=insert_error"));

Header("Location: index.php");
}

here is the code am calling it with :

function insert_error()
{
echo "<div align=center> <font class=\"option\"> There was an error
<br><br>";
echo $_SESSION['mysqlerror'];
echo "</font></div>";
 }

I have tripple checked that both pages have the session_start() on them
before any function is started.

any idea's?

> -----Original Message-----
> From: John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 15 October 2002 11:21 AM
> To: 'Peter Houchin'; 'Brad Bonkoski'
> Cc: 'php_gen'
> Subject: RE: [PHP] passing mysql_error() out put to a different page?
>
>
> Maybe you should just save the error message into a cookie or session
> and then use header() to redirect to the error page.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Peter Houchin [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 14, 2002 9:22 PM
> > To: Brad Bonkoski
> > Cc: php_gen
> > Subject: RE: [PHP] passing mysql_error() out put to a different page?
> >
> > i have tried this .. but am getting errors at the moment .. (the sql
> error
> > is deliberate)
> >
> > can figure out why.. but other wise i can't figure out how to pass the
> die
> > value through if i make the error redirect  out side the die and have
> it
> >
>

--- End Message ---
--- Begin Message ---
Have you considered using md5() instead?


On Mon, 2002-10-14 at 16:27, Adam Plocher wrote:
> Hello, I am trying to authenticate a password using the crypt()
> function.  Here's what I got:
>  
> if (crypt($_SERVER['PHP_AUTH_PW'],$data[1]) == $data[1]) 
> {
>     ...
> }
>  
> $data[1] being the salt..
>  
> It half-way works... If the users password is 'blah' it will
> authenticate fine, but if you append anything to the end of the password
> string, it will still allow authentication (ie 'blah12345' will still
> work, even though the password is 'blah').  Completely random passwords
> do not work, so it seems to be doing SOME checking.  Any help would be
> very appreciated.
>  
> Thanks
> -Adam


--- End Message ---
--- Begin Message ---
I have to get the data from table1, delete the data from table1, put the
data into table2. I'm either not getting the data from table1 or am not
passing it to table2, I'm not sure which.

On 10/14/02 6:37 PM, "John W. Holmes" <[EMAIL PROTECTED]> wrote:

> INSERT INTO table2 SELECT * FROM table1 WHERE ...
> DELETE FROM table1 WHERE ...
> 
> Where are you stuck?
> 
> ---John Holmes...
> 
>> -----Original Message-----
>> From: Verdon Vaillancourt [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, October 14, 2002 4:31 PM
>> To: PHP-General
>> Subject: [PHP] Storing/passing variables through multiple-part
>> function/casestatement
>> 
>> Hi,
>> 
>> Iım trying to cobble together a case where where data is retrieved
> from
>> one
>> row of a mySQL table, the row is deleted, the retrieved data is
> inserted
>> into a new row in different table. Most of my code seems to be working
> (I
>> think the data is being retrieved, the old row is being deleted, the
> new
>> row
>> is being created) but I am not getting a grip on how to pass the
> retrieved
>> data into the sql insert statement for the new row in the second
> table.
>> Iım
>> sure Iım missing something very basic and would appreciate any help
>> extended. The case statement as is now, is below.
>> 
>> TIA, verdon
>> 
>> Ps. Please cc me in any answer to the list as I am on digest mode
>> 
>>         case "finishPending":
>>         if ($user_dblocation)
>>         {
>>             @mysql_select_db("$user_dbname") or die ("Unable to select
>> database");
>> 
>>             $result = mysql_query("select uid, uname, name, url,
> email,
>> femail, pass, company, bio, description, address, city, province,
>> postcode,
>> phone, fax, tollfree, otherphone, cat AS uid, uname, name, url, email,
>> femail, pass, company, bio, description, address, city, province,
>> postcode,
>> phone, fax, tollfree, otherphone, cat from " .
> $table_prefix."users_que
>> where uid='$approve_uid'");
>>             list($uname) = mysql_fetch_row($result);
>> 
>>             mysql_query("lock tables " . $table_prefix."users_que
> WRITE");
>>             mysql_query("delete from " . $table_prefix."users_que
> where
>> uid='$approve_uid'");
>>             mysql_query("unlock tables");
>>             @mysql_select_db("$dbname") or die ("Unable to select
>> database");
>>         }
>>         else
>>         {
>>             $result = mysql_query("select uid, uname, name, url,
> email,
>> femail, pass, company, bio, description, address, city, province,
>> postcode,
>> phone, fax, tollfree, otherphone, cat AS uid, uname, name, url, email,
>> femail, pass, company, bio, description, address, city, province,
>> postcode,
>> phone, fax, tollfree, otherphone, cat from " .
> $table_prefix."users_que
>> where uid='$approve_uid'");
>>             list($uname) = mysql_fetch_row($result);
>> 
>>             mysql_query("lock tables " . $table_prefix."users_que
> WRITE");
>>             mysql_query("delete from " . $table_prefix."users_que
> where
>> uid='$approve_uid'");
>>             mysql_query("unlock tables");
>>         }
>> 
>>         mysql_query("LOCK TABLES " . $table_prefix."stories WRITE");
>>         mysql_query("UPDATE " . $table_prefix."stories SET
>> informant='$anonymous' WHERE informant='$uname'");
>>         mysql_query("UPDATE " . $table_prefix."stories SET
>> aid='$anonymous'
>> WHERE aid='$uname'");
>>         mysql_query("UNLOCK TABLES");
>> 
>>         global $uid, $uname, $name, $url, $email, $femail, $pass,
>> $company,
>> $bio, $description, $address, $city, $province, $postcode, $phone,
> $fax,
>> $tollfree, $otherphone, $cat;
>> 
>>         $sql = "insert into ".$table_prefix."users
>> 
> (name,uname,email,femail,url,pass,company,bio,description,address,city,p
> ro
>> vi
>> nce,postcode,phone,fax,tollfree,otherphone,cat,conversionflag) values
>> 
> ('$name','$uname','$email','$femail','$url','$pass','$company','$bio','$
> de
>> sc
>> 
> ription','$address','$city','$province','$postcode','$phone','$fax','$to
> ll
>> fr
>> ee','$otherphone','$cat','1')";
>> 
>>         if ($user_dblocation)
>>         {
>>             @mysql_select_db("$user_dbname") or die ("Unable to select
>> database");
>>             mysql_query("lock tables " . $table_prefix."users WRITE");
>>             $result = mysql_query($sql);
>>             mysql_query("unlock tables");
>>             @mysql_select_db("$dbname") or die ("Unable to select
>> database");
>>         }
>>         else
>>         {
>>             mysql_query("lock tables " . $table_prefix."users WRITE");
>>             $result = mysql_query($sql);
>>             mysql_query("unlock tables");
>>         }
>> 
>>         if (!$result)
>>         {
>>             echo mysql_errno(). ": ".mysql_error(). "<br />";
>>             return;
>>         }
>> 
>>         html_header_location("admin.php?op=adminMain");
>>         echo mysql_error();
>>         break;
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
So you use the INSERT INTO ... SELECT ... to do the select from table 1
and the insert into table 2. Then use a DELETE to erase the info from
table 1. 

Show your script so far, we can't help you much more without seeing what
you're doing.

---John Holmes...

> -----Original Message-----
> From: Verdon Vaillancourt [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 14, 2002 10:18 PM
> To: [EMAIL PROTECTED]; 'PHP-General'
> Subject: Re: [PHP] Storing/passing variables through multiple-
> partfunction/casestatement
> 
> I have to get the data from table1, delete the data from table1, put
the
> data into table2. I'm either not getting the data from table1 or am
not
> passing it to table2, I'm not sure which.
> 
> On 10/14/02 6:37 PM, "John W. Holmes" <[EMAIL PROTECTED]>
wrote:
> 
> > INSERT INTO table2 SELECT * FROM table1 WHERE ...
> > DELETE FROM table1 WHERE ...
> >
> > Where are you stuck?
> >
> > ---John Holmes...
> >
> >> -----Original Message-----
> >> From: Verdon Vaillancourt [mailto:[EMAIL PROTECTED]]
> >> Sent: Monday, October 14, 2002 4:31 PM
> >> To: PHP-General
> >> Subject: [PHP] Storing/passing variables through multiple-part
> >> function/casestatement
> >>
> >> Hi,
> >>
> >> Iım trying to cobble together a case where where data is retrieved
> > from
> >> one
> >> row of a mySQL table, the row is deleted, the retrieved data is
> > inserted
> >> into a new row in different table. Most of my code seems to be
working
> > (I
> >> think the data is being retrieved, the old row is being deleted,
the
> > new
> >> row
> >> is being created) but I am not getting a grip on how to pass the
> > retrieved
> >> data into the sql insert statement for the new row in the second
> > table.
> >> Iım
> >> sure Iım missing something very basic and would appreciate any help
> >> extended. The case statement as is now, is below.
> >>
> >> TIA, verdon
> >>
> >> Ps. Please cc me in any answer to the list as I am on digest mode
> >>
> >>         case "finishPending":
> >>         if ($user_dblocation)
> >>         {
> >>             @mysql_select_db("$user_dbname") or die ("Unable to
select
> >> database");
> >>
> >>             $result = mysql_query("select uid, uname, name, url,
> > email,
> >> femail, pass, company, bio, description, address, city, province,
> >> postcode,
> >> phone, fax, tollfree, otherphone, cat AS uid, uname, name, url,
email,
> >> femail, pass, company, bio, description, address, city, province,
> >> postcode,
> >> phone, fax, tollfree, otherphone, cat from " .
> > $table_prefix."users_que
> >> where uid='$approve_uid'");
> >>             list($uname) = mysql_fetch_row($result);
> >>
> >>             mysql_query("lock tables " . $table_prefix."users_que
> > WRITE");
> >>             mysql_query("delete from " . $table_prefix."users_que
> > where
> >> uid='$approve_uid'");
> >>             mysql_query("unlock tables");
> >>             @mysql_select_db("$dbname") or die ("Unable to select
> >> database");
> >>         }
> >>         else
> >>         {
> >>             $result = mysql_query("select uid, uname, name, url,
> > email,
> >> femail, pass, company, bio, description, address, city, province,
> >> postcode,
> >> phone, fax, tollfree, otherphone, cat AS uid, uname, name, url,
email,
> >> femail, pass, company, bio, description, address, city, province,
> >> postcode,
> >> phone, fax, tollfree, otherphone, cat from " .
> > $table_prefix."users_que
> >> where uid='$approve_uid'");
> >>             list($uname) = mysql_fetch_row($result);
> >>
> >>             mysql_query("lock tables " . $table_prefix."users_que
> > WRITE");
> >>             mysql_query("delete from " . $table_prefix."users_que
> > where
> >> uid='$approve_uid'");
> >>             mysql_query("unlock tables");
> >>         }
> >>
> >>         mysql_query("LOCK TABLES " . $table_prefix."stories
WRITE");
> >>         mysql_query("UPDATE " . $table_prefix."stories SET
> >> informant='$anonymous' WHERE informant='$uname'");
> >>         mysql_query("UPDATE " . $table_prefix."stories SET
> >> aid='$anonymous'
> >> WHERE aid='$uname'");
> >>         mysql_query("UNLOCK TABLES");
> >>
> >>         global $uid, $uname, $name, $url, $email, $femail, $pass,
> >> $company,
> >> $bio, $description, $address, $city, $province, $postcode, $phone,
> > $fax,
> >> $tollfree, $otherphone, $cat;
> >>
> >>         $sql = "insert into ".$table_prefix."users
> >>
> >
(name,uname,email,femail,url,pass,company,bio,description,address,city,p
> > ro
> >> vi
> >> nce,postcode,phone,fax,tollfree,otherphone,cat,conversionflag)
values
> >>
> >
('$name','$uname','$email','$femail','$url','$pass','$company','$bio','$
> > de
> >> sc
> >>
> >
ription','$address','$city','$province','$postcode','$phone','$fax','$to
> > ll
> >> fr
> >> ee','$otherphone','$cat','1')";
> >>
> >>         if ($user_dblocation)
> >>         {
> >>             @mysql_select_db("$user_dbname") or die ("Unable to
select
> >> database");
> >>             mysql_query("lock tables " . $table_prefix."users
WRITE");
> >>             $result = mysql_query($sql);
> >>             mysql_query("unlock tables");
> >>             @mysql_select_db("$dbname") or die ("Unable to select
> >> database");
> >>         }
> >>         else
> >>         {
> >>             mysql_query("lock tables " . $table_prefix."users
WRITE");
> >>             $result = mysql_query($sql);
> >>             mysql_query("unlock tables");
> >>         }
> >>
> >>         if (!$result)
> >>         {
> >>             echo mysql_errno(). ": ".mysql_error(). "<br />";
> >>             return;
> >>         }
> >>
> >>         html_header_location("admin.php?op=adminMain");
> >>         echo mysql_error();
> >>         break;
> >
> >
> >
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
On 10/14/02 11:07 PM, "John W. Holmes" <[EMAIL PROTECTED]> wrote:

> So you use the INSERT INTO ... SELECT ... to do the select from table 1
> and the insert into table 2. Then use a DELETE to erase the info from
> table 1. 
> 
> Show your script so far, we can't help you much more without seeing what
> you're doing.
> 
> ---John Holmes...
> 

Hi John, Thanks for your input on this and a other question/answers I have
read on this list. I did get this working, though likely in not the most
elegant manner. 

For instance, if I understand your hint correctly, I didn't know you could
put INSERT INTO ... SELECT ... In the same statement!

I did have too much code in the 1st post I made on this topic and the
relevant parts likely got lost in the forest ;)  If you're curious, I have
quoted what is now working for me below.

Salut, verdon

        if ($user_dblocation)
        {
            @mysql_select_db("$user_dbname") or die ("Unable to select
database");
            
            $result = mysql_query("select uid, uname, name, url, email,
femail, pass, company, bio, description, address, city, province, postcode,
phone, fax, tollfree, otherphone, cat from " . $table_prefix."users_que
where uid='$approve_uid'");
            list($uid, $uname, $name, $url, $email, $femail, $pass,
$company, $bio, $description, $address, $city, $province, $postcode, $phone,
$fax, $tollfree, $otherphone, $cat) = mysql_fetch_row($result);

        $sql = "insert into ".$table_prefix."users
(name,uname,email,femail,url,pass,company,bio,description,address,city,provi
nce,postcode,phone,fax,tollfree,otherphone,cat,conversionflag) values
('$name','$uname','$email','$femail','$url','$pass','$company','$bio','$desc
ription','$address','$city','$province','$postcode','$phone','$fax','$tollfr
ee','$otherphone','$cat','1')";
        
        if ($user_dblocation)
        {
            @mysql_select_db("$user_dbname") or die ("Unable to select
database");
            mysql_query("lock tables " . $table_prefix."users WRITE");
            $result = mysql_query($sql);
            mysql_query("unlock tables");
            @mysql_select_db("$dbname") or die ("Unable to select
database");
        }
        else
        {
            mysql_query("lock tables " . $table_prefix."users WRITE");
            $result = mysql_query($sql);
            mysql_query("unlock tables");
        }

        if (!$result)
        {
            echo mysql_errno(). ": ".mysql_error(). "<br />";
            return;
        }

            mysql_query("lock tables " . $table_prefix."users_que WRITE");
            mysql_query("delete from " . $table_prefix."users_que where
uid='$approve_uid'");
            mysql_query("unlock tables");
            @mysql_select_db("$dbname") or die ("Unable to select
database");
        }

--- End Message ---
--- Begin Message ---
Andy --

...and then Ns_Andy said...
% 
% what's its use and how to use(Example)?

They're constants that identify where you are.  I use __FILE__ so that I
don't have to keep tweaking my code when working in the development
environment:

  # this will let us figure out where we are and then always source the right include 
stuff!
  # it does not work with symlinks (__FILE__ reports the *target*)
  # you must have a full env tree in your devel tree; we now look exclusively in 
$DEVELDIR if set
  if ( ereg("/home/sites/\.php/",__FILE__) )            # are we *somewhere* in our 
usual master tree?
    { $DEVELDIR = preg_replace("|/.*/home/sites/\.php(.*)/[^/]*$|","$1",__FILE__) ; }  
 # get the working dir

  include("/home/sites/.php$DEVELDIR/includestuff.inc");        # include our various 
files

Our repository is under /home/sites/.php and there are various
production, development, and test dirs under there.  No more hard-coding

  /home/sites/.php/test6/includestuff.inc

in the code -- and, worse, forgetting to take it out when promoting
to production! :-)  [Yeah, I know that I should assign a variable
containing the "/home/sites/\.php/" string, but it's almost not worth
it in something that has to be self-contained like this and so I haven't
bothered :-]


% 
% Thanks

HTH & HAND


% --
% Regards,


:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg82295/pgp00000.pgp
Description: PGP signature

--- End Message ---
--- Begin Message ---
I'm trying to insert the variable $hidden_manuf_id into a mysql_query()
statement.

If i do this:
mysql_query("DELETE FROM product WHERE manufacturer=$hidden_manuf_id",$bb)
or die(mysql_error());
PHP server doesn't see the variable because it is inside the string
quotes"".

If I do this:
mysql_query("DELETE FROM product WHERE manufacturer="$hidden_manuf_id,$bb)
or die(mysql_error());
PHP server reports a parsing error.

What is the correct syntax?  ($bb is correctly defined.)



--- End Message ---
--- Begin Message ---
Single around the variable....

mysql_query("DELETE FROM product WHERE manufacturer='$hidden_manuf_id'",$bb)


Timothy Hitchens
[EMAIL PROTECTED]


Phil Clark wrote:
> I'm trying to insert the variable $hidden_manuf_id into a mysql_query()
> statement.
> 
> If i do this:
> mysql_query("DELETE FROM product WHERE manufacturer=$hidden_manuf_id",$bb)
> or die(mysql_error());
> PHP server doesn't see the variable because it is inside the string
> quotes"".
> 
> If I do this:
> mysql_query("DELETE FROM product WHERE manufacturer="$hidden_manuf_id,$bb)
> or die(mysql_error());
> PHP server reports a parsing error.
> 
> What is the correct syntax?  ($bb is correctly defined.)
> 
> 
> 
> 

-- 
Timothy Hitchens
Technologist / Entrepreneur
e-mail: [EMAIL PROTECTED]
mobile: 0419 521 440



-------------------------------------------------
HiTCHO Group - ABN: 85 816 540 110
Web Site: http://www.hitcho.com.au/
Snail Mail: PO Box 101 Arana Hills QLD 4054
Telephone: 07 3351 0951 - Facsimile: 07 3351 0952


IMPORTANT:
This email may be the view of the individual and
not that of the organisation. The contents of
this electronic mail (including attachments) may
be privileged and commercially confidential.

Any unauthorised use of the contents is expressly
prohibited. If you have received this document in
error, please advise us by telephone immediately
and then delete the document.


--- End Message ---
--- Begin Message ---
On Tuesday 15 October 2002 12:54, Phil Clark wrote:
> I'm trying to insert the variable $hidden_manuf_id into a mysql_query()
> statement.
>
> If i do this:
> mysql_query("DELETE FROM product WHERE manufacturer=$hidden_manuf_id",$bb)
> or die(mysql_error());

That should work iff manufacturer is a number. Otherwise you need 
single-quotes:

  "DELETE FROM product WHERE manufacturer='$hidden_manuf_id'"

> PHP server doesn't see the variable because it is inside the string
> quotes"".

Actually you DO need the double-quotes in order for PHP interpret 
$hidden_manuf_id as a variable.

What you really should do is split the above into two steps:

$query = "DELETE FROM product WHERE manufacturer=$hidden_manuf_id";
mysql_query($query, $bb) or die("Error in $query :: " . mysql_error());


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Check me if I'm wrong, Sandy, but if I kill all the golfers...
they're gonna lock me up and throw away the key!
*/

--- End Message ---
--- Begin Message ---
Hai all

I am using Apache/PHP4.0.1/PostgreSQL, I had upgraded
PHP to PHP.4.2.3, now My problem is none of my
PostgreSQL function are working and also the server
variables(e.g $REQUEST_METHOD..)also, Can any one
please help me out to fix this problem. This is the
first time I have upgraded my PHP. 

My earlier installation of PHP was default
installation, ie while installing linux7.1 it got
installed, I havent done anything in php.ini file.

Regards
Ramesh N

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
--- End Message ---
--- Begin Message ---
Ramesh Nagendra Pillai wrote:

>
>I am using Apache/PHP4.0.1/PostgreSQL, I had upgraded
>PHP to PHP.4.2.3, now My problem is none of my
>
register_globals now defaults to off. I think this may be your problem.

HTH
Chris

--- End Message ---
--- Begin Message ---
Ramesh,
Since php 4.2.0 register_globals is always set off - look in your php.ini
Cheers
Simon

-----Original Message-----
From: Ramesh Nagendra Pillai [mailto:[EMAIL PROTECTED]] 
Sent: 15 October 2002 08:30
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Upgrade


Hai all

I am using Apache/PHP4.0.1/PostgreSQL, I had upgraded
PHP to PHP.4.2.3, now My problem is none of my
PostgreSQL function are working and also the server variables(e.g
$REQUEST_METHOD..)also, Can any one please help me out to fix this problem.
This is the first time I have upgraded my PHP. 

My earlier installation of PHP was default
installation, ie while installing linux7.1 it got
installed, I havent done anything in php.ini file.

Regards
Ramesh N

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
This sounds a lot harder than it is, all you have to do is first of all make
some space ion your db then you need to cache searches that users have done.
Store the group of searches for unique users, then if someone does a search
match it against the cache and pop up all items which were retrieved by the
other cached searches for the other id's (you can build up the most popular
items if there are lots of matches)..
Amazon also caches your own searches and starts displaying groups of
products which they know you were interested in and related products, I
usually find them spot on so their logic is very good - it is bad for the
credit card though :(
Cheers
Simon
-----Original Message-----
From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] 
Sent: 14 October 2002 16:42
To: Randum Ian
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] People who searched this also searched this!



Gezz... This REALLY depends on your database design. You might want to track
item IDs and then store them together. There is a bit of logic play on this
one though..


-- 
Maxim Maletsky
[EMAIL PROTECTED]

www.PHPBeginner.com  // where PHP Begins



On Sun, 13 Oct 2002 18:15:16 +0100
"Randum Ian" <[EMAIL PROTECTED]> wrote:

> Hi guys,
> 
> Does anybody have a working example of doing the lists of 'People who 
> searched this also searched this!' that I see on Amazon and other 
> websites.
> 
> Any help much appreciated!
> 
> Randum Ian
> [EMAIL PROTECTED]
> DJ / Reviewer / Webmaster, DancePortal (UK) Limited
> DancePortal.co.uk - Global dance music media
> 
> 
> 
> 
> --
> 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
--- End Message ---
--- Begin Message ---
Using PHP and a MySQL database, I want to grab the highest number in a
particular column.  Right now I have this VERY inefficient code to grab
this number, there's got to be a better way.  Does anyone have any
ideas??
 
Thanks!
--- End Message ---
--- Begin Message ---
select MAX(colname)
from table;

Cheers
Simon

-----Original Message-----
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] 
Sent: 15 October 2002 09:29
To: [EMAIL PROTECTED]
Subject: [PHP] Getting the highest number in a column


Using PHP and a MySQL database, I want to grab the highest number in a
particular column.  Right now I have this VERY inefficient code to grab this
number, there's got to be a better way.  Does anyone have any ideas??
 
Thanks!
--- End Message ---
--- Begin Message ---

 > Using PHP and a MySQL database, I want to grab the highest 
 > number in a particular column.

As is usual for questions like this, the answer is most likely that you
should do it in your sql query.  In this case, something like this would
probably do it:

SELECT MAX(some_column) FROM some_table WHERE some = condition

CYA, Dave



--- End Message ---
--- Begin Message ---
Hello,

I would like to how to know how to create an if conditional with only one
condition. Can some one tell me the way to do this. This is my previos code
:

<
if (!name) {
print "<P>please enter your name.";
}
exit;

if (!$email) {
print "<P>Please enter you e-mail"
}
exit;

?>


--- End Message ---
--- Begin Message ---

You confused us. Would you like to explain us exactly what you meant?
Maybe with mentioning us your reasons/goals.


-- 
Maxim Maletsky
[EMAIL PROTECTED]

www.PHPBeginner.com  // where PHP Begins



On Tue, 15 Oct 2002 15:31:14 +0800
"Muhammad Khairuzzaman" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I would like to how to know how to create an if conditional with only one
> condition. Can some one tell me the way to do this. This is my previos code
> :
> 
> <
> if (!name) {
> print "<P>please enter your name.";
> }
> exit;
> 
> if (!$email) {
> print "<P>Please enter you e-mail"
> }
> exit;
> 
> ?>
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
If the code isn't working, its because you weren't using a $name in the
first if statement.   Always the little things ! :)

But this should work...

 if (!$name) {
 print "<P>please enter your name.";
 }


if (!$email) {
 print "<P>Please enter you e-mail";
 }

>
> > Hello,
> >
> > I would like to how to know how to create an if conditional with only
one
> > condition. Can some one tell me the way to do this. This is my previos
code
> > :
> >
> > <
> > if (!name) {
> > print "<P>please enter your name.";
> > }
> > exit;
> >
> > if (!$email) {
> > print "<P>Please enter you e-mail"
> > }
> > exit;
> >
> > ?>
> >
> >
> >
> > --
> > 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
>
>
> Scanned by PeNiCillin http://safe-t-net.pnc.com.au/
>
> Scanned by PeNiCillin http://safe-t-net.pnc.com.au/
>


Scanned by PeNiCillin http://safe-t-net.pnc.com.au/
--- End Message ---
--- Begin Message ---
Hi all,

I have a problem which I'm not sure the best way to go about. We will be
shipping products based on weight and I have two types of product with
differing weights. Basically we want to charge one price for shipping
less than 10 KG and one for anything over that.

I wonder how to go about it. I have the weights for each product and
have my products organised into two categories in MySQL DB. So anything
in category 1 means less than 30 items is below 10 Kilos and 15 in
category 2.
How would you code this? I have tried adding a weight category to my
products table and calculating total weight (then a simple if statement
would do the trick) but it leads to other problems which I couldn't
de-bug. Basically adding to my products table means my DB won't update
due to a Mysql error (column count didn't match or something) so I can't
do it that way or at least as my shop is currently working I'm scared of
messing with the code too much! I also need to have a combination of the
two products so the customer might buy 1 of category 2 and 35 of cat 1
etc.

Ideas to tackle this please?

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159

--- End Message ---
--- Begin Message ---
On Tuesday 15 October 2002 15:35, Steve Jackson wrote:
> Hi all,
>
> I have a problem which I'm not sure the best way to go about. We will be
> shipping products based on weight and I have two types of product with
> differing weights. Basically we want to charge one price for shipping
> less than 10 KG and one for anything over that.
>
> I wonder how to go about it. I have the weights for each product and
> have my products organised into two categories in MySQL DB. So anything
> in category 1 means less than 30 items is below 10 Kilos and 15 in
> category 2.

Perhaps I don't understand you properly -- why you need two categories? How is 
shipping charge calculated? 


Do you just have two rates (which your 1st paragraph seems to imply) -- ie If 
the total weight of products is under 10KG charge $5, otherwise charge $10? 
...

> How would you code this? I have tried adding a weight category to my
> products table and calculating total weight (then a simple if statement
> would do the trick) 

... In which case, yes a simple if statement would suffice.

> but it leads to other problems which I couldn't
> de-bug. Basically adding to my products table means my DB won't update
> due to a Mysql error (column count didn't match or something) 

Perhaps if you post your code and your db schema here then someone may be able 
to help.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"God is a comedian playing to an audience too afraid to laugh."
- Voltaire
*/

--- End Message ---
--- Begin Message ---
Hi All,

I've written a inifile class and was trying to improve it but got stuck
trying to read all the sections:

[Section 1]
name=value

[Section 2]
name=value

$Inifile is the inifile read into an array but the following doesn't work:

$Sections = preg_grep("/(?<=^\[)([^\[\]]+)(?=\]$)/i", $IniFile);

It always includes the [ ] brackets.  Don't look behinds/aheads work with
preg_grep? Or am I doing something wrong.

Thanks.


--- End Message ---
--- Begin Message ---
Hello, I would like to hear your experience about this matter:

I have a lot of separate scripts and most of them need another script,
for example:

phpgrid
   uses adodb
   uses ldap_rol

phplogin
   uses ldap_rol

And so on, I have a CVS server to store/develop single scripts, but I
want to store them as full solutions, I mean, when I make a checkout I
want to get the full working package, so I have duplicate files. What is
the best way to manage this kind of development?

Regards.

Attachment: signature.asc
Description: This is a digitally signed message part

--- End Message ---
--- Begin Message ---
i think that was one of the problems, some places the session var was set
back as a string ("0") and other as int (0).

anyway thanks to all, panic over all working now :)

"Jason Young" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> My suggestion would be to checck for isset($_SESSION["temp"]) and if
> ($_SESSION["temp"] > "0") with quotes .. PHP is very forgiving with data
> types, and I've found its much easier to keep track of what exactly is
> going on if I reference everything in a string format.
>
> -Jason
>
> Sam Masiello wrote:
>
> > How about something like this:
> >
> > if ($_SESSION["temp"] > 0) ?
> >
> > Or if you want to be really sure:
> >
> > if ($_SESSION["temp"] > 0 && $_SESSION["temp"] != "")
> >
> > OR....if you want to be sure the value is a number as well:
> >
> > if ($_SESSION["temp"] > 0 && $_SESSION["temp"] != "" &&
> > is_numeric($_SESSION["temp"])
> >
> > HTH
> >
> > Sam Masiello
> > Software Quality Assurance Engineer
> > Synacor
> > (716) 853-1362 x289
> > [EMAIL PROTECTED]
> >
> >
> >
> > -----Original Message-----
> > From: Francis [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 14, 2002 9:23 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Argh! nulls un stuff..
> >
> >
> > ok going mad all I need to do is check a variable and if it has a number
> > in it then do something, so anything from 0 up, but it keeps thinking 0
> > is null and failing, anyway around this? or am I just being stupid as
> > usual?
> >
> > $_SESSION["temp"] = 0;
> > $tempVar = 0;
> >
> > if($_SESSION["temp"] !=""){ echo "!= condition
> > "; }
> > if(isset($_SESSION["temp"])){ echo "isset condition
> > ";}
> > if(isset($tempVar)){ echo "tempVar isset condition
> > ";} if($tempVar
> > !=""){ echo "tempVar != condition
> > ";} if(!empty($tempVar)){ echo
> > "tempVar !empty condition
> > ";}
> >
> >
> >
> >
> >
>


--- End Message ---
--- Begin Message ---
ok i know this has popped up a couple of times before but i'm still having
problems. What I need is the download popup to popup and ask the user if
they wish to save or open the file they want to download. If you click open
IE saves the file in your temp cache and then opens up the associated proggy
and for some bizare reason adds "[1]" at the end of the filename and cant
find the file in cache. At the moment i'm using the following:

Header("Content-Type: application/octet-stream");
Header("Content-Transfer-Encoding: binary");
Header("File-Length: $fileSize");
Header("Content-Disposition: attachment; filename=$filename");
Header("Content-Description: File from DMS");
fpassthru($fh);



--- End Message ---
--- Begin Message ---
I remember reading on this a long while back.  Try searching the archives of
this list.  The solution pointed to a Microsoft Knowledge Base article.

If I recall correctly, it involved simply adding "%20" to the end of your
filename string...

Something like this:

    Header("Content-Disposition: attachment; filename=$filename%20");

Give it a try.  I might be way off, but you've got nothing to lose.  :)

--
Aaron Gould
Web Developer
Parts Canada


"Francis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ok i know this has popped up a couple of times before but i'm still having
> problems. What I need is the download popup to popup and ask the user if
> they wish to save or open the file they want to download. If you click
open
> IE saves the file in your temp cache and then opens up the associated
proggy
> and for some bizare reason adds "[1]" at the end of the filename and cant
> find the file in cache. At the moment i'm using the following:
>
> Header("Content-Type: application/octet-stream");
> Header("Content-Transfer-Encoding: binary");
> Header("File-Length: $fileSize");
> Header("Content-Disposition: attachment; filename=$filename");
> Header("Content-Description: File from DMS");
> fpassthru($fh);
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi,

I wrote a program to authenticate users.  I would like to place a few lines
at the top a  webpage that would call this program.  Some web pages will be
on the same server as the authentication program, others will not.

Can I use include/require of do I need to use fopen?  The program returns
true or false upon account validation, so I am not sure how I can use fopen

 I have tried the following so far and cannot get it to work

<?
 php ini_set("include_path","http://myserver/scripts";);
$foo=require("/ndsauth.php");
if(!$foo)  {
  exit;
}
?>




Any suggestions would be appreciated

Thanks
Dan



--- End Message ---
--- Begin Message ---

In order to use your PHP script (authentication features etc) you need
to have the all files within the same server.

As of including files, virtually - yes, yo can use include for remote
files, but you will not be able to execute the remote PHP code. You will
only include the output. ie: include('www.google.com'); includes you
google's homepage, not the Terrabytes of their database access :)


-- 
Maxim Maletsky
[EMAIL PROTECTED]

www.PHPBeginner.com  // where PHP Begins



"Dan Healy" <[EMAIL PROTECTED]> wrote... :

> Hi,
> 
> I wrote a program to authenticate users.  I would like to place a few lines
> at the top a  webpage that would call this program.  Some web pages will be
> on the same server as the authentication program, others will not.
> 
> Can I use include/require of do I need to use fopen?  The program returns
> true or false upon account validation, so I am not sure how I can use fopen
> 
>  I have tried the following so far and cannot get it to work
> 
> <?
>  php ini_set("include_path","http://myserver/scripts";);
> $foo=require("/ndsauth.php");
> if(!$foo)  {
>   exit;
> }
> ?>
> 
> 
> 
> 
> Any suggestions would be appreciated
> 
> Thanks
> Dan
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Set two cookies, one for each domain, and update them both as well.

Phil Powell wrote:

>Is it possible, w/o using sessionid session variables, to use setcookie to set a 
>cookie that will have two domains or more?
>
>Just curious.  I am having to set a cookie that will go to one domain and then to 
>another domain.  Not sure if I can do multiple setcookie commands and be able to 
>produce the desired results.
>
>Thanx
>Phil
>
>  
>

--- End Message ---
--- Begin Message ---
what would be a simple regular expression for <a href="<anythinghere>">?

for future reference are there any good references for them?


--
JJ Harrison
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
perl: preg_match
'/<a\s*href/s*=/s*[\'"]?[^<>\'"]+[\'"]?>/i'

or eregi
'<a[ ]*href[ ]*=[ ]*[\'"]?[^<>\'"]+[\'"]?>'


--
Regards,

"Noodle Snacks" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> what would be a simple regular expression for <a href="<anythinghere>">?
>
> for future reference are there any good references for them?
>
>
> --
> JJ Harrison
> [EMAIL PROTECTED]
>
>


--- End Message ---
--- Begin Message ---
Thanks.


"Ns_andy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> perl: preg_match
> '/<a\s*href/s*=/s*[\'"]?[^<>\'"]+[\'"]?>/i'
>
> or eregi
> '<a[ ]*href[ ]*=[ ]*[\'"]?[^<>\'"]+[\'"]?>'
>
>
> --
> Regards,
>
> "Noodle Snacks" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > what would be a simple regular expression for <a href="<anythinghere>">?
> >
> > for future reference are there any good references for them?
> >
> >
> > --
> > JJ Harrison
> > [EMAIL PROTECTED]
> >
> >
>
>


--- End Message ---
--- Begin Message ---
Ühel ilusal päeval [14-10-2002 22:46] kirjutas John W. Holmes:
> > Hey do you guys know how to correct this problem with sending email?
> > 
> > A custumer uses mail() to send the email and it isn't deliverable. So
> the
> > message bounces. But since the local sendmail sent the email it thus
> > bounces
> > to root's mailbox instead of say the replyto address. Anyone know how
> to
> > correct it so that it sends the bounces to the person sending it? This
> is
> > on
> > a virtual host machine with hundreds of domains.
> 
> The users probably need to set a FROM header in their mail
> 
> $header = "FROM: [EMAIL PROTECTED]";
> 
> mail($to,$subject,$body,$header);
> 
> Then the bounce should go to that address.

There are two different headers -- the "From:" header and the "From"
header. Bounces go to the address specified in the "From" header. I
believe you must reconfigure your MTA to send different From header, i
don't think this can be set within PHP.

Cheers,
Juhan
--- End Message ---
--- Begin Message ---
my isp lets me control crontab so i've been trying to
run a php script every 30 mins.

the command is like this:
lynx - dump http://www.mysite.com/test.php

which gives the error

lynx: Start file could not be found or is not text/html or text/plain

what do i telll my isp to do to get lynx to supprt .php files?
(i get a better response from them if i tell them exactly what to do ;-)  )

tia 
adrian
--- End Message ---
--- Begin Message ---
Hi Adrian,

> the command is like this:
> lynx - dump http://www.mysite.com/test.php
> 
> which gives the error
> 
> lynx: Start file could not be found or is not text/html or text/plain

Try losing the space between the "-" and "dump": it should be something like


  lynx -dump http://www.mysite.com/test.php


HTH
Jon
--- End Message ---

Reply via email to