[PHP] WinXP+Apache2+php4+php5=almost true
I had no problem installing php4 as sapi module and php5 as cgi executeable. The server starts with no error messages. BUT, when I try opening a file (phpinfo.php5 with content ?php phpinfo(); ? the server return a 500 Internal Server Error. Have the following lines added to httpd.conf LoadModule php4_module D:/php/sapi/php4apache2.dll ScriptAlias /php5/ D:/php5/ Action application/x-httpd-php5 /php5/php.exe AddType application/x-httpd-php .php .php3 .phtml AddType application/x-httpd-php-source .phps AddType application/x-httpd-php5 .php5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] WinXP+Apache2+php4+php5=almost true
I had no problem installing php4 as sapi module and php5 as cgi executeable. The server starts with no error messages. BUT, when I try opening a file (phpinfo.php5 with content ?php phpinfo(); ? the server return a 500 Internal Server Error. Have the following lines added to httpd.conf LoadModule php4_module D:/php/sapi/php4apache2.dll ScriptAlias /php5/ D:/php5/ Action application/x-httpd-php5 /php5/php.exe AddType application/x-httpd-php .php .php3 .phtml AddType application/x-httpd-php-source .phps AddType application/x-httpd-php5 .php5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What's best, using a temp-file or a temp-table
I want to give the visitor a possibility to create plenty of new user accounts by letting the him paste the userinfo from a tab-, comma- or semicolonseparated file to a textarea (form.php). Then some checking needs to be done (check_users.php) before the final result is written to the db (add_users.php). Right now I'm trying to achieve this by putting the user input into a (temporary) file and populate the fields in check_users.php from this file. This works. But now I will do some changes before I write to the db, and here I know nada. Is there some useful functions here that is useful? (How can I edit this temp-file?) I have (as mentioned above) another idea: use a temporay table and populate this from the user input. Do the changes here, using the queries needed, write from this table to the real place and then drop this table. What is the best approach? Here is form.php: ?php echo HTML BODY H1Klistra in från din textfil/H1 Kom ihåg att texten måste vara tabb-, komma- eller semikolonavgränsad FORM METHOD=POST ACTION=\check_users.php\ TEXTAREA NAME=\users\ ROWS=\10\ COLS=\50\/TEXTAREABR INPUT TYPE=\submit\ VALUE=\Skicka\ /FORM /BODY /HTML ; ? and here check.users.php (right now) ?php include(../recycle/head.php); echo /HEAD BODY STYLE=\background-color:#44\ CENTERTABLE TH COLSPAN=6Förhandsgranska/TH TRTD/TDTDFörnamn/TDTDEfternamn/TDTDKlass/grupp/TDTDAnvän darnamn/TDTD/TD/TR ; if ($users == || $users == \r\n) { echo SCRIPT LANGUAGE=\JavaScript\ !-- document.write(void(history.go(-1))) //-- /SCRIPT; } $filename = addusers.txt; if (isset($users)) { $temp = $_POST['users']; $handle = fopen($filename, w+); fwrite($handle, $temp); $users = file($filename); if (ereg(\t, $users[0]) == true) $separator = \t; // om texten är tabbavgränsad else if (ereg(,, $users[0]) == true) $separator = ,; // om texten är kommaavgränsad else $separator = ;; // om texten är semikolonavgränsad $count = 0; foreach ($users as $v) { list($firstname, $lastname, $mygroup, $username, $password) = explode($separator, trim($v)); $firstname = ucfirst(trim($firstname)); $lastname = ucfirst(trim($lastname)); $mygroup = strtoupper(trim($mygroup)); $username = trim($username); $password = trim($password); echo FORM NAME=\form_$count\ METHOD=POST ACTION=\{$_SERVER['PHP_SELF']}\TR; echo TD$countINPUT TYPE=HIDDEN NAME=\counter\ VALUE=\$count\/TD; echo TDINPUT TYPE=TEXT NAME=\firstname\ SIZE=15 VALUE=\$firstname\/TD; echo TDINPUT TYPE=TEXT NAME=\lastname\ SIZE=15 VALUE=\$lastname\/TD; echo TDINPUT TYPE=TEXT NAME=\mygroup\ SIZE=7 VALUE=\$mygroup\/TD; echo TDINPUT TYPE=TEXT NAME=\username\ SIZE=15 VALUE=\$username\/TD; echo INPUT TYPE=HIDDEN NAME=\password\ VALUE=\$password\; echo TD ALIGN=LEFTA HREF=\#\ TITLE=\Ta bort denna post\ onClick=\\IMG SRC=\delete.gif\ BORDER=0/A/TD;//I'm not sure what to do here echo /TR/FORM; $count++; } echo FORM NAME=\show_users\ METHOD=POST ACTION=\add_users.php\TRTD COLSPAN=6 ALIGN=RIGHTINPUT TYPE=\submit\ VALUE=\OK, skicka\/TD/TRINPUT TYPE=HIDDEN NAME=\temp\ VALUE=\$temp\/FORM; } echo /TABLE/CENTER /BODY /HTML ; fclose($handle); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Oops, sessions. I need to study the subject
if(isset($_POST['users']) { $_SESSION['temp_users'] = $_POST['users']; } if (ereg(\t, $_SESSION['temp_users'][0]) == true) $separator = \t; ...etc hope it helps Pete Will take a look at function.serialize too. Thank you guys -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What's best, using a temp-file or a temp-table
Since I'm new to the subject have patience with my 'stupid' questions. On the form-page I don't have a session_start(), right? But, this means the session will not be set before I reload the check_users.php? From what I can see the session var is a string exactly a copy of the input (the csv, txt or skv-file). How can I now delete let's say the second row in this session var? Pete Morganic [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] you could use a $_SESSION variable instead of file $filename = addusers.txt; if (isset($users)) { $temp = $_POST['users']; $handle = fopen($filename, w+); fwrite($handle, $temp); $users = file($filename); if (ereg(\t, $users[0]) == true) $separator = \t; // om texten är if(isset($_POST['users']) { $_SESSION['temp_users'] = $_POST['users']; } if (ereg(\t, $_SESSION['temp_users'][0]) == true) $separator = \t; ...etc hope it helps Pete ØYstein HåLand wrote: I want to give the visitor a possibility to create plenty of new user accounts by letting the him paste the userinfo from a tab-, comma- or semicolonseparated file to a textarea (form.php). Then some checking needs to be done (check_users.php) before the final result is written to the db (add_users.php). Right now I'm trying to achieve this by putting the user input into a (temporary) file and populate the fields in check_users.php from this file. This works. But now I will do some changes before I write to the db, and here I know nada. Is there some useful functions here that is useful? (How can I edit this temp-file?) I have (as mentioned above) another idea: use a temporay table and populate this from the user input. Do the changes here, using the queries needed, write from this table to the real place and then drop this table. What is the best approach? Here is form.php: ?php echo HTML BODY H1Klistra in från din textfil/H1 Kom ihåg att texten måste vara tabb-, komma- eller semikolonavgränsad FORM METHOD=POST ACTION=\check_users.php\ TEXTAREA NAME=\users\ ROWS=\10\ COLS=\50\/TEXTAREABR INPUT TYPE=\submit\ VALUE=\Skicka\ /FORM /BODY /HTML ; ? and here check.users.php (right now) ?php include(../recycle/head.php); echo /HEAD BODY STYLE=\background-color:#44\ CENTERTABLE TH COLSPAN=6Förhandsgranska/TH TRTD/TDTDFörnamn/TDTDEfternamn/TDTDKlass/grupp/TDTDAnvän darnamn/TDTD/TD/TR ; if ($users == || $users == \r\n) { echo SCRIPT LANGUAGE=\JavaScript\ !-- document.write(void(history.go(-1))) //-- /SCRIPT; } $filename = addusers.txt; if (isset($users)) { $temp = $_POST['users']; $handle = fopen($filename, w+); fwrite($handle, $temp); $users = file($filename); if (ereg(\t, $users[0]) == true) $separator = \t; // om texten är tabbavgränsad else if (ereg(,, $users[0]) == true) $separator = ,; // om texten är kommaavgränsad else $separator = ;; // om texten är semikolonavgränsad $count = 0; foreach ($users as $v) { list($firstname, $lastname, $mygroup, $username, $password) = explode($separator, trim($v)); $firstname = ucfirst(trim($firstname)); $lastname = ucfirst(trim($lastname)); $mygroup = strtoupper(trim($mygroup)); $username = trim($username); $password = trim($password); echo FORM NAME=\form_$count\ METHOD=POST ACTION=\{$_SERVER['PHP_SELF']}\TR; echo TD$countINPUT TYPE=HIDDEN NAME=\counter\ VALUE=\$count\/TD; echo TDINPUT TYPE=TEXT NAME=\firstname\ SIZE=15 VALUE=\$firstname\/TD; echo TDINPUT TYPE=TEXT NAME=\lastname\ SIZE=15 VALUE=\$lastname\/TD; echo TDINPUT TYPE=TEXT NAME=\mygroup\ SIZE=7 VALUE=\$mygroup\/TD; echo TDINPUT TYPE=TEXT NAME=\username\ SIZE=15 VALUE=\$username\/TD; echo INPUT TYPE=HIDDEN NAME=\password\ VALUE=\$password\; echo TD ALIGN=LEFTA HREF=\#\ TITLE=\Ta bort denna post\ onClick=\\IMG SRC=\delete.gif\ BORDER=0/A/TD;//I'm not sure what to do here echo /TR/FORM; $count++; } echo FORM NAME=\show_users\ METHOD=POST ACTION=\add_users.php\TRTD COLSPAN=6 ALIGN=RIGHTINPUT TYPE=\submit\ VALUE=\OK, skicka\/TD/TRINPUT TYPE=HIDDEN NAME=\temp\ VALUE=\$temp\/FORM; } echo /TABLE/CENTER /BODY /HTML ; fclose($handle); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] from a textfile/textarea to a mysql INSERT
John W. Holmes [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Øystein Håland wrote: From Excel you can save a table as a tab separated txt-file. I want to take this and execute INSERT queries (by uploading the file or by copying the content into a textarea). Anyone who has a script to do this? My platform is Windows, but the script will be used on a Linux web server. Use the LOAD DATA INFILE command to load the entire file at once. Thanks (and I'm working on it right now). But what about the textarea way? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] from a textfile/textarea to a mysql INSERT
From Excel you can save a table as a tab separated txt-file. I want to take this and execute INSERT queries (by uploading the file or by copying the content into a textarea). Anyone who has a script to do this? My platform is Windows, but the script will be used on a Linux web server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PATH_TRANSLATED
Is there some way to retrieve the phpvariable PATH_TRANSLATED on my local win2k+Apache2+php4.3.2 box? Using phpinfo() does not show PATH_TRANSLATED -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PATH_TRANSLATED
That gives the following error: Notice: Undefined index: PATH_TRANSLATED and the reason is the variable isn't set by Apache/PHP Matt [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] - Original Message - From: Øystein Håland [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 07, 2003 11:37 AM Subject: [PHP] PATH_TRANSLATED Is there some way to retrieve the phpvariable PATH_TRANSLATED on my local win2k+Apache2+php4.3.2 box? echo Path Translated: {$_SERVER['PATH_TRANSLATED']}br; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Browser detection script (css)
Maybe this could do the job as well. Thanks Emo [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] I don't know if you mean this ... I use for detect browser and send css for it this script: ?php // set default css file (MSIE) $css='main.css'; // if browser is opera ... if (substr_count($_SERVER[HTTP_USER_AGENT], 'Opera')) { // ... set opera css $css='main.opera.css'; } // if browser is gecko-based (mozilla, etc...) elseif (substr_count($_SERVER[HTTP_USER_AGENT], 'Gecko')) { // ... set gecko css $css='main.gecko.css'; } ? html head title Some title /title link rel=StyleSheet href=? echo $css; ? type=text/css meta http-equiv=content-type content=text/html; charset=windows-1250 /head body . . . ØYstein HåLand [EMAIL PROTECTED] pí¹e v diskusním pøíspìvku news:[EMAIL PROTECTED] Till now I've bin using the BrowserDetect.class.php by Harry Fuecks. Since I migrated to register_globals=off this produses a lot of error messages. Has anyone a modification that work or another script doing the same? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Other error messages due to the migration
OK, thanks to Justins function (http://www.weberdev.com/get_example.php3?count=3639 ) I've got rid of somme errors. Now I have a new headache, my update script. The error message is Notice: Undefined index: PATH_TRANSLATED in D:\Apache2\htdocs\recycle\update.php on line 5 and the return from the script is: Uppdaterad torsdag den 1. januari 1970 (obviously not true) The script itself is as follows: putenv(PHP_TZ=Europe/Stockholm); if (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Jan) { $month = $monthname[0]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Feb) { $month = $monthname[1]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Mar) { $month = $monthname[2]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Apr) { $month = $monthname[3]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==May) { $month = $monthname[4]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Jun) { $month = $monthname[5]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Jul) { $month = $monthname[6]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Aug) { $month = $monthname[7]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Sep) { $month = $monthname[8]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Oct) { $month = $monthname[9]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Nov) { $month = $monthname[10]; } elseif (date(M,filemtime($_SERVER['PATH_TRANSLATED']))==Dec) { $month = $monthname[11]; } if (date(D,filemtime($_SERVER['PATH_TRANSLATED']))==Sun) { $tday = $dayname[0]; } elseif (date(D,filemtime($_SERVER['PATH_TRANSLATED']))==Mon) { $tday = $dayname[1]; } elseif (date(D,filemtime($_SERVER['PATH_TRANSLATED']))==Tue) { $tday = $dayname[2]; } elseif (date(D,filemtime($_SERVER['PATH_TRANSLATED']))==Wed) { $tday = $dayname[3]; } elseif (date(D,filemtime($_SERVER['PATH_TRANSLATED']))==Thu) { $tday = $dayname[4]; } elseif (date(D,filemtime($_SERVER['PATH_TRANSLATED']))==Fri) { $tday = $dayname[5]; } elseif (date(D,filemtime($_SERVER['PATH_TRANSLATED']))==Sat) { $tday = $dayname[6]; } echo $updated . $tday . den . date( j. , filemtime($_SERVER['PATH_TRANSLATED']) ) . $month; echo . date( Y, filemtime($_SERVER['PATH_TRANSLATED']) ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Migration once again
Now when I've learned that $_SERVER['PHP_SELF'] is correct and $_SERVER[PHP_SELF] is wrong I wonder why the following code SCRIPT LANGUAGE=\JavaScript\ !--// function openPrintCloseWindow(){ myWin=window.open(\$_SERVER['PHP_SELF']?skrivut=yeahtarget=$target\,\pri ntout\,\scrollbars=yes,status=yes,screenX=0,screenY=0,WIDTH=640,height=500 \); } //-- /SCRIPT parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Migration once again
Sorry, that is no help. You will see that I have escaped all double quotation marks since the javascript is inside a php-script. The problem is, if I use $_SERVER[PHP_SELF] I get no errors (yepp, error_reports=E_ALL) R'Twick Niceorgaw [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] May be this will fix ? myWin=window.open(\?= $_SERVER['PHP_SELF']??skrivut=yeahtarget=$target\,\printout\,\scrollba rs=yes,status=yes,screenX=0,screenY=0,WIDTH=640,height=500 \); ?= $_SERVER['PHP_SELF']? : You need to enclose $_SERVER[PHP-SELF] with ?= ? tags to be parsed by php. ØYstein HåLand [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Now when I've learned that $_SERVER['PHP_SELF'] is correct and $_SERVER[PHP_SELF] is wrong I wonder why the following code SCRIPT LANGUAGE=\JavaScript\ !--// function openPrintCloseWindow(){ myWin=window.open(\$_SERVER['PHP_SELF']?skrivut=yeahtarget=$target\,\pri ntout\,\scrollbars=yes,status=yes,screenX=0,screenY=0,WIDTH=640,height=500 \); } //-- /SCRIPT parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser detection script (css)
Till now I've bin using the BrowserDetect.class.php by Harry Fuecks. Since I migrated to register_globals=off this produses a lot of error messages. Has anyone a modification that work or another script doing the same? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Migration once again
R'Twick Niceorgaw [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Are you echoing the javascript ? Exactly, it is echoed like ?php echo //lots of code SCRIPT LANGUAGE=\JavaScript\ !--// function openPrintCloseWindow(){ myWin=window.open(\$_SERVER[PHP_SELF]?skrivut=yeahtarget=$target\,\print out\,\scrollbars=yes,status=yes,screenX=0,screenY=0,WIDTH=640,height=500\ ); } //-- /SCRIPT ; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Migration once again
I'm sorry Dan, but it don.t make any difference. Here's almost the complete code: ?php $target = se; $languagefile = ../recycle/language_ . $target . .php; include($languagefile); echo !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\ HTML HEAD ; if (ereg(/math, $_SERVER['PHP_SELF']) == true) { echo some javascript here ; } else if (ereg(/prov/, $_SERVER['PHP_SELF']) == true) { echo some more javascript here ; } echo SCRIPT LANGUAGE=\JavaScript\ !--// function openPrintCloseWindow() { myWin=window.open(\$_SERVER['PHP_SELF']?skrivut=yeahtarget=$target\,\pri ntout\,\scrollbars=yes,status=yes,screenX=0,screenY=0,WIDTH=640,height=500 \); } //-- /SCRIPT /HEAD ; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Migration from register_globals=on to register_globals=off
None of my old scripts worx nowadays and the most common error message is 'undefined variable'. What is the best/simplest way to work around this situation? if !isset($myvar) { do this blah blah } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Migration from register_globals=on to register_globals=off
I'm not sure what you mean. To give ONE example: Earlier I could use this code on top of every page: if ($printout != yeah) { include(header.php); } This code gives an error today. The variable $printout is set if the visitor choose to click on the 'print_page_image', otherwise the variable has no value. Esteban FernáNdez [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] When you recivied that error ?, in a form ?, if is in a Form just put in the top of .php files this code $HTTP_GET_VARS[variable2]; $HTTP_GET_VARS[variable3]; Of course if you send with other method (post) change the GET for POST $HTTP_POS_VARS[variable2]; $HTTP_POS_VARS[variable3]; Regards. Esteban. ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] None of my old scripts worx nowadays and the most common error message is 'undefined variable'. What is the best/simplest way to work around this situation? if !isset($myvar) { do this blah blah } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Migration from register_globals=on to register_globals=off
I tried changing my code to (since the variable $printout in this case is sent with GET) ($_GET['printout'] != yeah) { include(header.php); } and got the following error: Undefined index: printout -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OK guys, thank you so far
Now my code is extract ($_GET); if ($_GET['printout'] != yeah) { include(header.php); } but I still get the following error: Undefined index: printout I understand nothing Jonathan Wilkes [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Hi, What he means is that with register_globals=off you cannot do this: echo $path you need to do this (if the variable is sent by POST action) echo _POST('path') and through GET echo _GET('path') -Original Message- From: Øystein Håland [mailto:[EMAIL PROTECTED] Sent: 03 June 2003 17:02 To: [EMAIL PROTECTED] Subject: [PHP] Re: Migration from register_globals=on to register_globals=off I'm not sure what you mean. To give ONE example: Earlier I could use this code on top of every page: if ($printout != yeah) { include(header.php); } This code gives an error today. The variable $printout is set if the visitor choose to click on the 'print_page_image', otherwise the variable has no value. Esteban FernáNdez [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] When you recivied that error ?, in a form ?, if is in a Form just put in the top of .php files this code $HTTP_GET_VARS[variable2]; $HTTP_GET_VARS[variable3]; Of course if you send with other method (post) change the GET for POST $HTTP_POS_VARS[variable2]; $HTTP_POS_VARS[variable3]; Regards. Esteban. ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] None of my old scripts worx nowadays and the most common error message is 'undefined variable'. What is the best/simplest way to work around this situation? if !isset($myvar) { do this blah blah } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OK guys, thank you so far
I've tried and here's the output: Undefined index: input if ($HTTP_GET_VARS['printout'] != yeah) { include(header.php); } Edward Peloke [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] can you try if ($HTTP_GET_VARS['printout']!=yeah) {include(header.php);} does that work? -Original Message- From: Øystein Håland [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 1:17 PM To: [EMAIL PROTECTED] Subject: [PHP] OK guys, thank you so far Now my code is extract ($_GET); if ($_GET['printout'] != yeah) { include(header.php); } but I still get the following error: Undefined index: printout I understand nothing Jonathan Wilkes [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Hi, What he means is that with register_globals=off you cannot do this: echo $path you need to do this (if the variable is sent by POST action) echo _POST('path') and through GET echo _GET('path') -Original Message- From: Øystein Håland [mailto:[EMAIL PROTECTED] Sent: 03 June 2003 17:02 To: [EMAIL PROTECTED] Subject: [PHP] Re: Migration from register_globals=on to register_globals=off I'm not sure what you mean. To give ONE example: Earlier I could use this code on top of every page: if ($printout != yeah) { include(header.php); } This code gives an error today. The variable $printout is set if the visitor choose to click on the 'print_page_image', otherwise the variable has no value. Esteban FernáNdez [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] When you recivied that error ?, in a form ?, if is in a Form just put in the top of .php files this code $HTTP_GET_VARS[variable2]; $HTTP_GET_VARS[variable3]; Of course if you send with other method (post) change the GET for POST $HTTP_POS_VARS[variable2]; $HTTP_POS_VARS[variable3]; Regards. Esteban. ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] None of my old scripts worx nowadays and the most common error message is 'undefined variable'. What is the best/simplest way to work around this situation? if !isset($myvar) { do this blah blah } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Use of undefined constant PHP_SELF - assumed 'PHP_SELF'
What's the difference (and what's correct)? With the use of error_reporting = E_ALL in php.ini I get an error as mentioned above. In the code I use $_SERVER[PHP_SELF]. Changing this to $_SERVER['PHP_SELF'] report no error but with error_reporting = E_ALL ~E_NOTICE anything goes. (Apache/2.0.46 (Win32) PHP/4.3.2 on Win2000 pro) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with session needed
Today I collect information from several forms and store it in a cookie: function formCookie() { var cookieValue = document.$formName.totalAns.value+'|'; cookieValue +=document.form1.correct.value+'$test[1]'+document.form1.question1.value+doc ument.form1.answer.value+'|'; cookieValue +=document.form2.correct.value+'$test[1]'+document.form2.question2.value+doc ument.form2.answer.value+'|'; more lines document.cookie = '$ansCookie='+escape(cookieValue)+';expires='; } The problem is the cookie soon reaches the 4 kb limit, so I would like to achieve the same using session. The trouble is, I don't know how to do. I would appreciate any help that brings me closer to a solution on this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help me out plzzzz
Today I collect information from several forms and store it in a javascript cookie: function formCookie() { var cookieValue = document.$formName.totalAns.value+'|'; cookieValue+=document.form1.correct.value+'$test[1]'+document.form1.question 1.value+document.form1.answer.value+'|'; cookieValue+=document.form2.correct.value+'$test[1]'+document.form2.question 2.value+document.form2.answer.value+'|'; more lines document.cookie = '$ansCookie='+escape(cookieValue)+';expires='; } The problem is the cookie soon reaches the 4 kb limit, so I would like to achieve the same using session. The trouble is, I don't know how to do. I would appreciate any help that brings me closer to a solution on this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with fonts
I want to create an image using outlined fonts. Is it possible? HOW? And, secondly: I would like the first character to be a different font -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with session needed
I use cookies in my web applications, but have reached the 4 kB limit. So I need to 'convert' all my cookies to session variables. Have got an idea how I can create such for one variable, but here I have multi element cookies. Reading the php manual gives me no idea on how to do this. Here's the recipe for my cookies: function formCookie() { var cookieValue = document.$formname.totalAns.value+'|'; // Using '|' to split each part of the cookie cookieValue += document.form1.correct.value+'$test[1]'+document.form1.question1.value+docum ent.form1.answer.value+'|'; cookieValue += document.form2.correct.value+'$test[1]'+document.form2.question2.value+docum ent.form2.answer.value+'|'; more lines document.cookie = '$answercookie='+escape(cookieValue)+';expires='; } How can I achieve the same using sessions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using the GD library
I can create images of words but I want the characters to be outlined, and I want to have the first character in a different font. How can this be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert my old cookies to session variable(s)
I use extensively cookies in my web applications, but have reached the 4 kB limit. So now I need to 'convert' all my cookies to session variables. Have got an idea how I can create such for one variable, but here I have multi element cookies. Reading the php manual gives me no idea on how to do this. Here's the recipe for my cookies: function formCookie() { var cookieValue = document.$formname.totalAns.value+'|'; // Using '|' to split each part of the cookie cookieValue += document.form01.correct.value+'$test[1]'+document.form01.question1.value+doc ument.form01.answer.value+'|'; cookieValue += document.form02.correct.value+'$test[1]'+document.form02.question2.value+doc ument.form02.answer.value+'|'; more lines document.cookie = '$answercookie='+escape(cookieValue)+';expires='; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Javascript cookie vs sessions
Javascript cookies can't help me anymore, is sessions the solution? I guess the answer is yes. Well, first of all, I have reached the limit of js cookies, 4 kB. My last attempt needed 6.5 kB to be passed to the next page (many many forms, and I can't break it into smaller parts). And there IS an idea using ONE cookie instead of many. So, the next question is, is there any limitations using sessions? My last request: I need some easy but not too 'elementary' tutorial on using sessions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I link to all BUT $PHP_SELF
I use the following function to create links to files in the same catalog (and format the link text): function createLink() { $handle=opendir(.); while ($file = readdir($handle)){ if (($file == .) || ($file == ..) || (ereg(index, $file) == true) || ($file == basename ($PHP_SELF))) { continue; } if(is_file($file)) { $files[] = $file; } } $link = sort($files); foreach($files as $file) { $linktext = substr_replace($file,'',0,3); $linktext = substr_replace($linktext,'',-4); $linktext = ucfirst($linktext); echo nbsp;A HREF=\$file\ CLASS=\light\$linktext/A\n; } return true; } The part $file == basename ($PHP_SELF) is intended to not link to the calling document, but this part doesn't work. So, what shall I do instead? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I link to all BUT $PHP_SELF
Jason Wong [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thursday 06 February 2003 04:21, Øystein Håland wrote: The part $file == basename ($PHP_SELF) is intended to not link to the calling document, but this part doesn't work. So, what shall I do instead? Could you explain HOW it doesn't work? I get a link to the calling document/file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How can I link to all BUT $PHP_SELF
Greg Beaver [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Try this out (untested) (basename ($file) == basename ($_SERVER['PATH_TRANSLATED']))) Greg -- This does what I want, thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I link to all BUT $PHP_SELF
I expected it to NOT link to the calling document, but it did (but not any longer). Jason Wong [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thursday 06 February 2003 04:50, Øystein Håland wrote: Jason Wong [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thursday 06 February 2003 04:21, Øystein Håland wrote: The part $file == basename ($PHP_SELF) is intended to not link to the calling document, but this part doesn't work. So, what shall I do instead? Could you explain HOW it doesn't work? I get a link to the calling document/file Let's try again. What did you expect: $file == basename ($PHP_SELF) to do. And what did it actually do? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* He who laughs has not yet heard the bad news. -- Bertolt Brecht */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mailing a cookie string
I use the following javascript code to split all elements in a cookie string var mailContent = getCookie('$formname'); if (mailContent != null) { var mailData = mailContent.split(/[#]/); var str = '$youhad '+mailData[0]+'$test[12] '+(mailData.length-2); str = str+'BR$test[13] '+mailData[1]; for (i = 2; i mailData.length; i++) { str = str+(i-1)+'. '+mailData[i]; } } and then a hidden field to hold the value of 'str'. Then I read from the hidden field to the mail content and mail it using mail($to,$subject,$body,$from); But obviously the html-part (BR) don't work because it all arrives in one long line. I have tried using \n\r instead of BR but it result in javascript error. What is the solution to this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can I see when a file was created?
When last modified, yes. How about when it was created? By using php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I display lastmodified for all my php-files?
In one file I want to display filenames and when these files was last modified. I want this to happen even for files in other directories. First of all, can it be done with php (I have seen that it is possible using SSI), and in that case how? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I display lastmodified for all my php-files?
Jason Sheets [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Take a look at the getlastmod() function, an example of the usage would be: $last_mod = date (F d Y H:i:s., getlastmod()); Then you can print or operate on last_mod any way you want, if you don't want to operate on the date you can just print the return of date. I use the getlastmod()function already, to print in the same document, but I recon this isn't exactly the same thing, since I want to display in ONE page the last modified date of all my php-files, or am I wrong? Some kind of array is necessary? I believe I need some kind of (recursive) function that collect this information from all my files, and I believe someone have written one already. I have not the skills (yet) to write it myself -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I display lastmodified for all my php-files?
- Original Message - From: Philip Olson [EMAIL PROTECTED] To: Øystein Håland [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, February 02, 2003 11:41 PM Subject: Re: [PHP] How can I display lastmodified for all my php-files? See: http://www.php.net/readdir http://www.php.net/filemtime The examples within will help you write this. Thanks, I will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I display lastmodified for all my php-files?
See: http://www.php.net/readdir http://www.php.net/filemtime The examples within will help you write this. K, think it is possible to solve my problem. Here comes a almost similar question. After looking up the stat(9 function I cant see how I can acces the 'created date' of a file. Can I? How? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apachequestion
After reinstalling w2k on my laptop and installing Apache 2.0, php 4.3.0 I cannot get cgi-scripts running. In httpd.conf I have the following line: ScriptAlias /cgi-bin/ C:/Apache/cgi-bin/ since I have my scripts there. When calling a script I get Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. So, what do I have to do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail via php. 2 questions...
The first problem I cannot solve on my own: I get the mail content from a cookie. Quite a big cookie since it is a collection of 30 - 40 form values from another page. When recieving the mail, the content come in ONE long string, and in some places with a \BR\. Of course, i dont want this to be printed (but I want the function, a line break). So, how can I get a line break in my javascript cookie (yeah, I have already tried \n). The second problem: I want the mail to be sent automatically when the visitor have filled in all the forms in the document and goes to the next document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random array element
This is how I do in javascript: randNumber = new Array(); for (p = 0; p 10; p++) { randNumber[p] = Math.floor(Math.random()*7); } weekday = new Array(monday,tuesday,wednesday,thursday,friday,saturday,sunday ) randDay1 = weekday[randNumber[0]] randDay2 = weekday[randNumber[1]] I would like to achieve the same goal using php but I cannot get it to work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another cookie question
In the purpose of getting access to mydomain.se/ha/ I will set a cookie: setcookie (login, OK, time()+3600, /ha/); It looks like the cookie is set since I get the confirmation text (of course placed inside the codeblock where the cookie is 'set' (?). Probably it just confirm that it has found ONE hit in the db on the username/password pair). But, when I try to access any file in mydomain.se/ha/ it fails and the login script is loaded again (and a look in 'Temporary Internet Files' tells the cookie doesn't exist). On the local machine (w2k, apache 2) the same script works ok -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] This is weird, this script does/doesn't work
on my own machine, W2k+Apache+php4.2 this works without problem, on the Internet-server though, (Linux), the following script produces a blank page: ?php require ../utils.php; $link=openDB(); $file = $target.form; // Queries for student if ($target == student) { // Add student Query to add // Change student info Query to change info // Delete student Query to delete } // Queries for result if ($target == result) { // Delete result Query to delete } if(!isset($administrate) $goal) { if ($logga_in == ok ) { $adm_user = admin; $adm_pass = password; if ($operation == logon) { if ($password == $adm_pass $admin == $adm_user) { setcookie(administrate, OK, 0); include(../recycle/head.php); include ($file.php); } else { include(../recycle/head.php); echo CENTERFONT SIZE=\5\ COLOR=\#C9\Please try again. Check your spelling./FONTCENTER; include (loginform.php); } } } else { include(../recycle/head.php); include (loginform.php); } } elseif ($target) {//When logged in this load the right form include(../recycle/head.php); include ($file.php); } if (!$target) {//This happens when first loaded. In the head.php there's a menu and the different targets are set include(../recycle/head.php); echo H2Administration of SUBIMG BORDER=0 SRC=\../pics/mypicmin.gif\ WIDTH=135 HEIGHT=30/SUB/H2 ; } include(../recycle/bottom.php); ? Explanation: utils.php with the two functions openDB() and queryDB() connect to the database and do the query. loginform.php contains the html to the loginform. $file = $target.form; so the right form will be loaded. So, what is wrong, why does it 'behave' so different? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: posting form values doesn't work
Yes, you were right. Now a natural question. WHY? I don't understand your explanation, since I thought it was equal, getting a field value using document.answerform.name.value in javascript AND the variable $name in php. I still use php in the location.href-part (it is as follows, the other was faked: location.href=groups/?php echo $formname; ?answer.php This opens the file groups/collectanswer.php. So, why does it work some time mixing javascript and php, and not every time? Erwin [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ØYstein HåLand wrote: This is my form: FORM NAME=answerform METHOD=POST Your name:BRINPUT TYPE=TEXT NAME=name SIZE=20 Group:BRINPUT TYPE=TEXT NAME=group SIZE=8nbsp;nbsp; INPUT TYPE=BUTTON VALUE= OK! onClick=Javascript:validate(this); /FORM and the function validate: function validate() { [ CUT Javascript code ] location.href='groups/collect_answer.php?name=?php echo $name; ?group=?php echo $group; ?'; [ CUT Javascript code ] At first I thought is was JavaScript/HTML code, but I can see a little bit PHP now ;-)) The reason that it doens't work is simple. The variables are only available AFTER posting the form. Not during validation! You should just use Javascript to fill in the name and group into the URL. Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mailing a cookiecontent
Here's what I wanna do: On the first page I collect a lot of formfield values into a cookie. On the next page I display the content of this cookie. This works. What I even want to do is mailing the cookie content in the same time I submit the forms in the first page (or, when the new page loads). I use this code on the second page: if ($REQUEST_METHOD=='POST') { $name = escapeshellcmd($name); $group = escapeshellcmd($group); $to = [EMAIL PROTECTED]; $from = FROM: $name, $group; $subject = The subject of this mail\n\n; $body = Name: $name\t; $body .= Group: $group\n; $body .= \n\n$comments\n\n; mail($to,$subject,$body,$from); exit; } Well, I recieve a mail, but the mailcontent is empty. The cookie string is written to a hidden field like this: document.write('FORMINPUT TYPE=HIDDEN NAME=\comments\ VALUE=\'+cookiestr+'\/FORM'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: header()-question
[EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Dont use a directory but an url like header(Location: http://www.php.net;); Thanks, that made it work. But now comes the next problem. When finshed logging in login.php is reloaded with a confirmation text ('You're logged in. Click the button to go back'). But, at the bottom of the page the following error message appears: Fatal error: Cannot redeclare createlinks() (previously declared in c:\apache\htdocs\ha\recycle\lankar.php:6) in c:\apache\htdocs\ha\recycle\lankar.php on line 5 The problem is: the call for the function createlinks() is done from the previous page (index.php), the file where I user header(), and I can't see that the function has bin called for yet. Index.php looks as follows: ?php if (!isset($login)) { header(Location: http://127.0.0.1/ha/login/login.php?goal=loggoback=$PHP_SELF;); } else { include(../recycle/head.php); if($skrivut != jepp) { createLinks(); } include(../gjenvinn/foot.php); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mailing a cookiecontent
Nope, the cookie is a multivalue cookie (the values from several fields (30-40). The cookiestr is the formatted cookievalue (formatted with numbers and \n) Dave [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Here's what I wanna do: On the first page I collect a lot of formfield values into a cookie. On the next page I display the content of this cookie. This works. What I even want to do is mailing the cookie content in the same time I submit the forms in the first page (or, when the new page loads). I use this code on the second page: if ($REQUEST_METHOD=='POST') { $name = escapeshellcmd($name); $group = escapeshellcmd($group); $to = [EMAIL PROTECTED]; $from = FROM: $name, $group; $subject = The subject of this mail\n\n; $body = Name: $name\t; $body .= Group: $group\n; $body .= \n\n$comments\n\n; see below, but if you cookie is named cookiestr, just us the variable here $body .= \n\n$cookiestr\n\n; mail($to,$subject,$body,$from); exit; } Well, I recieve a mail, but the mailcontent is empty. The cookie string is written to a hidden field like this: document.write('FORMINPUT TYPE=HIDDEN NAME=\comments\ VALUE=\'+cookiestr+'\/FORM'); so your cookie variable name is cookiestr why use Javascript, and not just echo 'FORMINPUT TYPE=HIDDEN NAME=comments VALUE='.$cookiestr.'/FORM'; Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] posting form values doesn't work
This is my form: FORM NAME=answerform METHOD=POST Your name:BRINPUT TYPE=TEXT NAME=name SIZE=20 Group:BRINPUT TYPE=TEXT NAME=group SIZE=8nbsp;nbsp; INPUT TYPE=BUTTON VALUE= OK! onClick=Javascript:validate(this); /FORM and the function validate: function validate() { var ok=true; if (document.answerform.name.value=='') { ok=false; alert('Please write Your name') document.answerform.name.focus(); document.answerform.name.select(); } if (document.answerform.group.value=='') { ok=false; alert('What group?') document.answerform.group.focus(); document.answerform.group.select(); } if (ok==true) { location.href='groups/collect_answer.php?name=?php echo $name; ?group=?php echo $group; ?'; return true; } else { return false; } } and this doesn't work and I can't see why not -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sort()-help needed
When calling the function createLinks() I get an unsorted result, and that's NOT what I want. But I'm not able (lack of knowlegde) to sort the output (the links). ?php function createLinks() { $handle=opendir(.); echo UL\n; while ($file = readdir($handle)){ if (($file == .) || ($file == ..) || ($file == index.php) || ($file == basename ($PHP_SELF))) { continue; } if(is_file($file)) { $linktext = ucfirst ($file); $linktext = substr_replace ($linktext,'',-4); echo LInbsp;nbsp;A HREF=\$file\$linktext/A\n; } } echo /UL\n; return true; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sort()-help needed
Put them into an array and sort() the array. The loop through the sorted array and output at that point. Just what I try. But, because of my lack of understanding, the output is my problem: function createLinks() { $p = 0; $handle=opendir(.); echo UL\n; while ($file = readdir($handle)){ $files[] = $file; $sorted = sort($files); if (($file == .) || ($file == ..) || ($file == basename ($PHP_SELF))) { continue; } if(is_file($file)) { $p++; $linktext = ucfirst ($file); $linktext = substr_replace ($linktext,'',-4); echo LIA HREF=\$file\$linktext/A\n; } for($i = 0; $i $p; $i++) { //something here } echo /UL\n; return true; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Tell me how I can...
How can I control the number of users? I want to create a DB driven website where users create their own user accounts. But with a limitation of the number of accounts, and when the maximum is reached, no one can create a new account. I even want to limit the lifetime of an account. It may be explained in the mysql documentation, but I can't find it (and I'm very much a newbie in this field). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Tell me how I can...
Thank you guys. I think I can solve one of my problems now. What about the time limit? Gijs Herpers [EMAIL PROTECTED] skrev i meddelandet 002e01c2448d$1a9d7740$[EMAIL PROTECTED]">news:002e01c2448d$1a9d7740$[EMAIL PROTECTED]... It is better to check how much entries you have in your database with mysql_num_rows in my opinion. It looks a lot easier thean whats described below. - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: 'Øystein Håland' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, August 15, 2002 8:50 PM Subject: RE: [PHP] Tell me how I can... [snip] How can I control the number of users? I want to create a DB driven website where users create their own user accounts. But with a limitation of the number of accounts, and when the maximum is reached, no one can create a new account. I even want to limit the lifetime of an account. It may be explained in the mysql documentation, but I can't find it (and I'm very much a newbie in this field). [/snip] Control it with your user account creation form and either a text file with a number or a table containing number information. In form $max_users = 50; file://get info from data table or text file if($current_number $max_users){ file://when this registration is done $current_number++; } HTH! Jay *** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort Conference Center * * New Braunfels, Texas* * San Antonio Area PHP Developers Group * * Interested? Contact [EMAIL PROTECTED] * *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] limit the number of users: query syntax?
I want to limit the number of users from different groups allowed to create a user account on a website. I belive that can be done using two tables in a DB, one for the user accounts and one for the group information (with one field 'maxusers'). I even want to limit the time for the account to be valid. This can't be too hard to accomplish, but I'm new to mysql, so help would be appreciated. (Yes, I have tried to read the mysql-manual, but when you don't know what to look for that can be really hard) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] show_source()
This helped on my laptop (win2000, Apache 1.3.26, php 4.2.1, but when I uploaded to my webserver (SunOS (sparc), Apache 1.3.xx, php 4.0.6) only the first row was numbered (yes, I even tried \n instead). Is there another solution that could work? Rasmus Lerdorf [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED]... So just replace \r then. And use str_replace() instead of ereg_replace(). -Rasmus On Thu, 8 Aug 2002, Øystein Håland wrote: I use the following script found at php.net: htmlbodyolli ? ob_start(); show_source( THE_FILE! ); $t = ob_get_contents(); ob_end_clean(); echo ereg_replace( br / , /lili , $t ); ? /li/ol/body/html Since the ereg_replace don't work with my php-code i just do echo $t; instead. What I want is to do something like this: echo ereg_replace( \r\n , /lili , $t ); (my files are created in a win2000-environment), but this gives the linenumber only for the first line. Anyone see a solution to this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I show the sourse code?
I have seen on some of the script-sites around some nice ways of presenting the source code. Often in nice colors. So, the natural question is: how is that done (cause I don't think anyone has the patience to put lt; and gt; around all the ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I validate input using php?
I've tried a function like this: function validate() { // if ( is_numeric($input1) is_numeric($input2) ctype_alpha($input3) ctype_alpha($input4) ) return true; } And then I call the function: if (validate() == false) { some action; } My problem is I get the action every time, even though the input is of the right type. And, is ctype_alpha() the only way to check for only alphabetic characters? And (this started with one question), anyone got a good solution on validating email-adresses with php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php