php-general Digest 28 Jul 2001 12:10:28 -0000 Issue 782

Topics (messages 60019 through 60037):

Re: substr question...
        60019 by: Ryan Fischer

FORCING A PHP OUTPUT TO BE CACHED
        60020 by: Randy Johnson

Re: [PHP-DEV] Passing JavaScript variables to PHP
        60021 by: Markus Fischer

Re: Please Please Pleeeeaaaaaaaaaasssssssseeeeeee
        60022 by: Ben Bleything

auto refresh in every five seconds.
        60023 by: Mark Lo
        60024 by: Matt Greer

Stripping single quotes
        60025 by: Matt Stone
        60026 by: Chris Fry
        60032 by: Matt Stone

PHP on win2k/Weblogic?
        60027 by: Rory O'Connor

Adding scripts
        60028 by: Tim Thorburn
        60029 by: Chris Fry

install PHP --with-java on FreeBSD.  No luck.
        60030 by: SlowPork

Re: Dumping fields.....
        60031 by: Dell Coleman

doubt regarding mysql & php
        60033 by: Balaji Ankem
        60034 by: Simon Robson
        60035 by: Werner Stuerenburg

regarding password in mysql?
        60036 by: Balaji Ankem

How to make a cookie never expire in PHP?
        60037 by: Joel

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]


----------------------------------------------------------------------


You wrote:
> I am trying to receive file names but can't quite figure out the
proper > substr to do it:
>
> jeff.dat
> jeffrey.dat
> chris.dat
> tom.dat
>
> I want to receive the name to the left of the .dat
>
> Jeff

$file = array("jeff.dat", "jeffrey.dat", "chris.dat", "tom.dat");
for($i=0; $i<count($file); $i++){
    eregi("^(.*)\.dat$", $file[$i], $ary);
    $filename = $ary[1];
    // Do something with $filename
    print "$filename<br>\n";
}

HTH!  :)

--
 -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/






Is it possible to force a confirmation page that is displayed via a post
operation to be cached so it will not rerun the script when somebody hits
the refresh button?   I am hoping it is easy as using a header....   thanks
in advance


Randy





On Fri, Jul 27, 2001 at 04:31:51PM -0500, Craig Gardner wrote : 
> Is there any way to pass JavaScript variables to PHP?

This doesn't belong in here; this list is for the development OF
php and _not_ WITH. Ask at [EMAIL PROTECTED]

- Markus

-- 
Markus Fischer,  http://guru.josefine.at/~mfischer/
EMail:         [EMAIL PROTECTED]
PGP Public  Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1  C2B5 D674 B445 C227 2BD0




There are a wealth of available scripts at other websites...
www.hotscripts.com for instance... I find it unlike at this point that
anybody will send you anything... Just go there, or to SourceForge, and
you'll find all you need.

Ben

-----Original Message-----
From: Kyle Smith [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 27, 2001 5:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Please Please Pleeeeaaaaaaaaaasssssssseeeeeee

Can everybody please send me a simple script they have made it doesnt
matter what, i just need some material to learn from, i learn better
hands on.


-legokiller666-
http://www.StupeedStudios.f2s.com
New address.... new site

ICQ: 115852509
MSN: [EMAIL PROTECTED]
AIM: legokiller666







Hi,

        I would like to know how to do a auto refresh in every five seconds.

Thanks

Mark






----- Original Message -----
From: "Mark Lo" <[EMAIL PROTECTED]>
To: "php general" <[EMAIL PROTECTED]>
Sent: Friday, July 27, 2001 10:40 PM
Subject: [PHP] auto refresh in every five seconds.


> Hi,
>
>         I would like to know how to do a auto refresh in every five
seconds.

This isn't php, and javascript can surely do this. But this will also do
it...

<META HTTP-EQUIV="Refresh"
content="X;URL=http://www.website.com/index.html";>

Where X is the number of seconds between refreshes, and set the url to
itself. Place this within the head.

Matt







Hi all,
I am trying to validate some email addresses before they are entered into
the database.
The problem is, some thick or malicious people are entering single quotes
into their email addresses.
I need to strip out all these single quotes but a little ole' str_replace
doesn't seem to be working.
Here it is:

$fldemail == str_replace("'","",$fldemail);

Nice and basic :)
Can anyone please enlighten me on this?
Thanks in advance,

Matt Stone





Matt,

