|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Tue Jan 14 2003 - 07:36:55 CST
php-general Digest 14 Jan 2003 13:36:55 -0000 Issue 1822
Topics (messages 131498 through 131543):
Re: forms
131498 by: Rick Emery
131499 by: Cal Evans
131500 by: cj
131502 by: David Freeman
131505 by: Chris Shiflett
131507 by: cj
131509 by: Chris Shiflett
131510 by: Rick Emery
131518 by: cj
131520 by: Jason Wong
Re: pass by reference
131501 by: Tom Rogers
cprelogin cookie data
131503 by: Robert Samuel White
Getting info with WHILE
131504 by: Ezequiel Sapoznik
131508 by: Tom Rogers
quota class?
131506 by: UberGoober
increment numbers...
131511 by: Senani
131512 by: Sean Malloy
131513 by: Senani
131514 by: Rick Emery
131516 by: Senani
Re: occasional mcrypt problems
131515 by: Steve Yates
131517 by: Steve Yates
imap quota
131519 by: Roger Thomas
Re: Error in variable when looping
131521 by: menezesd
131523 by: Tim Ward
131536 by: menezesd
131538 by: Tim Ward
restore_error_handler() to default error handler
131522 by: Brian T. Allen
131541 by: Michael Sims
Re: Weird Errors
131524 by: Tim Ward
Re: permission denied
131525 by: Lars Olsson
Re: problems to get image informations form local harddrive using "getimagesize"
131526 by: Lars Olsson
Re: imap_open failure
131527 by: Lars Olsson
regular expression
131528 by: Corin Langosch
131532 by: Chris Hayes
HTTP_ACCEPT - Reliabilty?
131529 by: SED
131530 by: Danny Shepherd
upgrading from 4.0.6 to 4.3.0
131531 by: gamin
131533 by: Jean-Christian Imbeault
Serial device /dev/ttyS0
131534 by: Scott Houseman
globals off in function
131535 by: Michael Bevz
131537 by: Jason Wong
131539 by: Chris Hayes
Cookie, header, output problems
131540 by: J. Alden Gillespy
Persistent global data ?
131542 by: Mathias Rockel
Re: Amount of data in the database
131543 by: Lars Olsson
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Do you mean like two SUBMIT buttons? Yes.
----- Original Message -----
From: "cj" <cj
itonsite.com.au>
To: <php-general
lists.php.net>
Sent: Monday, January 13, 2003 7:32 PM
Subject: [PHP] forms
G'day All
Just a quick question
This is really a html more than a php question.
Is it possible to have two buttons and have different actions for each
button in the same form?
Thanks
CJ
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
yes but it's more of an HTML/JavaScript thing.
use INPUT Type='BUTTON' to put a second button on your form. Then use the onClick method to assign an action to it. If you want it to submit your form then call document.formName.submit();
=C=
* * Cal Evans * The Virtual CIO * http://www.calevans.com *
-----Original Message-----
From: cj [mailto:cj
itonsite.com.au]
Sent: Monday, January 13, 2003 7:32 PM
To: php-general
lists.php.net
Subject: [PHP] forms
G'day All Just a quick question This is really a html more than a php question.
Is it possible to have two buttons and have different actions for each button in the same form?
Thanks CJ
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Would you know of any tutorial web sites which would explain how to do this? As I have not done any java programing before.
-----Original Message-----
From: Cal Evans [mailto:cal
calevans.com]
Sent: Tuesday, 14 January 2003 12:43 PM
To: cj
itonsite.com.au; php-general
lists.php.net
Subject: RE: [PHP] forms
yes but it's more of an HTML/JavaScript thing.
use INPUT Type='BUTTON' to put a second button on your form. Then use the onClick method to assign an action to it. If you want it to submit your form then call document.formName.submit();
=C=
* * Cal Evans * The Virtual CIO * http://www.calevans.com *
-----Original Message-----
From: cj [mailto:cj
itonsite.com.au]
Sent: Monday, January 13, 2003 7:32 PM
To: php-general
lists.php.net
Subject: [PHP] forms
G'day All Just a quick question This is really a html more than a php question.
Is it possible to have two buttons and have different actions for each button in the same form?
Thanks CJ
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
G'day CJ
> This is really a html more than a php question.
Yep, it probably is...
> Is it possible to have two buttons and have different > actions for each button in the same form?
Yep, you can.
<form etc> <input type="submit" name="first_submit_action" value="do this"> <input type="submit" name="2nd_submit_action" value="do that"> </form>
When you process your form in php you'll find that you have either $first_submit_action or $2nd_submit_action set to a value (well, if you have register global on anyway).
So, you look for which one is set and act accordingly.
Works for me...
CYA, Dave
attached mail follows:
--- cj <cj
itonsite.com.au> wrote:
> Is it possible to have two buttons and have different
> actions for each button in the same form?
No, because the action belongs to the form, not the submit buttons (which is why action is an attribute of form).
However, you can use different names and values for the submit buttons, so that you can tell which was pressed on your receiving page. This way you can act accordingly, which is probably what you wanted to know.
Hope that helps.
Chris
attached mail follows:
So, if I am understanding correctly The page that processes the form will have to work out which button got pressed?
That should be easy enough to work out, I hope :-)
-----Original Message-----
From: Chris Shiflett [mailto:shiflett
php.net]
Sent: Tuesday, 14 January 2003 2:21 PM
To: cj
itonsite.com.au; php-general
lists.php.net
Subject: Re: [PHP] forms
--- cj <cj
itonsite.com.au> wrote:
> Is it possible to have two buttons and have different
> actions for each button in the same form?
No, because the action belongs to the form, not the submit buttons (which is why action is an attribute of form).
However, you can use different names and values for the submit buttons, so that you can tell which was pressed on your receiving page. This way you can act accordingly, which is probably what you wanted to know.
Hope that helps.
Chris
attached mail follows:
--- cj <cj
itonsite.com.au> wrote:
> The page that processes the form will have to work out
> which button got pressed?
Exactly.
For starters, use this bit of HTML/PHP code to help you see what the browser sends you when the form is submitted (add this to the receiving page):
<pre> <? print_r($_REQUEST); ?> </pre>
Alternatively, you can choose to output $_GET or $_POST (instead of $_REQUEST) depending on which method you choose for your form. This will show you how to identify which button was pressed.
Good luck.
Chris
attached mail follows:
in HTML form:
<FORM method=post action="myscript.php"> . . . <INPUT type=submit name=submita value="Do This"> <INPUT type=submit name=submitb value="Do That"> </FORM>
in myscript.php:
if(ISSET($HTTP_POST_VARS['submita'])) { } if ISSET(($HTTP_POST_VARS['submitb'])) { }
----- Original Message -----
From: "cj" <cj
itonsite.com.au>
To: <shiflett
php.net>; "Php-List (E-mail)" <php-general
lists.php.net>
Sent: Monday, January 13, 2003 9:30 PM
Subject: RE: [PHP] forms
So, if I am understanding correctly The page that processes the form will have to work out which button got pressed?
That should be easy enough to work out, I hope :-)
-----Original Message-----
From: Chris Shiflett [mailto:shiflett
php.net]
Sent: Tuesday, 14 January 2003 2:21 PM
To: cj
itonsite.com.au; php-general
lists.php.net
Subject: Re: [PHP] forms
--- cj <cj
itonsite.com.au> wrote:
> Is it possible to have two buttons and have different
> actions for each button in the same form?
No, because the action belongs to the form, not the submit buttons (which is why action is an attribute of form).
However, you can use different names and values for the submit buttons, so that you can tell which was pressed on your receiving page. This way you can act accordingly, which is probably what you wanted to know.
Hope that helps.
Chris
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thanks everyone for your help. I got it to work yay!!!!
attached mail follows:
On Tuesday 14 January 2003 09:53, cj wrote: > Would you know of any tutorial web sites which would explain how to do > this?
google knows.
>As I have not done any java programing before.
javascript != java
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Q: What's the difference between a duck and an elephant? A: You can't get down off an elephant. */
attached mail follows:
Hi,
Tuesday, January 14, 2003, 11:01:33 AM, you wrote: P> -----BEGIN PGP SIGNED MESSAGE----- P> Hash: SHA1
P> On Monday 13 January 2003 20:01, Tom Rogers wrote:
>> Hi,
>>
>> Tuesday, January 14, 2003, 9:36:57 AM, you wrote:
>> P> -----BEGIN PGP SIGNED MESSAGE-----
>> P> Hash: SHA1
>>
>> P> I did a complex class that works with XML parsing and complex structured
>> where P> I used references extensivly and now I'm surprised with:
>>
>> P> Warning: Call-time pass-by-reference has been deprecated - argument
>> passed by P> value; If you would like to pass it by reference, modify the
>> declaration of P> array_push(). If you would like to enable call-time
>> pass-by-reference, you P> can set allow_call_time_pass_reference to true in
>> your INI file. However, P> future versions may not support this any longer.
>>
>> P> I can't modify the php.ini since I'm in a shared but the problem is
>> deeper. P> Why was it deprecated ? what replaced it ? is there any work
>> arround ? P> My 200 lines of code without references could take much, much
>> longer and be P> much, much more messy.
>> P> Any ideas ?
>> P> Thanks.
>> P> - --
>> P> Pupeno: pupeno
pupeno.com
>> P> http://www.pupeno.com
>> P> - ---
>> P> Help the hungry children of Argentina,
>> P> please go to (and make it your homepage):
>> P> http://www.porloschicos.com/servlet/PorLosChicos?comando=donar
>> P> -----BEGIN PGP SIGNATURE-----
>> P> Version: GnuPG v1.0.7 (GNU/Linux)
>>
>> P> iD8DBQE+I02cLr8z5XzmSDQRAs/0AKCyf+UG0uZdbwG30WFU0UUNVWO7BwCgnCn5
>> P> 2LmOOJi8uX+1dOqUfCTatSE=
>> P> =5obN
>> P> -----END PGP SIGNATURE-----
>>
>> I am sure array_push accepts the array as a reference so there is no need
>> to use the & operator in the call. At least thats how it works in a simple
>> class.....
P> No, I mean, what you're pushing inside the array is a reference:
P> array_push($anArrayOfReferences, &$thisIsAVariable);
P> that doesn't work, but I replaced by
P> $anArrayOfReferences[count($anArrayOfReferences)] = &$thisIsAVariable;
P> Thanks :)
Ok :) These 2 functions will do what you want I think...
function array_ref_push(&$array,&$ref){ $array[] =& $ref; } function &array_ref_pop(&$array){ $r =& $array[count($array)-1]; array_pop($array); //throw away a real pop return $r; }
//Testing $stack = array(); $var = 1; array_ref_push($stack,$var); echo '<pre>'; print_r($stack); echo '</pre>'; $var = 2; echo '<pre>'; print_r($stack); echo '</pre>'; $var2 =& array_ref_pop($stack); echo 'var2 = '.$var2.'<br>'; $var = 3; echo 'var2 = '.$var2.'<br>'; echo '<pre>'; print_r($stack); echo '</pre>';
-- regards, Tom
attached mail follows:
Hello. I have set up my website to log all cookie data that it encounters. I have session management support built in without using cookies. And my website does not use any cookies independently whatsoever. For some reason, it logs a cookie with the following data:
cprelogin = no
I searched the entire php website and mailing list with the search term "cprelogin" without any results. Does someone know why PHP would return this data as part of the $_COOKIE array?
-Samuel
attached mail follows:
I have the following problem:
I have a DB named 'fotografias' with the following information:
ind indice_bio url 1 2 ../images/agosti.jpg 2 2 ../images/militar.jpg 3 2 hgfhgfh 4 2 eze 5 5 ezequi
ind, indice_bio and url are fields names.
I wrote the following code:
<?php
$dbase = mysql_connect("localhost", user , password); mysql_select_db(historia,$dbase);
$respuesta = mysql_query("SELECT * FROM fotografias where indice_bio=$id", $dbase); $row1 = mysql_fetch_array($respuesta);
echo("<center>");
echo('<img border="0" src="../images/foto.wmf" width="62" height="66">'); echo('<b>Hagá Click para ver las fotografías disponibles</b>'); echo("<br>"); echo("<br>");
while($row1 = mysql_fetch_array($respuesta))
printf("<tr><td> %s </td></tr>", $row1["url"]); echo("<br>"); } mysql_free_result($respuesta); mysql_close($dbase); ?>
The problem is that when I retrieve the info, for example with id=2, I only get
../images/militar.jpg hgfhgfh eze
I do not get
../images/agosti.jpg
Any idea?
Thanks
Ezequiel
Ps. The page is located at http://www.historiadelpais.com.ar/bio.php?id=2
attached mail follows:
Hi,
Tuesday, January 14, 2003, 1:09:10 PM, you wrote: ES> I have the following problem:
ES> I have a DB named 'fotografias' with the following information:
ES> ind indice_bio url ES> 1 2 ../images/agosti.jpg ES> 2 2 ../images/militar.jpg ES> 3 2 hgfhgfh ES> 4 2 eze ES> 5 5 ezequi
ES> ind, indice_bio and url are fields names.
ES> I wrote the following code:
ES> <?php
ES> $dbase = mysql_connect("localhost", user , password); ES> mysql_select_db(historia,$dbase);
ES> $respuesta = mysql_query("SELECT * FROM fotografias where indice_bio=$id", ES> $dbase); ES> $row1 = mysql_fetch_array($respuesta);
ES> echo("<center>");
ES> echo('<img border="0" src="../images/foto.wmf" width="62" height="66">'); ES> echo('<b>Hagá Click para ver las fotografías disponibles</b>'); ES> echo("<br>"); ES> echo("<br>");
ES> while($row1 = mysql_fetch_array($respuesta))
ES> printf("<tr><td> %s </td></tr>", $row1["url"]); ES> echo("<br>"); ES> } ES> mysql_free_result($respuesta); ES> mysql_close($dbase); ?>>
ES> The problem is that when I retrieve the info, for example with id=2, I only ES> get
ES> ../images/militar.jpg ES> hgfhgfh ES> eze
ES> I do not get
ES> ../images/agosti.jpg
ES> Any idea?
ES> Thanks
ES> Ezequiel
ES> Ps. The page is located at http://www.historiadelpais.com.ar/bio.php?id=2
$respuesta = mysql_query("SELECT * FROM fotografias where indice_bio=$id",$dbase);
$row1 = mysql_fetch_array($respuesta); <<<<<<<< get rid of this line, you don't need it.
echo("<center>");
-- regards, Tom
attached mail follows:
Has anyone run across a php class for handling filesystem quotas? (Reporting)
attached mail follows:
HI all, I need help on incrementing numbers starting with a 0 or more on php-4.2.3.
When I increment a number like 00002 (00002++). Its out put is 3 ( not 00003). But Its output had leading 0s on php-4.0.2. Does anybody know any function or any other simple way to do this.
Rgds JanakaA
attached mail follows:
for ($i = 1; $i <= 100; $i++) { echo str_pad($i, 6, '0', STR_PAD_LEFT) . '<br />'; }
is that the sort of effect you want?
-----Original Message-----
From: Senani [mailto:senani
sri.lanka.net]
Sent: Tuesday, 14 January 2003 3:22 PM
To: php-general
lists.php.net
Subject: [PHP] increment numbers...
HI all, I need help on incrementing numbers starting with a 0 or more on php-4.2.3.
When I increment a number like 00002 (00002++). Its out put is 3 ( not 00003). But Its output had leading 0s on php-4.0.2. Does anybody know any function or any other simple way to do this.
Rgds JanakaA
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi, Great! I was searching for this days in PHP DOCS. I can proceed now. Thanks Again folk. JanakAA
At 03:30 PM 1/14/2003 +1100, you wrote:
>for ($i = 1; $i <= 100; $i++)
>{
> echo str_pad($i, 6, '0', STR_PAD_LEFT) . '<br />';
>}
>
>is that the sort of effect you want?
>
>-----Original Message-----
>From: Senani [mailto:senani
sri.lanka.net]
>Sent: Tuesday, 14 January 2003 3:22 PM
>To: php-general
lists.php.net
>Subject: [PHP] increment numbers...
>
>
>HI all,
> I need help on incrementing numbers starting with a 0 or
>more on php-4.2.3.
>
> When I increment a number like 00002 (00002++). Its out put is 3
>( not 00003).
>But Its output had leading 0s on php-4.0.2.
>Does anybody know any function or any other simple way to do this.
>
>Rgds
>JanakaA
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
$num = sprintf("%05d",$num);
----- Original Message -----
From: "Senani" <senani
sri.lanka.net>
To: <php-general
lists.php.net>
Sent: Monday, January 13, 2003 10:21 PM
Subject: [PHP] increment numbers...
HI all, I need help on incrementing numbers starting with a 0 or more on php-4.2.3.
When I increment a number like 00002 (00002++). Its out put is 3 ( not 00003). But Its output had leading 0s on php-4.0.2. Does anybody know any function or any other simple way to do this.
Rgds JanakaA
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
That also worked .. !! I tried this function .But used wrong arguments. Thanks a lot for the help.
Rgds
JanakaA
At 11:25 PM 1/13/2003 -0600, you wrote:
>$num = sprintf("%05d",$num);
>----- Original Message -----
>From: "Senani" <senani
sri.lanka.net>
>To: <php-general
lists.php.net>
>Sent: Monday, January 13, 2003 10:21 PM
>Subject: [PHP] increment numbers...
>
>
>HI all,
> I need help on incrementing numbers starting with a 0 or
>more on php-4.2.3.
>
> When I increment a number like 00002 (00002++). Its out put is 3
>( not 00003).
>But Its output had leading 0s on php-4.0.2.
>Does anybody know any function or any other simple way to do this.
>
>Rgds
>JanakaA
>
>
>--
>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
attached mail follows:
"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
news:3E228BE9.9080203
webglobe.sk...
> As you have magic_quotes on, automatically happens *addslashes*, now you
> need to reverse the proces
I think I see where you're going, but I'm not sure that's the correct avenue here. If slashes from magic_quotes were in the string before encryption, wouldn't they be in the string after decryption? Why would that result in data corruption?
> >"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
> >news:3E1F4816.8050509
webglobe.sk...
> >>$_POST['Credit_Card_Number']=stripslashes($_POST['Credit_Card_Number']);
- Steve Yates - WORK HARDER!... Millions on welfare depend on YOU!!!
~ Taglines by Taglinator - www.srtware.com ~
attached mail follows:
"J Smith" <dark_panda
hushmail.com> wrote in message
news:20030113175038.42790.qmail
pb1.pair.com...
> Try using a different block cipher mode. When encrypting with ECB, as you
> said, your plaintext must have a length that is a multiple of the
blocksize
Are you sure? I read the manual the other way...that the *result* is a multiple of blocksize:
"This function encrypts data. The data is padded with "\0" to make sure the length of the data is n * blocksize. This function returns the encrypted data. Note that the length of the returned string can in fact be longer then the input, due to the padding of the data."
I am storing the encrypted, padded string.
> If it's anything less, you're going to get some garbage at > the end of the decrypted ciphertext.
This would imply that any non-blocksize-length strings would be corrupted which is not the case. 99% are fine.
> require that you store the IV for each encryption along with the > ciphertext, but that's fine, as storing the IV along with the ciphertext is > not a security problem.
However changing now will mean handling some historical data differently somehow. :( And storing an IV for each record would of course increase the data size.
- Steve Yates - #include <mandatory_cute_tagline>
~ Taglines by Taglinator - www.srtware.com ~
attached mail follows:
i am referring to imap_get_quota manpages at http://www.php.net/manual/en/function.imap-get-quota.php
it gave a short script (see bottom). question: in a qmail-ldap/courier-imap environment, who is that mailadmin ?
-- script start -- $mbox = imap_open("{your.imap.host}","mailadmin","password",OP_HALFOPEN) or die("can't connect: ".imap_last_error()); $quota_values = imap_get_quota($mbox, "user.kalowsky"); if(is_array($quota_values)) { $storage = $quota_values['STORAGE']; print "STORAGE usage level is: " . $storage['usage']; print "STORAGE limit level is: " . $storage['limit'];
$message = $quota_values['MESSAGE']; print "MESSAGE usage level is: " . $message['usage']; print "MESSAGE usage level is: " . $message['limit'];
/* ... */ }
imap_close($mbox);
-- script endz --
-- roger__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
attached mail follows:
Sorry Rick. Thanks.
I could not understand your question. Are you asking for more of the code? I did not include that as I thought it would be too long in the mail.
Thanks Denis
--- Rick Emery <remery
emeryloftus.com> wrote:
> so where is $rowe set?
>
> Show us code that calls this page
> ----- Original Message -----
> From: "menezesd" <menezesd
singnet.com.sg>
> To: <php-general
lists.php.net>
> Sent: Monday, January 13, 2003 6:21 PM
> Subject: [PHP] Error in variable when looping
>
>
> Hello friends,
>
> I have made the following table of data and a button on every row to
> view the details. The code is
> working fine and the table is displayed with the buttons.
>
> The problem I have is that the $SelectedItemNumber posted to the
> next page remains the same number
> no matter which row button I click. I have my relevant code below.
> Please help me. I know I am
> making a mistake somewhere but I cannot figure out where.
>
> Quote :
>
>
> while($row=mysql_fetch_array($result)){
>
> Print " <tr> ";
> Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font face=\"Tahoma\"
> color=\"#000000\">" ;
> Print "<b> <font size=\"2\" color=\"ff0000\"> $row[OrgName]
> </b></font>";
> print "</font> </td>";
> Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font size=\"2\"
> face=\"Tahoma\" color=\"#000000\">" ;
> Print $row[OrgCountry];
> print "</font> </td>";
> Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font size=\"2\"
> face=\"Tahoma\" color=\"#000000\">" ;
> Print $row[OrgNumber];
> print "</font> </td>";
> Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font size=\"2\"
> face=\"Tahoma\" color=\"#000000\">" ;
> Print $row[Orgaddress];
> print "</font> </td>";
> Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font size=\"2\"
> face=\"Tahoma\" color=\"#000000\">" ;
> Print $row[OrgChief];
> print "</font> </td>";
> Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#b7b700\"><font size=\"2\"
> face=\"Tahoma\" color=\"#000000\">" ;
> Print"<INPUT TYPE=\"submit\" value=\"View details\"
> Name=\"Details\">";
> print "</td>";
> Print"<input type=\"hidden\" name=\"SelectedItemNumber\" value=
> $row[Id]";
> Print "</tr>";}
> }
> ?>
>
>
>
> Unquote
>
> Thanks
> Denis
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
you're not differentiating between form elements on different rows. all the hidden elements have the same name and are in the same form so only the last one will be available as all the submit buttons are in the same form.
you need to put <form ...>...</form> tags around each submit/hidden pair.
Tim Ward
http://www.chessish.com
mailto:timward
chessish.com
----- Original Message -----
From: menezesd <menezesd
singnet.com.sg>
To: <php-general
lists.php.net>
Sent: Tuesday, January 14, 2003 12:21 AM
Subject: [PHP] Error in variable when looping
> Hello friends, > > I have made the following table of data and a button on every row to view the details. The code is working fine and the table is displayed with the buttons. > > The problem I have is that the $SelectedItemNumber posted to the next page remains the same number no matter which row button I click. I have my relevant code below. Please help me. I know I am making a mistake somewhere but I cannot figure out where. > > Quote : > > > le($row=mysql_fetch_array($result)){ > > Print " <tr> "; > Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font face=\"Tahoma\" color=\"#000000\">" ; > Print "<b> <font size=\"2\" color=\"ff0000\"> $row[OrgName] </b></font>"; > print "</font> </td>"; > Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; > Print $row[OrgCountry]; > print "</font> </td>"; > Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; > Print $row[OrgNumber]; > print "</font> </td>"; > Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; > Print $row[Orgaddress]; > print "</font> </td>"; > Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#0000 00\">" ; > Print $row[OrgChief]; > print "</font> </td>"; > Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#b7b700\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; > Print"<INPUT TYPE=\"submit\" value=\"View details\" Name=\"Details\">"; > print "</td>"; > Print"<input type=\"hidden\" name=\"SelectedItemNumber\" value= $row[Id]"; > Print "</tr>";} > } > ?> > > > > Unquote > > Thanks > Denis > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Hello Tim.
Could you help me a little further and tell me exactly where to put this?
Thanks
Denis
----- Original Message -----
From: "Tim Ward" <timward
chessish.com>
To: <menezesd
singnet.com.sg>; <php-general
lists.php.net>
Sent: Tuesday, January 14, 2003 5:16 PM
Subject: Re: [PHP] Error in variable when looping
> you're not differentiating between form elements on different rows.
> all the hidden elements have the same name and are in the same
> form so only the last one will be available as all the submit buttons
> are in the same form.
>
> you need to put <form ...>...</form> tags around each submit/hidden
> pair.
>
> Tim Ward
> http://www.chessish.com
> mailto:timward
chessish.com
> ----- Original Message -----
> From: menezesd <menezesd
singnet.com.sg>
> To: <php-general
lists.php.net>
> Sent: Tuesday, January 14, 2003 12:21 AM
> Subject: [PHP] Error in variable when looping
>
>
> > Hello friends,
> >
> > I have made the following table of data and a button on every row to
view
> the details. The code is working fine and the table is displayed with the
> buttons.
> >
> > The problem I have is that the $SelectedItemNumber posted to the next
page
> remains the same number no matter which row button I click. I have my
> relevant code below. Please help me. I know I am making a mistake
somewhere
> but I cannot figure out where.
> >
> > Quote :
> >
> >
> >
> le($row=mysql_fetch_array($result)){
> >
> > Print " <tr> ";
> > Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font face=\"Tahoma\" color=\"#000000\">" ;
> > Print "<b> <font size=\"2\" color=\"ff0000\"> $row[OrgName]
</b></font>";
> > print "</font> </td>";
> > Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
> > Print $row[OrgCountry];
> > print "</font> </td>";
> > Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
> > Print $row[OrgNumber];
> > print "</font> </td>";
> > Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
> > Print $row[Orgaddress];
> > print "</font> </td>";
> > Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#0000
> 00\">" ;
> > Print $row[OrgChief];
> > print "</font> </td>";
> > Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#b7b700\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
> > Print"<INPUT TYPE=\"submit\" value=\"View details\" Name=\"Details\">";
> > print "</td>";
> > Print"<input type=\"hidden\" name=\"SelectedItemNumber\" value=
$row[Id]";
> > Print "</tr>";}
> > }
> > ?>
> >
> >
> >
> > Unquote
> >
> > Thanks
> > Denis
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
attached mail follows:
print "<form ...>"; print"<INPUT TYPE='submit' value='View details' Name='Details'>"; print"<input type='hidden' name='SelectedItemNumber' value='{$row[Id]}'"; print "</form>";
you'll then have as many forms as you have rows and which one is submitted will depend on which button is pressed.
Tim Ward
http://www.chessish.com
mailto:timward
chessish.com
----- Original Message -----
From: Denis L. Menezes <menezesd
singnet.com.sg>
To: Tim Ward <timward
chessish.com>; <php-general
lists.php.net>
Sent: Tuesday, January 14, 2003 11:50 AM
Subject: Re: [PHP] Error in variable when looping
> Hello Tim.
>
> Could you help me a little further and tell me exactly where to put this?
>
> Thanks
> Denis
> ----- Original Message -----
> From: "Tim Ward" <timward
chessish.com>
> To: <menezesd
singnet.com.sg>; <php-general
lists.php.net>
> Sent: Tuesday, January 14, 2003 5:16 PM
> Subject: Re: [PHP] Error in variable when looping
>
>
> > you're not differentiating between form elements on different rows.
> > all the hidden elements have the same name and are in the same
> > form so only the last one will be available as all the submit buttons
> > are in the same form.
> >
> > you need to put <form ...>...</form> tags around each submit/hidden
> > pair.
> >
> > Tim Ward
> > http://www.chessish.com
> > mailto:timward
chessish.com
> > ----- Original Message -----
> > From: menezesd <menezesd
singnet.com.sg>
> > To: <php-general
lists.php.net>
> > Sent: Tuesday, January 14, 2003 12:21 AM
> > Subject: [PHP] Error in variable when looping
> >
> >
> > > Hello friends,
> > >
> > > I have made the following table of data and a button on every row to
> view
> > the details. The code is working fine and the table is displayed with
the
> > buttons.
> > >
> > > The problem I have is that the $SelectedItemNumber posted to the next
> page
> > remains the same number no matter which row button I click. I have my
> > relevant code below. Please help me. I know I am making a mistake
> somewhere
> > but I cannot figure out where.
> > >
> > > Quote :
> > >
> > >
> > >
> > le($row=mysql_fetch_array($result)){
> > >
> > > Print " <tr> ";
> > > Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font face=\"Tahoma\" color=\"#000000\">" ;
> > > Print "<b> <font size=\"2\" color=\"ff0000\"> $row[OrgName]
> </b></font>";
> > > print "</font> </td>";
> > > Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
> > > Print $row[OrgCountry];
> > > print "</font> </td>";
> > > Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
> > > Print $row[OrgNumber];
> > > print "</font> </td>";
> > > Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
> > > Print $row[Orgaddress];
> > > print "</font> </td>";
> > > Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#0000
> > 00\">" ;
> > > Print $row[OrgChief];
> > > print "</font> </td>";
> > > Print "<td width=\"12%\" align=\"center\" height=\"6\"
> > bgcolor=\"#b7b700\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">"
;
> > > Print"<INPUT TYPE=\"submit\" value=\"View details\"
Name=\"Details\">";
> > > print "</td>";
> > > Print"<input type=\"hidden\" name=\"SelectedItemNumber\" value=
> $row[Id]";
> > > Print "</tr>";}
> > > }
> > > ?>
> > >
> > >
> > >
> > > Unquote
> > >
> > > Thanks
> > > Denis
> > >
> > > --
> > > 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
>
>
attached mail follows:
Hi,
I was playing around with error handlers, and tried this:
<?php
error_reporting(E_ALL ^ E_NOTICE);
function ErrorHandler($_ErrorNumber_, $_ErrorString_, $_ErrorFile_,
$_ErrorLine_, $_ErrorContext_)
{
mail("brian
gzmarketing.com", "Error", "Blah blah blah");
}
set_error_handler("ErrorHandler");
...
?>
Which worked just fine. A little too good, in fact.
I got over 1,200 emails in a matter of minutes (high traffic site).
I was finally able to get it to stop by re-declaring the function without the mail() call, but how do I restore PHP's default error handler?
I haven't had any success with restore_error_handler();
Thanks, Brian
attached mail follows:
On Tue, 14 Jan 2003 01:20:54 -0700, you wrote:
>Hi, > >I was playing around with error handlers, and tried this: [...] >Which worked just fine. A little too good, in fact. > >I got over 1,200 emails in a matter of minutes (high traffic site).
I'm not sure whey restore_error_handler() isn't working, but I have something else which may help you. When you use a custom error handler your function will handle ALL errors, regardless of your current error_reporting level. To make your function honor the current error_reporting level, put this line at the top of your function:
if (!($_ErrorNumber_ & error_reporting())) return;
This will also allow your function to ignore errors on function calls
that you have prefixed with an '
', since the '
' temporarily sets the
error_reporting level to 0.
attached mail follows:
surely you can post the part of the code that checks the e-mail is blank or not?
Tim Ward
http://www.chessish.com
mailto:timward
chessish.com
----- Original Message -----
From: Mike Bowers <raptr24
att.net>
To: <php-general
lists.php.net>
Sent: Tuesday, January 14, 2003 12:04 AM
Subject: [PHP] Weird Errors
> The errors aren't actually generadted inside the PHP but the problem im
> having makes no sense to me.
> The pages validate.php feed out:
> Please veify below that all your details are correct. If there are any
> errors, they will be lsited first.
> Error 1: Primary e-mail address was left blank.
> Error 2: Please specify whether or not your license has ever been
> revoked.
> Fatal Error: You did not agree to the terms listed.
> Errors were found in your submission. Please use your bowsers back
> button to go back and fix them.
> There were 4 errors found.
>
> The problem lies within the fact that these errors are not actually
> being triggered. The errors are told to trigger if the field is left
> blank. The problem is are the field are not left blank. The form that
> feeds to the file is at http://www.skyfor.planetmodz.com/shsapp.html and
> the PHP script is http://www.skyfor.planetmodz.com/validate.php .. The
> text of both are too long to post in here. I checked myself to make sure
> the form fields line up. Could someone please try to see if they can
> figure out my error?
>
> Thanks in advace,
>
> Mike Bowers
> PlanetModz Gaming Network Webmaster
> webmaster
planetmodz.com
> ViperWeb Hosting Server Manager
> mbowers
viperwebconsulting.com
> raptr24
att.net
> All outgoing messages scanned for viruses
> using Norton AV 2002
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi Anthony!
Have you tried giving the full path of 'data.txt' to fopen? Like this:
$file = fopen("d:\\inetpub\\www.blahblah.org\\formtest.php", "a+");
Is it you or your ISP that uses win98?
Kindly
/Lars Olsson (lasso
lassoweb.nu)
Anthony Ritter wrote: > Using MS Win98 / php 4: > > Any ideas on how I can change my permssion settings on a file called > data.txt so it can be read to and written to or do I have to take that up > with my ISP. > > I get the following after I submit a form: > .................... > Warning: fopen("data.txt", "a+") - Permission denied in > d:\inetpub\www.blahblah.org\formtest.php on line 80 > Your submission was not processed. > ........................ > Thank you for your time and help. > TR > > > > > >
attached mail follows:
Hi!
It could be a permission problem. What OS are you using? Win98? Win2000? WinXP?
Kindly
/Lars Olsson (lasso
lassoweb.nu)
Harald Mohring wrote: > isn't it possible to get image informations from the local harddrive? > > $fotoinfo=getimagesize("C:\\Files\\Temp\\Image.jpg"); > > if i use that code, the errormessage is always > Unable to access c:\Files\Temp\Image.jpg > getimagesize: unable to open file for reading > > got anybody a solution? > >
attached mail follows:
Hi!
Shouldn't it be:
$pop_inbox = imap_open("{$mailserver:110/pop3}INBOX", $login, $password);
(as on http://www.php.net/manual/en/function.imap-open.php)
Kindly
/Lars Olsson (lasso
lassoweb.nu)
Jeff Schwartz wrote: > I'm using imap_open in PHP 4.3.0 to successfully access every pop server I've tried - except 1: "mail.fea.net". I know the mail server, port, login, and password are correct because I can successfully log into the pop server with both telnet and Outlook. > > Here's the code: > > if ($pop_inbox = imap_open("{".$mailserver."/$mailbox_type:$port/notls}",$login,$password)): > > I've tried every variation of the code, such as using "notls" or not. In any event, I know the code works because I can log into every other pop server I've tried. > > imap_last_error() returns: Can not authenticate to POP3 server > > Has anyone else run into this? Is there a way to see more about the interaction between imap_open and the pop server? > > Jeff > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now
attached mail follows:
hi,
i wrote a regular expression to match email adresses:
$text = preg_replace("/([a-z0-9_]|\\-|\\.)+
([^[:space:]<>]*)([[:alnum:]-])/i", "<a href=\"mailto:\\1\">\\1</a>", $text);
unluckily also things like test.de">ftp://test
test.de were matched.
so i rewrote it to:
$text = preg_replace("/(?<!http:\/\/|ftp:\/\/)(([a-z0-9_]|\\-|\\.)+
([^[:space:]<>]*)([[:alnum:]-]))/i", "<a href=\"mailto:\\1\">\\1</a>", $text);
but this gives me:
test.aaa.a">http://gucki
test.aaa.a -> test.aaa.a">http://gucki
test.aaa.a
test.aaa.a">ftp://gucki
test.aaa.a -> test.aaa.a">ftp://gucki
test.aaa.a
gucki
test.aaa.a -> gucki
test.aaa.a
thanks for your help! :)
attached mail follows:
At 10:49 14-1-03, you wrote:
>hi,
>i wrote a regular expression to match email adresses:
>$text >preg_replace("/([a-z0-9_]|\\-|\\.)+
([^[:space:]<>]*)([[:alnum:]-])/i", "<a
>href=\"mailto:\\1\">\\1</a>", $text);
>
>unluckily also things like test.de">ftp://test
test.de were matched.
>so i rewrote it to:
>$text >preg_replace("/(?<!http:\/\/|ftp:\/\/)(([a-z0-9_]|\\-|\\.)+
([^[:space:]<>]*)([[:alnum:]-]))/i",
>
>"<a href=\"mailto:\\1\">\\1</a>", $text);
>
>but this gives me:
>test.aaa.a">http://gucki
test.aaa.a -> test.aaa.a">http://gucki
test.aaa.a
>test.aaa.a">ftp://gucki
test.aaa.a -> test.aaa.a">ftp://gucki
test.aaa.a
>gucki
test.aaa.a -> gucki
test.aaa.a
This seems to work:
$text preg_replace("/([^\/a-z0-9_])(([a-z0-9_]|\\-|\\.)+
([^[:space:]<>]*)([[:alnum:]-]))/i",
"\\1<a href=\"mailto:\\2\">\\2</a>", $text);
I did not check the entire regexp but it seems to do what you need. Um, the NOT thingy in a regexp is the ^ in stead of the !.
And my line will not tagify any email preceded by a forward slash.
Chris Hayes
attached mail follows:
I'm using Flash very often within websites. Like you know, sometimes the user doesn't have the Flash-plug-in so I was wandering if I could depend on this $_SERVER['HTTP_ACCEPT'] variable to look for "shockwave-flash". If found, the visitor has Flash-plugging, if not, he doesn't.
So my question really is, can I base my Flash-detection on this global variable or is too uncertain? (e.g. when the user is using Netscape, Opera etc., Linux, Mac etc.)
Regards, Sumarlidi E. Dadason
SED - Graphic Design
_________________________________
E-mail: sed
sed.is
website: www.sed.is
attached mail follows:
Hi,
No, I wouldn't rely on it at all, I couldn't find a browser that *does* have that mime-type in it's header! - Here's what IE6 sends :
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, */* Accept-Language: en-gb Accept-Encoding: gzip, deflate
Flash, along with a multitude of other plugins, is installed and working fine.
FWIW, Mozilla 1.3a sends:
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate,compress;q=0.9
Opera 7 sends:
Accept: text/html, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 Accept-Language: en Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
----- Original Message -----
From: "SED" <sed
sed.is>
To: <php-general
lists.php.net>
Sent: Tuesday, January 14, 2003 10:22 AM
Subject: [PHP] HTTP_ACCEPT - Reliabilty?
> I'm using Flash very often within websites. Like you know, sometimes the
> user doesn't have the Flash-plug-in so I was wandering if I could depend
> on this $_SERVER['HTTP_ACCEPT'] variable to look for "shockwave-flash".
> If found, the visitor has Flash-plugging, if not, he doesn't.
>
> So my question really is, can I base my Flash-detection on this global
> variable or is too uncertain? (e.g. when the user is using Netscape,
> Opera etc., Linux, Mac etc.)
>
> Regards,
> Sumarlidi E. Dadason
>
> SED - Graphic Design
> _________________________________
> E-mail: sed
sed.is
> website: www.sed.is
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hi,
I have currently working a Red Hat 7.2 system that installs PHP 4.0.6 from the CD and it works fine. I want to upgrade to ver 4.3.0 what would be the simplest way to do this without breaking any of the old modules etc. I wont mind making changes to my scripts in case of changes between versions.
Do i need to remove the old PHP installation before building the new one ?
Would using the configure command that shows in the <? phpinfo() ?> currently (with 4.0.6) work with the ver 4.3.0 ?
Thank you
gamin.
attached mail follows:
Gamin wrote: > > I have currently working a Red Hat 7.2 system that installs PHP 4.0.6 > from the CD and it works fine. I want to upgrade to ver 4.3.0 what would be > the simplest way to do this without breaking any of the old modules etc. I > wont mind making changes to my scripts in case of changes between versions.
If your old PHP was automatically installed by RH then just do an "rpm -e php" (maybe rpm-r php-4.0.6. To find out the write string to use to rpm -qa | grep php)
> Do i need to remove the old PHP installation before building the new one > ?
No, if you don't you need to take extra steps. And I can't see why you want to keep the old version around anyway.
> Would using the configure command that shows in the <? phpinfo() ?> > currently (with 4.0.6) work with the ver 4.3.0 ?
Most probably. SO I suggest downloading the 4.3.0 source files and doing a ./configure with the options you can from phpinfo() and then compiling :)
Jc
attached mail follows:
Hi.
Would it be possible to use PHP to communicate with a serail device e.g. a modem. I would like to send AT commands to a GSM modem & be able to read the resulting output.
I know PHP may not be ideal for this, but I think if it's possible, it would be the quickest way of knocking something together.
Thanks
Scott
-- Scott Houseman Senior Software Developer Junk Mail Publishing (Pty) Ltd T + 27 12 342 3840 ext 2806 F +27 12 342 3876 E scottjunkmail.co.za | www.junkmail.co.za A 1312 Pretorius Street, Hatfield, Pretoria P O Box 6574, Pretoria, 0001, South Africa +27 82 491 8021
attached mail follows:
Hi, all!!! I've such trouble: ( register_globals = off )
in function i call to $smarty variable " function showLoginForm(){
global $db, $smarty; // $smarty = new Smarty in main code
$smarty->assign("message", $message); // !!!! " and i receive this error message " Fatal error: Call to a member function on a non-object in /usr/home/elastic.org/work/svyatoshin/system/common_func.php on line 22 "
Imho, globals don't working with "globals off", nut i can't find this in manual.
Who can help me?
attached mail follows:
On Tuesday 14 January 2003 18:46, Michael Bevz wrote:
> I've such trouble: > ( register_globals = off )
The register_globals setting in php.ini has ...
> in function i call to $smarty variable > " > function showLoginForm(){ > > global $db, $smarty; // $smarty = new Smarty in main code
... nothing to do with the 'global' statement.
> $smarty->assign("message", $message); // !!!! > " > and i receive this error message > " > Fatal error: Call to a member function on a non-object in > /usr/home/elastic.org/work/svyatoshin/system/common_func.php on line 22 > "
> Who can help me?
Assuming line 22 is (it would help if you told us _which_ is line 22)
$smarty->assign("message", $message);
and assuming that you _really_ have defined $smarty in the main code then I cannot see what you're doing wrong.
Does $smarty->assign("message", $message work in the main loop (ie when not in a function)?
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* In Oz, never say "krizzle kroo" to a Woozy. */
attached mail follows:
>in function i call to $smarty variable >" >function showLoginForm(){ > > global $db, $smarty; // $smarty = new Smarty in main code >Fatal error: Call to a member function on a non-object in
Are you sure $smarty = new Smarty is in the main code? Can it be in another function?
Try setting global $smarty; just before you create $smarty.
Does that help?
>( register_globals = off ) >Imho, globals don't working with "globals off", nut i can't find this in >manual. no, register_globals is only about the automatical production of variables from FORM, GET and other data input. But i fully agree the name is confusing.
attached mail follows:
I'm creating an e-commerce website, and I just need clarification as to whether a MySQL query is considered as "browser output". I ask because I have the following code, but the cookie isn't being set:
if ($op == "login") { if (!isset($username) && !isset($userpass)) { } else { if ($username == "" || $userpass == "") { $errormsg = "Invalid username or password. Please try again."; } else { if (mysql_num_rows(mysql_query("select * from `$cart->user_table` where username=\"$username\" and userpass=\"$userpass\"", $cart->dblink)) == 1) { setcookie("jackloren_user", "$username:$userpass", time() + 2592000); // expires in 30 days header("Location: http://www.jackloren.com/"); // echo "test"; /* if ($rd != "") { redirectURL($rd,""); } else { redirectURL("",""); } */ } else { $errormsg = "Invalid username or password. Please try again."; } } } }
However, if I comment out the header and uncomment the echo statement, then the cookie is added, no problem. It seems as if the browser is freaking out when there isn't any output after a cookie is set and a header is sent.
I'm also having another similar problem with this function:
function auth($redirect_url) { global $HTTP_COOKIE_VARS; if (!isset($HTTP_COOKIE_VARS['jackloren_user'])) { header("Location: http://www.jackloren.com/login.php"); // echo "test"; } else { $userinfo = explode(":", $HTTP_COOKIE_VARS['jackloren_user']); $username = $userinfo[0]; $userpass = $userinfo[1]; echo "$username | $userpass<br>"; if (mysql_num_rows(mysql_query("select * from `$cart->user_table` where username=\"$username\" and userpass=\"$userpass\"", $cart->dblink)) != 1) { redirectURL("login.php", $redirect_url); } else { echo "success"; // nothing } } }
If I leave the script the way it is, the browser isn't redirected no matter what I put in the header() statement. However, if I uncomment the echo statement, giving the browser some output, then the redirect works fine.
Has anyone experienced this? And if so, how do I fix it? Thanks.
J. Alden Gillespy (aka Dogga) Microsoft Beta Tester: - Office 11 - Content Management Server (CMS) 2002 - Systems Management Server (SMS) 2003
attached mail follows:
Hi all !
I am currently writing some kind of Document/File-Library in a LAMP environment.
As the library should be able to handle various file types, and most file types have to be handled differently internally, I would like to use Objects/Classes to make the code for the Library iself independent from the stuff that is individual to the different file types.
Now I noticed early that when I use Objects in PHP and have to create many for them each time a script runs it slows the system down considerably. It seems you can now save objects in sessions which AFAIR was not possible last time I tried. But then I would have to read the whole file index (which is actually a tree) into a session variable for each user, and I don't know if thats a good idea performancewise. It would be a rather large multi-dimensional array.
So I would like to know if there is any possibility in PHP to create my own persistent superglobal, a variable which can be read by any script running. I think something similiar is available as the "Application" Object in ASP under IIS. I know I have to take care of locking and stuff (although the end-user scripts would only need read access to it), but if I could write some functions which just would check if the tree is already in memory or not (after a server shutdown or whatever), and if not just read it in from the database to make it available in every other script.
The only thing I've found so far which I think may be a possibility is the shared memory stuff that PHP supports, but I don't know anything about that on the system level, and its not explained in much detail in the PHP manual. Is that something I should follow, or can't I use it ? Can I somehow use the underlying Apache ? Are there better options ?
any help/suggestions/hints are greatly appreciated !
mathias rockel
attached mail follows:
A pretty easy way of doing it is to add a size field to the table. Whenever you INSERT INTO or UPDATE the table, update this field to contain the size of the data for the current record. Then, whenever you need to check the amount of data for a particular user, just use this query:
"SELECT SUM(size) FROM sometable WHERE user=someuser"
Hope this helps
/Lars Olsson (lasso
lassoweb.nu)
PS. Ive done this in a file upload script I created a while ago. If you want, I can mail you the relevant bits and bytes. DS.
Denis L. Menezes wrote: > Hello friends. > > I have a need for checking how much data(in kb) exists of each of the user members in the MySQL so that when they upload more data I can restrict/warn them of the amount of data they have on the server at present. > > can anyone please tell me how to check the amount of data on the mysql for each record? > > thanks very much > Denis
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]