Try ereg_replace:-

$fldemail == ereg_replace("'","",$fldemail);

Chris


Matt Stone wrote:

> Hi all,
> I am trying to validate some email addresses before they are entered into
> the database.
> The problem is, some thick or malicious people are entering single quotes
> into their email addresses.
> I need to strip out all these single quotes but a little ole' str_replace
> doesn't seem to be working.
> Here it is:
>
> $fldemail == str_replace("'","",$fldemail);
>
> Nice and basic :)
> Can anyone please enlighten me on this?
> Thanks in advance,
>
> Matt Stone
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--

Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.






Darn, it still 'aint working. Ok, let's say $fldemail contains
"o\'[EMAIL PROTECTED]"
I then run these:
$fldemail == stripslashes($fldemail);
$fldemail == ereg_replace("'","",$fldemail);
And I get "o\'[EMAIL PROTECTED]" ... damn.

Any ideas? Thanks,

Matt Stone

-----Original Message-----
From: Chris Fry [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 28 July 2001 2:15 PM
To: Matt Stone
Cc: PHP list
Subject: Re: [PHP] Stripping single quotes


Matt,

Try ereg_replace:-

$fldemail == ereg_replace("'","",$fldemail);

Chris


Matt Stone wrote:

> Hi all,
> I am trying to validate some email addresses before they are entered into
> the database.
> The problem is, some thick or malicious people are entering single quotes
> into their email addresses.
> I need to strip out all these single quotes but a little ole' str_replace
> doesn't seem to be working.
> Here it is:
>
> $fldemail == str_replace("'","",$fldemail);
>
> Nice and basic :)
> Can anyone please enlighten me on this?
> Thanks in advance,
>
> Matt Stone
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--

Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.



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






I have been using PHP/MySQL to build alot of little utilities (like form
mailers, contact DBs etc.) for my sites on linux and freebsd, but I just
got a client requiring a win2k server running WebLogic (for JSP
purposes).  Can I even install PHP in that environment and if so, would
it conflict with the JSP servlets?  I would love to figure out a way to
leverage the PHP utilities i've built and tested.

If not, would ActiveState Perl be usable in that setup?  if I can't use
PHP, perl would be the next best thing.  Worst case scenario is I have
to bite the bullet and try to figure out JSP and re-build the utilities
with that.

Thanks!

providing the finest in midget technology




Hi,

I'm creating a very simple script (or so I thought) in which a user can 
select items from a form, the script will take the number values of those 
items and do two things: display the names of the items selected, and add 
the items together and give the user a total price including taxes.

In my form, I use the following syntax:
<input type="checkbox" name="hit_955" value="14.72">

The form is then sent using the POST method.

I then retrieve the values using the following syntax:
$hit_955 = $HTTP_POST_VARS["hit_955"];

All together there are 14 items a user can choose - for testing purposes, I 
chose all items.  The script would only display and add the first, second, 
and tenth items.  All others are ignored.

Here is the script - its broken into three parts - the first part is 
collecting the information - the second part is doing the actual math - and 
the third part displays the item names that the user chose.  Does anyone 
see anything wrong with this script, or have a possible reason why its only 
choosing 3 out of 14 items to work with?

PART ONE:
<?

$SubTotal = 0;
$FormattedSubTotal = 0;
$Total = 0;
$FormattedTotal = 0;

$PST = 1.08;
$GST = 1.07;
$CalcPST = 0;
$CalcGST = 0;
$FormattedPST = 0;
$FormattedGST = 0;

$nokia252c = 0;
$battery = 0;
$hit_955 = 0;
$hit_965 = 0;
$nok_cbl_7 = 0;
$nok_lch_6rpd = 0;
$nok_cgh10 = 0;
$nok_lch9 = 0;
$belt_252 = 0;
$nokia_0261670 = 0;
$s_nok_0261669 = 0;
$nok_mbc_3k = 0;
$nok_cark_89 = 0;
$nok_cark_90 = 0;

$nokia252c = $HTTP_POST_VARS["nokia252c"];
$battery = $HTTP_POST_VARS["battery"];
$hit_955 = $HTTP_POST_VARS["hit_955"];
$hit_965 = $HTTP_POST_VARS["hit_965"];
$nok_cbl_7 = $HTTP_POST_VARS["nok_cbl_7"];
$nok_lch_6rpd = $HTTP_POST_VARS["nok_lch_6rpd"];
$nok_cgh10 = $HTTP_POST_VARS["nok_cgh10"];
$nok_lch9 = $HTTP_POST_VARS["nok_lch9"];
$belt_252 = $HTTP_POST_VARS["belt_252"];
$nokia_0261670 = $HTTP_POST_VARS["nokia_0261670"];
$s_nok_0261669 = $HTTP_POST_VARS["s_nok_0261669"];
$nok_mbc_3k = $HTTP_POST_VARS["nok_mbc_3k"];
$nok_cark_89 = $HTTP_POST_VARS["nok_cark_89"];
$nok_cark_90 = $HTTP_POST_VARS["nok_cark_90"];

?>

PART TWO:
<?
$SubTotal = $nokia252c + $battery + $hit_955 + $hit_965 + $nok_cbl_7 + 
$nok_lch_6rpd + $nok_cgh10 + $nok_lch9 + $belt_252 + $nokia_0261670 + 
$s_nok_0261669 + $nok_mbc_3k + $nok_cark_89 + $nok_cark_90;
$CalcPST = ($SubTotal * $PST) - $SubTotal;
$CalcGST = ($SubTotal * $GST) - $SubTotal;
$Total = $SubTotal + $CalcPST + $CalcGST;
$FormattedSubTotal = number_format($SubTotal, 2);
$FormattedPST = number_format($CalcPST, 2);
$FormattedGST = number_format($CalcGST, 2);
$FormattedTotal = number_format($Total, 2);
?>

PART THREE:
<? if ($nokia252c > 0)
{
   echo "Nokia 252c";
}
   else
{
   echo "";
} ?>


Thanks
-Tim





Tim,

It is not necessary to retrieve your values using $HTTP_POST_VARS, the
variables can be referred to by their name, e.g $hit_955 so in PART 1 it
appears that you are intialising everything that was passed from the select
page to 0. All you need to do is initialise your counters.

PART ONE:
<?

$SubTotal = 0;
$FormattedSubTotal = 0;
$Total = 0;
$FormattedTotal = 0;

$PST = 1.08;
$GST = 1.07;
$CalcPST = 0;
$CalcGST = 0;
$FormattedPST = 0;
$FormattedGST = 0;
?>

I would say that the 3 items that you are getting values for are spelt
incorrectly in that initialisation section and are not getting zeroed.

The problem is that the missing values will be a null string and your
calculation will fail.

For each value passed you will need to do a test and set to 0 if the variable
does not exist e.g.:-

if(!$hit_955) {
    $hit_955 = 0;
}

etc...

Have fun,

Chris

Tim Thorburn wrote:

> Hi,
>
> I'm creating a very simple script (or so I thought) in which a user can
> select items from a form, the script will take the number values of those
> items and do two things: display the names of the items selected, and add
> the items together and give the user a total price including taxes.
>
> In my form, I use the following syntax:
> <input type="checkbox" name="hit_955" value="14.72">
>
> The form is then sent using the POST method.
>
> I then retrieve the values using the following syntax:
> $hit_955 = $HTTP_POST_VARS["hit_955"];
>
> All together there are 14 items a user can choose - for testing purposes, I
> chose all items.  The script would only display and add the first, second,
> and tenth items.  All others are ignored.
>
> Here is the script - its broken into three parts - the first part is
> collecting the information - the second part is doing the actual math - and
> the third part displays the item names that the user chose.  Does anyone
> see anything wrong with this script, or have a possible reason why its only
> choosing 3 out of 14 items to work with?
>
> PART ONE:
> <?
>
> $SubTotal = 0;
> $FormattedSubTotal = 0;
> $Total = 0;
> $FormattedTotal = 0;
>
> $PST = 1.08;
> $GST = 1.07;
> $CalcPST = 0;
> $CalcGST = 0;
> $FormattedPST = 0;
> $FormattedGST = 0;
>
> $nokia252c = 0;
> $battery = 0;
> $hit_955 = 0;
> $hit_965 = 0;
> $nok_cbl_7 = 0;
> $nok_lch_6rpd = 0;
> $nok_cgh10 = 0;
> $nok_lch9 = 0;
> $belt_252 = 0;
> $nokia_0261670 = 0;
> $s_nok_0261669 = 0;
> $nok_mbc_3k = 0;
> $nok_cark_89 = 0;
> $nok_cark_90 = 0;
>
> $nokia252c = $HTTP_POST_VARS["nokia252c"];
> $battery = $HTTP_POST_VARS["battery"];
> $hit_955 = $HTTP_POST_VARS["hit_955"];
> $hit_965 = $HTTP_POST_VARS["hit_965"];
> $nok_cbl_7 = $HTTP_POST_VARS["nok_cbl_7"];
> $nok_lch_6rpd = $HTTP_POST_VARS["nok_lch_6rpd"];
> $nok_cgh10 = $HTTP_POST_VARS["nok_cgh10"];
> $nok_lch9 = $HTTP_POST_VARS["nok_lch9"];
> $belt_252 = $HTTP_POST_VARS["belt_252"];
> $nokia_0261670 = $HTTP_POST_VARS["nokia_0261670"];
> $s_nok_0261669 = $HTTP_POST_VARS["s_nok_0261669"];
> $nok_mbc_3k = $HTTP_POST_VARS["nok_mbc_3k"];
> $nok_cark_89 = $HTTP_POST_VARS["nok_cark_89"];
> $nok_cark_90 = $HTTP_POST_VARS["nok_cark_90"];
>
> ?>
>
> PART TWO:
> <?
> $SubTotal = $nokia252c + $battery + $hit_955 + $hit_965 + $nok_cbl_7 +
> $nok_lch_6rpd + $nok_cgh10 + $nok_lch9 + $belt_252 + $nokia_0261670 +
> $s_nok_0261669 + $nok_mbc_3k + $nok_cark_89 + $nok_cark_90;
> $CalcPST = ($SubTotal * $PST) - $SubTotal;
> $CalcGST = ($SubTotal * $GST) - $SubTotal;
> $Total = $SubTotal + $CalcPST + $CalcGST;
> $FormattedSubTotal = number_format($SubTotal, 2);
> $FormattedPST = number_format($CalcPST, 2);
> $FormattedGST = number_format($CalcGST, 2);
> $FormattedTotal = number_format($Total, 2);
> ?>
>
> PART THREE:
> <? if ($nokia252c > 0)
> {
>    echo "Nokia 252c";
> }
>    else
> {
>    echo "";
> } ?>
>
> Thanks
> -Tim
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--

Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.






Hello.

After I compiled PHP with Java support, I instantiated new class [ eg.<?  $system = 
new Java('java.lang.System');  ?>  ].     I got blank response, and that child of 
Apache died.  

Is this a bug that I should report?  or I'm missing somthing here?   Any expert please 
give me some suggestions.

For Apache error log, 
[Fri Jul 27 17:40:01 2001] [notice] child pid 48040 exit signal Bus error (10)
[Fri Jul 27 17:40:02 2001] [notice] child pid 48041 exit signal Bus error (10)
[Fri Jul 27 17:40:03 2001] [notice] child pid 48042 exit signal Bus error (10)

I use PHP Version 4.0.6
./configure --with-apxs=/usr/local/sbin/apxs --with-java=/usr/local/linux-jdk1.3.1

phpinfo() shows Java section fine.
java.class.path   
/usr/local/lib/php/php_java.jar:/usr/local/linux-jdk1.3.1/jre/lib/rt.jar
java.home          /usr/local/linux-jdk1.3.1
java.library         libjava.so
java.library.path 
/usr/local/lib:/usr/compat/linux/lib:/usr/local/linux-jdk1.3.1/jre/lib/i386:/usr/local/linux-jdk1.3.1/jre/lib/i386/hotspot:/usr/local/linux-jdk1.3.1/jre/lib/i386/native_threads

From, php.ini
java.home=/usr/local/linux-jdk1.3.1
java.class.path=/usr/local/lib/php/php_java.jar:/usr/local/linux-jdk1.3.1/jre/lib/rt.jar
extension_dir=/usr/local/lib/php/20001222
extension=libphp_java.so
java.library.path=/usr/local/lib:/usr/compat/linux/lib:/usr/local/linux-jdk1.3.1/jre/lib/i386:/usr/local/linux-jdk1.3.1/jre/lib/i386/hotspot:/usr/local/linux-jdk1.3.1/jre/lib/i386/native_threads
java.library=libjava.so

I tried both Sun Java 1.3.1, and Blackdown 1.2.2.  It gave same error on Apache.  Java 
itself works fine from shell.

I use FreeBSD 4.3 Stable,  Linux compat mode is on
# kldstat
Id Refs Address    Size     Name
 1    3 0xc0100000 38c5f4   kernel
 2    1 0xc0d47000 3000     daemon_saver.ko  (screen saver)
 3    1 0xc0d4c000 12000    linux.ko

I also set LD_LIBRARY_PATH before I start Apache.
# setenv LD_LIBRARY_PATH 
/usr/local/lib:/usr/compat/linux/lib:/usr/local/linux-jdk1.3.1/jre/lib/i386:/usr/local/linux-jdk1.3.1/jre/lib/i386/hotspot:/usr/local/linux-jdk1.3.1/jre/lib/i386/native_threads

I run 'ld' .  Seems it finds most dynamic links.
# ld /usr/local/linux-jdk1.3.1/jre/lib/i386/libjava.so
/usr/libexec/elf/ld: warning: cannot find entry symbol _start; not setting start 
address


Thank you. 
slowpork at hotmail.com




Hi
Looks like the range of the <TR> block overlaps the range of the <TH> block
I usually generate all the TH stuff first ....
You can then generate the <TR> <TD> and data elements as needed after that
for each row

HTH

Jeff Lewis wrote:

> Using this function to dump a table, having a problem outputting the value
> below after the SELECT * FROM $ID.
>
> function dump($ID, $link) {
>                 echo "<font class=\"txt\">Dumped table <b>$ID</b></font><table
> border=\"1\"><tr>";
>                 $fields = mysql_list_fields("hyrum_nuke", $ID, $link);
>                 $columns = mysql_num_fields($fields);
>                         for ($i = 0; $i < $columns; $i++) {
>                           echo "\t<th>". mysql_field_name($fields, $i) . "</th>\n";
>                         }
>                 echo "</tr>";
>                 $query = mysql_query("SELECT * FROM $ID;");
>                 while ($line = mysql_fetch_array($query)) {
>                         while ($value = each($line)){
>                         $value = ereg_replace("<", "&lt;", $value);
>                         $value = ereg_replace(">", "&gt;", $value);
>                         echo "<td valign=\"top\"><pre>$value</pre></td>";
>                 }
>                 }
>                 echo "</table>";
>         }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Dell Coleman
PICO Technology Corp.






Hi dearest friend,
    can we update the same row immediately after selection.
 
please see the following code at line number 29 it is giving error.
 
code
------------------------------------
 
<?php
 

      // Connect to MySQL
 
     $connection = mysql_connect( 'localhost', 'balaji', 'pingpong' )
         or die ( 'Unable to connect to server.' );
 
     // Select database on MySQL server
 
     mysql_select_db( 'imac' )
         or die ( 'Unable to select database.' );
 
     // Formulate the query (inv_tag will come by post method
 
     $sql1 = "SELECT * FROM inventory WHERE inv_tag = '$inv_tag'";
 
     // Execute the query and put results in $result
 
     $result1 = mysql_query( $sql1 )
         or die ( 'Unable to select the data from inventory.' );
 

     if ( $result1 )
     {
 
        //change the status of the inventory item in inventory table
 
        $sql2="UPDATE inventory SET inv_status="assigned" where inv_tag='$inv_tag' ";  // This is line number 29.
 
        $result2 = mysql_query( $sql2 )
                       or die ( 'Unable to execute query for upadation of inventory table.' );
 
  $sql3 = "insert into status values('$inv_name','$inv_type','$inv_tag','$issued_to','$issued_by','$issue_date')";
 
     $result3 = mysql_query( $sql3 )
                       or die ( 'Unable to execute query for insertion in to status table.' );
 

  }
 
     else
     {
 
     // header( 'WWW-Authenticate: Basic realm="Private"' );
     // header( 'HTTP/1.0 401 Unauthorized' );
      echo '$inv_tag does not exist';
      exit;
 
   }
 

  ?>
 
please inform if any errors.
 
Thanks in advance.
 
Regards
-Balaji
The Information contained and transmitted by this E-MAIL is proprietary to 
Wipro Limited and is intended for  use only by the individual or entity to which 
it is addressed, and may contain information that is privileged, confidential or 
exempt from disclosure under applicable law. If this is a forwarded message, 
the content of this E-MAIL may not have been sent with the authority of the 
Company. If you are not the intended recipient, an agent of the intended 
recipient or a  person responsible for delivering the information to the named 
recipient,  you are notified that any use, distribution, transmission, printing, 
copying or dissemination of this information in any way or in any manner is 
strictly prohibited. If you have received this communication in error, please 
delete this mail & notify us immediately at [EMAIL PROTECTED] 





At 14:11 28/07/01 +0530, Balaji Ankem wrote:
>         $sql2="UPDATE inventory SET inv_status="assigned" where 
> inv_tag='$inv_tag' ";  // This is line number 29.

Try: inv_status='assigned' -- use single quotes, not double.

HTH,

Simon






Line 29:

        $sql2="UPDATE inventory SET inv_status="assigned" where inv_tag='$inv_tag' ";

will give a php error - it should read either

        $sql2="UPDATE inventory SET inv_status='assigned' where inv_tag='$inv_tag' ";

or

        $sql2="UPDATE inventory SET inv_status=\"assigned\" where inv_tag='$inv_tag' ";

to be syntactically correct in php.


Balaji Ankem schrieb am Samstag, 28. Juli 2001, 10:41:21:

> Hi dearest friend,
>     can we update the same row immediately after selection.

> please see the following code at line number 29 it is giving error.

> code
> ------------------------------------

> <?php


>       // Connect to MySQL

>      $connection = mysql_connect( 'localhost', 'balaji', 'pingpong' )
>          or die ( 'Unable to connect to server.' );

>      // Select database on MySQL server

>      mysql_select_db( 'imac' )
>          or die ( 'Unable to select database.' );

>      // Formulate the query (inv_tag will come by post method

>      $sql1 = "SELECT * FROM inventory WHERE inv_tag = '$inv_tag'";

>      // Execute the query and put results in $result

>      $result1 = mysql_query( $sql1 )
>          or die ( 'Unable to select the data from inventory.' );


>      if ( $result1 )
>      {

>         //change the status of the inventory item in inventory table

>         $sql2="UPDATE inventory SET inv_status="assigned" where inv_tag='$inv_tag' 
>";  // This is line number 29.

>         $result2 = mysql_query( $sql2 )
>                        or die ( 'Unable to execute query for upadation of inventory 
>table.' );

>   $sql3 = "insert into status 
>values('$inv_name','$inv_type','$inv_tag','$issued_to','$issued_by','$issue_date')";

>      $result3 = mysql_query( $sql3 )
>                        or die ( 'Unable to execute query for insertion in to status 
>table.' );


>   }

>      else
>      {

>      // header( 'WWW-Authenticate: Basic realm="Private"' );
>      // header( 'HTTP/1.0 401 Unauthorized' );
>       echo '$inv_tag does not exist';
>       exit;

>    }


>   ?>


> please inform if any errors.

> Thanks in advance.

> Regards
> -Balaji


-- 
Herzlich
Werner Stuerenburg            

_________________________________________________
ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen
Tel 0(049) 5224-997 407 · Fax 0(049) 5224-997 409
http://pferdezeitung.de






Hi dearest friends,
 
        while insertion of an employee number and password i am inserting like
 
insert into employee values('$empid',PASSWORD('$passwd'));
 
how to decrypt it while comparision during login.
 
Thanks in advance
 
Regards
-Balaji
The Information contained and transmitted by this E-MAIL is proprietary to 
Wipro Limited and is intended for  use only by the individual or entity to which 
it is addressed, and may contain information that is privileged, confidential or 
exempt from disclosure under applicable law. If this is a forwarded message, 
the content of this E-MAIL may not have been sent with the authority of the 
Company. If you are not the intended recipient, an agent of the intended 
recipient or a  person responsible for delivering the information to the named 
recipient,  you are notified that any use, distribution, transmission, printing, 
copying or dissemination of this information in any way or in any manner is 
strictly prohibited. If you have received this communication in error, please 
delete this mail & notify us immediately at [EMAIL PROTECTED] 





Hi Everyone,

I can use cookies with PHP but I can't make the cookie last forever.
I can set the cookie to expire for upto 1 hour.
This is the code :
setcookie("bookmarks","cookievalue",time()+3600);
That would make the cookie expire after an hour.

How do I make the cookie not expire at all?
If I don't mention any expiration time, the cookie expires as soon
as quit the browser. Can I use date instead of time? If yes, then in
which format should I specify the date?

Thanks,
--
Joel Agnel
[EMAIL PROTECTED]





Reply via email to