[PHP] Re: Need To Find A php Person
Hello, I'm likely the person you're looking for. My name's Rija I live in Vanuatu, and I teach IT and computer science for the MontMartre High School. I'll give you some of the best website I've done: - trano-bongo.com - evelyneproducts.com - vanua2.com - madeinpacific.com Also, I've done plenty static websites. For further information contact me at this e.mail address : [EMAIL PROTECTED] Michael McGlaughlin [EMAIL PROTECTED] a écrit dans le message : [EMAIL PROTECTED] Hello, I am looking for someone well versed and established who understands the php language and who can support a product that I have that I cannot receive support from by the original developer. What would be the best way for me to go about finding someone? We paid the developer by making a donation to him for his script, then paid him for some further customizations, which he completed, but now he does not appear interested in additional cusomization work on our system and I am left in a bit of a lurch. Any help you can give would be greatly appreciated. Sincerely, Michael _ Get your FREE email address http://www.hootingowl.com The Wise Way To Search _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test
test -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I install PHP 4.2.3 and Apache on WIN98 ?
I want to run php 4.2.3 on Windows 98 2nd edition using apache server, but after installing apache on it, I've got the following message, No service installed. So how can I install it? Then, I also cannot install php. Any thought? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] http_get_var and isset() not working with script generated includes.
Yep, You need make global every variable used in yout include. Maybe, you should declare- GLOBAL $_GET ; or do not call function to include your include just do simply like this, foreach ($sections as $key = $value) include mod.section. . $value . .php; - Original Message - From: Moo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 15, 2002 7:55 AM Subject: [PHP] http_get_var and isset() not working with script generated includes. I wrote a bug report but [EMAIL PROTECTED] bogusified my report without the least bit of information. My script uses multiple includes and the file names all have the same syntax. So instead of writing each individual include, I created an array which contains all the filenames function LoadSections($sections) { foreach ($sections as $key = $value) { include mod.section. . $value . .php; } } instead of writing include file_x; include file_y; and so on All the files load well except that I cannot access HTTP_GET_VARS and the isset() function always return false (when they are inside the included files). NB My includes work fine when loaded individually -- 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] is this not possible?
- Original Message - From: Jeff Bluemel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 8:39 AM Subject: [PHP] is this not possible? I'm been ignored on this question for 4-5 days now. even if it is not possible could somebody please verify this? is it possible to pass a variable from javascript directly to php WITHOUT using either a link, or a form submit to pass the variables? I've gotten a work around to call an image that's actually a php file, but run my script, and then return an image file. Try Header refresh or some java applet to send javascript variable without user click something. is this the only way? -- 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] IMAP_mailboxcreate problem
What does this imap_errors() mean : mailbox is empty I tried to create new mailbox using this simple script: if (!imap_createmailbox($mbox, imap_utf7_encode({192.168.0.1:110/pop3}INBOX.$newname))) echo Impossible de créer une nouvelle boîte aux lettres :.implode(br\n,imap_errors() ) ; Thanks in advance.
[PHP] PHP 4.2.3 on Apache 2.0.39
Hi Guys I'm installing PHP 4.2.3 on Apache Server 2.0.41. If I try localhost or localhost/manual it work perfectly, Now I want to run my php program, I developed on IIS 5.0 environment, on my new Apache server I get the message below , and my browser display HTTP 400 - BAD request page, which means The page cannot be found although all the files are there. [Mon Nov 18 11:04:28 2002] [error] [client 127.0.0.1] Invalid URI in request GET /domains/home.php HTTP/1.1, referer: http://localhost/domains/ I put these few line in my httpd.conf a.. ScriptAlias /php/ c:/php/ b.. AddType application/x-httpd-php .php .phtml c.. Action application/x-httpd-php /php/php.exe
Re: [PHP] Write file can't work ?!? :-(
Try to change write permission doing like the following: - Right click on the folder - Select proprieties - Click on security icon - And allow everyone to write, read, execute If you cannot access this tools, ask your administrator to allow you to do this work. - Original Message - From: Ivan Marenic [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 18, 2002 7:21 AM Subject: Re: [PHP] Write file can't work ?!? :-( Here is IIS permisin setting. Watch attachment. Thanks for help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] returning unique values in columns
GROUP BY column ??? For example if you want the count(*) of each value do like this SELECT column, count(*) from 'tablename' GROUP BY column ; - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 15, 2002 8:17 AM Subject: [PHP] returning unique values in columns Is there any way to run a query in mysql that retuns unique values in a column? For example, say i had this colum: Column: - Fashion - Basics - Fashion - Plus Plus - but I only want it to return unique values - in this case I would only want Fashion, Basics, Plus - instead of the Fashion, Basics, Fashion, Plus, Plus I would get if I had run: SELECT column FROM tblname; any help would be greatly appreciated... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing duplicates in multi-dimensional array
You can also create new uni dimensional array with key like this '0-1' and run array_unique and after come back to myarray for example [UNTESTED] foreach ($myarray as $key1 = $value) foreach($value as $key2 = $value2) $new_array[$key1-$key2] = $value2 ; unset($myarray) ; $new_array = array_unique($new_array) ; foreach($new_array as $key = $value) if (ereg(([0-9])-([0-9]), $key, $reg) $myarray[$reg[1]][$reg[2]] = $value ; - Original Message - From: René Fournier [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Friday, November 15, 2002 7:31 AM Subject: [PHP] Removing duplicates in multi-dimensional array I'm finding this one hard to approach... I have a two-dimensional array, containing customer contact information. Looks like: $myarray[0][0] = Microsoft; $myarray[0][1] = Bill; $myarray[0][2] = 123-1234; $myarray[1][0] = Apple; $myarray[1][1] = Steve; $myarray[1][2] = 456-1234; $myarray[2][0] = Oracle; $myarray[2][1] = Larry; $myarray[2][2] = 987-4321; $myarray[3][0] = Pixar; $myarray[3][1] = Steve; $myarray[3][2] = 456-1234; What I want to do is remove records that have the same fax number, so that each fax number occurs only once. For example, $myarray[1][2] and $myarray[3][2] are the same--I would like to remove/unset one of them. I know that array_unique() will do this for one-dimensional arrays, but I'm kinda stuck here, since the repeating element is in the second dimension. Any ideas how I might do this? Thanks. ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- 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] PROBLEMS
Try to put this at the top of your script- ?php file://require comun.inc; para llamar a la conexion mejor poner include file://include array.inc para funciones de array $conexion = mysql_connect(localhost, root); mysql_select_db(bd1, $conexion); ? /// SCRIPT /// html headtitle/title/head - Original Message - From: Ysrael Guzmán [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 15, 2002 9:00 AM Subject: [PHP] PROBLEMS THIS IS MY SCRIPT: AND THE ERROR IS Warning: Cannot send session cache limiter - headers already sent (output started at c:\foxserv\www\t-demo1\pedidos\prod_mostrar_tipo.php:4) in c:\foxserv\www\t-demo1\pedidos\prod_mostrar_tipo.php on line 5 /// SCRIPT /// html headtitle/title/head body topmargin=0 leftmargin=0 ?php session_start(); if(!session_is_registered(camion)) DIE(error); ? target=tipo p ?php file://require comun.inc; para llamar a la conexion mejor poner include file://include array.inc para funciones de array $conexion = mysql_connect(localhost, root); mysql_select_db(bd1, $conexion); ? div align=left table width=350 border=1 bordercolor=white tr td table width=350 border=1 bordercolor=white ?php echo $codigo; // función que determina si un determinado valor coincide con // un elemento que pertenece al array que se pasa como parámetro // file://function esta_en_array($objetos, $elemento) // { // $i = 0; // $encontrado = false; // while (($i count($objetos)) !$encontrado) // { // while($elemento = each($objetos[$i])) // { // $encontrado = ($objetos[$i] == $elemento); // $i++; // } // } // return $encontrado; // } // $consulta = select * from productos where prod_cod = '$codigo'; $rta = mysql_query($consulta, $conexion); $num_filas = mysql_num_rows($rta); $num_campos = mysql_num_fields($rta); file://echo $num_filas; while($filas = mysql_fetch_array($rta)) { $codigo = $filas['prod_cod']; $nombre = $filas['prod_descripcion']; $precio = $filas['prod_precio']; echo tr; echo td bgcolor='red'; echo bfont color='white' face='verdana' size=2, $filas['prod_descripcion'], /b; echo /font/td; echo /tr td; echo FORM METHOD='Post' ACTION='guardar_array.php'\n; echo tr; echo td bgcolor='white'; file://echo INPUT TYPE='Checkbox' NAME=tabla[] VALUE='$filas['prod_cod']'; echo INPUT TYPE='text' NAME='cantidad'; // if (esta_en_array($camion, $cantidad)) // { // echo VALUE='$cantidad' size='15'; // } //else // // $cantidad = 0; // echo VALUE='$cantidad' size='15'; //} // echo ; echo INPUT TYPE='Hidden' NAME='codigo' VALUE='$codigo'\n; echo INPUT TYPE='Hidden' NAME='nombre' VALUE='$nombre'\n; echo INPUT TYPE='Hidden' NAME='precio' VALUE='$precio'\n; // echo INPUT TYPE='Hidden' NAME=' , session_name() , //' VALUE=' , session_id() , '; // echo /td; echo td bgcolor='white'; echo INPUT TYPE='Submit' VALUE='Añadir'\n; echo /td; echo /tr; echo /FORM; echo tr; echo td bgcolor='white'; echo centerimg src=, $filas['prod_ruta_foto_l'], /center; echo /td; echo /tr; echo tr; echo td bgcolor='#cc' width='100%'font face='verdana' size=2; echo BCODIGO: /B/fontfont color='red' face='verdana' size=2, $filas['prod_cod'], br\n; echo /font/td; echo /tr; echo tr; echo td bgcolor='#f3f3f3' width='100%'font face='verdana' size=2; echo BPRESENTACION: /B/fontfont color='red' face='verdana' size=2, $filas['prod_presentacion'], br\n; echo /font/td; echo /tr; echo tr; echo td bgcolor='#cc' width='100%'font face='verdana' size=2; echo BFABRICANTE: /B/fontfont color='red' face='verdana' size=2, $filas['prod_fabricante'], br\n; echo tr; echo td bgcolor='#f3f3f3' width='100%'font color='black' face='verdana' size=2; echo BDESCRIPCION: /B/fontfont color='red' face='verdana' size=2, $filas['prod_propiedades'], br\n; echo /font/td; echo /tr; } echo /table; ? /td /tr /table /div ?php mysql_free_result($rta); mysql_close($conexion); ? /body Ysrael Guzmán Meza -Mensaje original- De: BigDog [mailto:bigdog;venticon.com] Enviado el: Jueves, 14 de Noviembre de 2002 09:54 a.m. Para: [EMAIL PROTECTED] Asunto: RE: [PHP] PHP Auth with Apache You are sending the header information to the browser before the session stuff begins... make sure that you call session_start(); right after your ?php start tag... On Thu, 2002-11-14 at 21:50, Ysrael Guzmán wrote: I have a problem, i'm new in PHP It is the problem in my browsegive me the solution please Warning: Cannot send session cache limiter - headers already sent (output started at
Re: [PHP] Drop down list with date
Try this one: echo select ; for ($d=0 ; $d 7 ; $d++) echo option onchange=\javascript:document.location.href='link'\.date(d/m/y, strtotime(+$d day)).\n ; echo /option /select ; - Original Message - From: Miguel Brás [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 4:15 AM Subject: [PHP] Drop down list with date Hello guys, I have a question: How can I create a drop down menu where the choices are the days of the month, displaying always the next 7 days? What I mean is, create a drop down menu and show the today's date, next day, and next... Example: Today is 12th, then the menu shows the following option to be choosen 12/11/02 13/11/02 14/11/02 15/11/02 16/11/02 17/11/02 18/11/02 Tomorrow 13th will display 13/11/02 14/11/02 15/11/02 16/11/02 17/11/02 18/11/02 19/11/02 and so on... Thx Regards Miguel -- 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] Query problem
$query = INSERT INTO mararegistro (visitorid, fname, lname, borndate, address, city, country, phone, how) VALUES (null, 'c', 'c', '12', 'c', 'c', 'c', '12', 'c'); I think you should put quotes around all of these values 12 exept null or change null to '' /// - Original Message - From: Cesar Aracena [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 8:27 AM Subject: [PHP] Query problem Hi all, I came back from vacations and forgot some things about queries... can anyone tell me what is wrong with this? of all the error messages I set up in the script, none comes back on the page but the record is not saved... ? $db = mysql_connect(www.icaam.com.ar, icaam, ); if (!$db) { die(No se pudo abrir la base de datos); } $ok = mysql_select_db(icaam); if(!$ok) { die(No se pudo acceder a la base de datos); } $borndate = $bornd . $bornm . $borny; $phonenumber = $phone; $query = INSERT INTO mararegistro (visitorid, fname, lname, borndate, address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c', 'c', 12, 'c'); $result = mysql_query($query) or die (mysql_errno()); if (mysql_affected_rows() != 1) { die(Fallo al guardar datos); } echo Gracias por administrarnos su información.; ? Any thiughts? Thanks in advance, Cesar -- 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] Query problem
error_reporting() ; 1 E_ERROR 2 E_WARNING 4 E_PARSE 8 E_NOTICE 16 E_CORE_ERROR 32 E_CORE_WARNING 64 E_COMPILE_ERROR 128 E_COMPILE_WARNING 256 E_USER_ERROR 512 E_USER_WARNING 1024 E_USER_NOTICE - Original Message - From: Cesar Aracena [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 9:35 AM Subject: Re: [PHP] Query problem The problem is that I have a remote rented server and I don't have access to these configurations any other ideas are welcome. Thanks any ot - Original Message - From: BigDog [EMAIL PROTECTED] To: Cesar Aracena [EMAIL PROTECTED] Cc: PHP General [EMAIL PROTECTED] Sent: Tuesday, November 12, 2002 11:51 AM Subject: Re: [PHP] Query problem In your php.ini file you can turn on all the errors have have them displayed... I would suggest doing that and you should see some errors if there are any. Have you verified that dates in the database via mysql command line or gui application. On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote: Hi all, I came back from vacations and forgot some things about queries... can anyone tell me what is wrong with this? of all the error messages I set up in the script, none comes back on the page but the record is not saved... ? $db = mysql_connect(www.icaam.com.ar, icaam, ); if (!$db) { die(No se pudo abrir la base de datos); } $ok = mysql_select_db(icaam); if(!$ok) { die(No se pudo acceder a la base de datos); } $borndate = $bornd . $bornm . $borny; $phonenumber = $phone; $query = INSERT INTO mararegistro (visitorid, fname, lname, borndate, address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c', 'c', 12, 'c'); $result = mysql_query($query) or die (mysql_errno()); if (mysql_affected_rows() != 1) { die(Fallo al guardar datos); } echo Gracias por administrarnos su información.; ? Any thiughts? Thanks in advance, Cesar -- .: B i g D o g :. -- 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] Problem with sessions
maybe you should remove the dot before the session path or do like this : session.save_path = C:\PHP\sessions\tmp - Original Message - From: Charlie Fowler [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 10:19 AM Subject: [PHP] Problem with sessions Hi all,, Can some one help me with this little issue ... I am trying out some prewritten scripts curtesy of SAMS PHP and MYSQL Web Development, Ch24 - User Authenication Personalisation on my server setup The Configuartion for my development environment is Apache 2.39, Win 2000, PHP 4.2.3 The Ini file has the following session settings (as taken from PHPInfo.php): session Session Support enabled Directive Local Value Master Value session.auto_start Off Off session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path .c:/php/sessions/tmp .c:/php/sessions/tmp session.serialize_handler php php session.use_cookies On On session.use_trans_sid 0 0 The error occurs after the registration page is submitted with the following using the function session_start() on the register page.: Warning: open(.c:/php/sessions/tmp\sess_fa42372dcdbde0e457309f134d71827f, O_RDWR) failed: Invalid argument (22) in C:\Program Files\Apache Group\Apache2\htdocs\SAMS\Chapter24\member.php on line 5 I believe the problem is in my PHP setup and not the script. The Invalid arguement is the trigger for the config error to be initaited but I am not sure how to edit the php.ini file. I want to ensure that session are started when the server is started. I am also unsure of the function and terminology of session.save_handler files files with the use of files. Is this the correct default. Also is this the correct session save path: session.save_path .c:/php/sessions/tmp .c:/php/sessions/tmp What is wrong, please help. Charlie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying to e-mail password
You should do like this: $password = $row['password']; This return weird crypted value of your password. Unless you want send the this weird password. The function mysql_password is irreversible, you cannot get back the value crypted by password. Use ENCODE and DECODE instead, - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 11:09 AM Subject: [PHP] Trying to e-mail password I am trying to have a form that send a user their email and password to login. I am using the following: while ($row = mysql_fetch_array($result)) { $email = $row['email']; $password = $row['password(password)']; When I use the mail() function to send both $email and $password I receive an e-mail with a blank password. What am I doing wrong. Please help! -- 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] Trying to e-mail password
ENCODE(value, 'secret code') DECODE(field name, 'secret code') to record ... VALUES ( ... blahblah, ENCODE('$passord', 'secret code', ... BLAH BHAL) ; and to read the value do like this MYSQL_QUERY(SELECT DECODE(password, 'secret code') as password, id, BLAH BLAH - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 12:07 PM Subject: Re: [PHP] Trying to e-mail password Is there not any way to reverse the crypted password before e-mailing?? If not, how do I use ENCODE / DECODE? From: rija [EMAIL PROTECTED] Date: 2002/11/12 Tue PM 07:32:28 EST To: php [EMAIL PROTECTED], Ben C. [EMAIL PROTECTED] Subject: Re: [PHP] Trying to e-mail password You should do like this: $password = $row['password']; This return weird crypted value of your password. Unless you want send the this weird password. The function mysql_password is irreversible, you cannot get back the value crypted by password. Use ENCODE and DECODE instead, - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 11:09 AM Subject: [PHP] Trying to e-mail password I am trying to have a form that send a user their email and password to login. I am using the following: while ($row = mysql_fetch_array($result)) { $email = $row['email']; $password = $row['password(password)']; When I use the mail() function to send both $email and $password I receive an e-mail with a blank password. What am I doing wrong. Please help! -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying to e-mail password
I don't think so, data stored as plain text is almost stored intact in the file system. Using stupid windows for example, you can easily open mysql file table.MYD in the folder database with NotePad, and you can read everything. Which means, everybody without any hacking knowledge can access to user's password and mailbox stored in your site, since he had access to the system folder. And if you have rented server it is recommanded to crypt strategic data. - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: [EMAIL PROTECTED]; 'php' [EMAIL PROTECTED]; 'Ben C.' [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 2:05 PM Subject: RE: [PHP] Trying to e-mail password If you want an email password feature, then just store it as plain text. If someone is able to get access to your database, that means they more than likely have access to the rest of your box, so your 'secret code' is worthless. ---John Holmes... -Original Message- From: rija [mailto:rija;vatu.com] Sent: Tuesday, November 12, 2002 9:37 PM To: php; Ben C. Subject: Re: [PHP] Trying to e-mail password ENCODE(value, 'secret code') DECODE(field name, 'secret code') to record ... VALUES ( ... blahblah, ENCODE('$passord', 'secret code', ... BLAH BHAL) ; and to read the value do like this MYSQL_QUERY(SELECT DECODE(password, 'secret code') as password, id, BLAH BLAH - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 12:07 PM Subject: Re: [PHP] Trying to e-mail password Is there not any way to reverse the crypted password before e-mailing?? If not, how do I use ENCODE / DECODE? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying to e-mail password
Okay, so why are you giving users read access to the mysql data folder? They can also open up your .php file and find your secret code. I think, it is good discussion, so I try to go deeper to it, because we need improve security. And I hope another people to join this. Since I don't have my own server, I have to buy external hosting service maybe in Costa Rica or in Panama or in South Africa, so I don't know who are going to administrate my site first? Whoelse can have access to the system. I don't know how safe is it? I just bought it because it was cheap, or simply it was in my way. And suppose some hacker is entered to the server, because he would like hack the server not my user's mailbox. Surprise, he found plenty of address email with its password. Really cool Using ENCODE and DECODE with protected 'secret code' help you to improve your security and user's security. And you don't lost anything doing this, on the contrary, it is a good marketing arguments, like as your system (site) is more safe than other and user could fell in. It won't hurt anything to encode it in the database, but just don't get this overwhelming sense of security and think everything is safe. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form with two actions
If you want php to do it in the remote server (your case), of course, you do not have to use javascript // Just do like this if (isset($_POST['submit'])) // to verify that browser are sending something correctly { // -- record posted data into database and after // -- send mail } But if you want 2 actions in the client-side browser, you should use javascript, for example you want first to check data and simultaneously, display progress bar (animated gif), like this onsubmit=return(send_data(document.form)); and the on the function send_data() you have 1. do action 1 2. do action 2 3. return true - Original Message - From: Scott [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 4:05 PM Subject: [PHP] form with two actions Hello I would like to know if it is possible to use Php to make a form perform 2 actions by having the user click on a single submit button. For instance, send data to a database and email it simultaneously. I would prefer not to use javascript. If someone could point me to an example I would appreciate it Thanks, S.W. -- 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] Submit hitting enter problem
What am I missing? My form does not submit when I hit enter in the text box. I do something approximately like this : form action=index.php?s=add method=post input type=text name=bongabe value=something ... input type=submit value=submit name=submit // Thanks in advance.
Re: [PHP] mysql DECODE question
SELECT DECODE(ENCODE('password', 'sec'), SUBSTRING(secret,1,3)); if you put quotes around substring function, mysql considere it as a string, so I think you shouldn't. After, are you sure that the correct table field name is the weirdthing encoded by this function : ENCODE('password', 'sec') ??? if so, show us, the script that allow you to record the password ? - Original Message - From: Donahue Ben [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 11, 2002 11:13 AM Subject: [PHP] mysql DECODE question SELECT DECODE(ENCODE('password', 'sec'), 'sec') - password When I try: SELECT DECODE(ENCODE('password', 'sec'), 'SUBSTRING(secret,1,3)'); or without quotes around SUBSTRING function This does not produce the same output, i am not sure what the problem is. Ben __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- 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] Submit hitting enter problem
Thanks for your quick answer, But it doesn't change anything. textarea change my text box into big text area- So I always have to click on submit button to submit the form. - Original Message - From: Justin French [EMAIL PROTECTED] To: [EMAIL PROTECTED]; php [EMAIL PROTECTED] Sent: Monday, November 11, 2002 3:45 PM Subject: Re: [PHP] Submit hitting enter problem on 11/11/02 12:44 PM, rija ([EMAIL PROTECTED]) wrote: input type=text name=bongabe value=something I think you need to use a textarea if you wish for the returns to be submitted. Cheers Justin French Creative Director http://Indent.com.au Web Developent Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submit hitting enter problem
Sure ! But just simple question? Is it necessary to put quotes around these attributes values? Because I think quotes increase the site size, and using IE4, IE5, IE6, NS4, OPERA, quotes don't change anything. Of course if I have somethings with space, for value's attribute, It is important to put quote because sometimes users enter space. - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 11, 2002 3:33 PM Subject: Re: [PHP] Submit hitting enter problem What happens when ENTER is pressed depends on what browser you're using. Different browsers exhibit different behaviours, eg the old versions of Netscape (v4 and before) does not submit on ENTER. Also, put quotes around your attribute values eg: input type=text name=bongabe value=something -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The more I know men the more I like my horse. */ -- 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] Submit hitting enter problem
Really big thank to everybody, But, now, I know what happening, because I check form submit using isset($_POST['submit']), so if user don't press submit button, $_POST['submit'] stay null even the rest is already sent. Then my script send me back to the first page. - Original Message - From: Justin French [EMAIL PROTECTED] To: [EMAIL PROTECTED]; php [EMAIL PROTECTED] Sent: Monday, November 11, 2002 4:28 PM Subject: Re: [PHP] Submit hitting enter problem on 11/11/02 2:16 PM, rija ([EMAIL PROTECTED]) wrote: Actually, I miss-read your question... do you WANT the form to be submitted when hitting return/enter??? And you find that this is not happening when you are in a text field??? Correct? This is a browser thing... I don't *think* there's anything in the standards to say when hitting enter should/shouldn't work -- i think it's something that each browser will do differently. There may be something you can do with javascript. Perhaps check out: http://www.w3.org/TR/1998/REC-html40-19980424/interact/forms.html Or find a similar form example on another site, and dig around thru the code to have a look how they did it. Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regular expression and exact word search...
How about this one, $word_search = 'blablabla' ; echo eregi_replace(($word_search),b\\1/b,$html) ; // - Original Message - From: BAROILLER Pierre-Emmanuel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 08, 2002 2:42 AM Subject: [PHP] regular expression and exact word search... Hi! does someone know how to find an exact word in a content with html tags ? I'm using a regexp like this : $searchRegEx = '\b.$word_search.\b'msi; to get boundary word results, but... if the searched word is like 'word or word. or anything else, the regular expression doesn't work.. if I remove the \b , I've got all words ( but without bound...) Any idea? (the big problem is I'm higlighting found sentences, and .. if the searched word is part of an html tag, it's very auwfull... ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MYSQL and PHP Storing and retrieving images getting corrupted
Have you tried out mysql function load_file() to upload directly your file into the database without passing through php variable ? Like this: $result=MYSQL_QUERY(INSERT INTO master_products (image_thumbnail,image_thumbnail_name,image_thumbnail_size,image_thumbnail_t ype) VALUES (load_file('$form_data'),'$form_data_name','$form_data_size','$form_data_typ e')); If you are not allowed to upload directly $form_data using mysql load_file(), move first the file $form_data into another allowed directory with valid filename and try again. Finally, storing image or binary file into database is not good, put them into directory instead. - Original Message - From: Darren McPhee [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 11:24 PM Subject: [PHP] MYSQL and PHP Storing and retrieving images getting corrupted I have written 2 programs (which are very common PHP programs) that A) Allows me to upload image files into a MYSQL database using a simple form. And B) Allows me to retrieve and display the image using a PHP script. This is my problem:- I can upload the images ok. I store the binary code, image type, name, and size within the MYSQL database. On checking the database directly using DBTools, I can see that the files have uploaded. The file sizes reflect exactly what was originally on the hard disk of my PC (not sure if this is a correct gauge). When I run my PHP program to display the images, maybe only 1 out of 10 actually displays correctly. The rest are broken up or non displayable images. One image even made a prompt window appear and somehow now causes Windows paint to load the image instead of the browser. God only knows how that occurred !! Below are my (designed by others) 2 programs. The first program is the upload form. This seems to work ok. HTML HEADTITLEStore binary data into SQL Database/TITLE/HEAD BODY ?php // code that will be executed if the form has been submitted: if ($submit) { // connect to the database require_once('../../Connections/TestServer.php'); mysql_select_db($database_TestServer, $TestServer); $data = addslashes(fread(fopen($form_data, r), filesize($form_data))); $result=MYSQL_QUERY(INSERT INTO master_products (image_thumbnail,image_thumbnail_name,image_thumbnail_size,image_thumbnail_t ype) . VALUES ('$data','$form_data_name','$form_data_size','$form_data_type')); $id= mysql_insert_id(); print pThis file has the following Database ID: b$id/b; MYSQL_CLOSE(); } else { // else show the form to submit new data: ? form method=post action=?php echo $PHP_SELF; ? enctype=multipart/form-data INPUT TYPE=hidden name=MAX_FILE_SIZE value=100 brFile to upload/store in database:br input type=file name=form_data size=40 pinput type=submit name=submit value=submit /form ?php } ? /BODY /HTML Here is the code to display the image:- ?php if($id) { require_once('../Connections/TestServer.php'); mysql_select_db($database_TestServer, $TestServer); $query = select image_thumbnail,image_thumbnail_type from master_products where item_id=$id; $result = @MYSQL_QUERY($query); $data = @MYSQL_RESULT($result,0,image_thumbnail); $type = @MYSQL_RESULT($result,0,image_thumbnail_type); Header( Content-type: $type); echo $data; }; ? I run the above program in the following way: http://192.168.0.11/htdocs/displayimage2.php?id=9 The ID is the item_id primary key field for whichever record I want to display. I have tried these programs on a test server here in my room to a test Apache server and MYSQL test database, and also from my ISP to a MYSQL database at a server at my ISP. I get exactly the same problem. When I run the display image program, the images being displayed are always being displayed the same. Which points the problem towards the upload process (maybe). If anybody can tell me what the heck is wrong here, I'll give them a medal !! There is basically some kind of binary corruption going on (it looks like) For added information, below is my database table structure. At the moment, the only part I am actually using relates to the image_thumbnail sections. Darren. CREATE TABLE master_products ( item_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, item_code VARCHAR (10) UNIQUE, item_dateadded DATETIME DEFAULT '-00-00 00:00:00', item_datemodified DATETIME DEFAULT '-00-00 00:00:00', category ENUM (none,single herbs,general vitality,ageing,arthritis,eyesite,prostate,ahlzheimers, weight loss,menopause,depression,fatigue,headaches,insomnia,colds and flues,allergies, healthy heart,cancer prevention,aphrodisiacs,sexual herbs,for women,for men,books), name VARCHAR (30), name_dateadded DATETIME DEFAULT '-00-00 00:00:00', name_datemodified DATETIME DEFAULT '-00-00 00:00:00', INDEX idx_name (name),
Re: [PHP] Problem with is_dir function
I cannot explain your error message, are you sure that the following error message provide from these lines ? If not, I think your machine is blasted, so find out an exorcist or a witch. Good luck ! - Original Message - From: Roger Lewis [EMAIL PROTECTED] To: Roger Lewis [EMAIL PROTECTED]; Php-General [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 3:41 AM Subject: RE: [PHP] Problem with is_dir function On Saturday, November 02, 2002 11:07 AM, I wrote * I'm having a problem with the is_dir function, or maybe I don't understand how it supposed to work. I'm using the following code to check whether or not a directory called $user_dir exists. If it exists, I am returned the proper message. But if it doesn't exist, I get the following error message that says that it doesn't exist. (I already knew that!) ERROR Number=8 Description=Error: quot;stat failed for /home/sites/home/users/demodocs/web/userforum/user (errno=2 - No such file or directory)quot; on line 175 of /home/sites/home/users/demo/web/user_forum/messages.php./ Can someone please explain what I am doing wrong here, and how to return a usable value if the directory doesn't exist. $test = is_dir($user_dir); if($test){echo You have a user directory. It is $user_dir;} else{echo Your user directory doesn't exist; return;} Thanks a lot. Roger Lewis This is a follow-up to my original posting. * I did not get an answer as to why is_dir does not return a false value; however, file_exists does the job nicely. Thanks for all the suggestions. * Roger -- 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
Re: [PHP] File download + HTTP auth problem.
Simply, HTTP Authentification Header(WWW-Authenticate: Basic realm='something') does not work with microsoft product, so you need to buy Microsoft authentification from Microsoft to do something like it. - Original Message - From: Rodolfo Gonzalez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 6:29 AM Subject: [PHP] File download + HTTP auth problem. Hello, I have this simple script called index.php in a directory protected with HTTP auth (require valid-user): ?php $archivo = '/somewhere/out/docroot/registro.csv'; header('Content-Type: application/octect-stream'); header('Content-Length: '.filesize($archivo)); header('Content-Disposition: attachment; filename=registro.csv'); @readfile($archivo); ? When I access the directory with Netscape/Mozilla/Galeon it works fine, Apache asks the login and password and the script sends the file. But with MSIE 6.x (from Windows XP) it does not work: it presents the download dialog asking to save or open the file, but then MSIE reports an error and does not download the file. I discovered later that Konqueror asks for the login and password again when the download starts. What could be causing this?. Thanks in advance. Rodolfo. -- 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] session cache limiter
I bit you are sending something like as an blank_space before your are sending your header. Show us first your code. - Original Message - From: ROBERT MCPEAK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 6:34 AM Subject: [PHP] session cache limiter Could somebody shed some light on this error message I'm getting. Could you point me at the appropriate docs or clue me in somehow. PHP Warning: Cannot send session cache limiter - headers already sent (output started at /usr/local/httpd/htdocs/mmc/results.php:79) in /usr/local/httpd/htdocs/mmc/includes/display_options.php on line 115 Thanks! -- 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] uploading
Either you put references into your variables $_FILES['userfile']['tmp_name'][0] : move_uploaded_file($_FILES['userfile']['tmp_name'][0], \ufiles) ; or don't put bracket in your variable userfile from your input form like this : input type=file name=userfile - Original Message - From: Edward Peloke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 7:03 AM Subject: [PHP] uploading I am playing with uploading files (hence the array question). I have a simple form: form action=upload.php method=post enctype=multipart/form-data Send these files:br input name=userfile[] type=filebr input type=submit value=Send files /form Which calls a php file that just contains this: copy($_FILES['userfile']['tmp_name'], \ufiles\); This ufiles folder is under my htdocs folder in apache. I have looked through the help files in php.net but am just not getting it today. How do I simply upload the file? I tried to move uploaded file function but can't seem to get that to work alsoany ideas would be greatly appreciated! Thanks, Eddie -- 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] Using info from a MySQL Query
Put your variables into {} like this '{$_POST['email'] }', $sql =SELECT company, name, email FROM $table_name WHERE email = '{$_POST[email]}' AND password = password('{$_POST[password]}'); - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:09 PM Subject: [PHP] Using info from a MySQL Query I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. -- 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] Using info from a MySQL Query
Sorry, I didn't read correctly the question- There are plenty way to do it for example : $query = mysql_query($sql) ; $ligne=mysql_fetch_array($query) ; echo $ligne['company'] ; echo $ligne['email'] ; or echo mysql_result($query,0,1); - Original Message - From: rija [EMAIL PROTECTED] To: php [EMAIL PROTECTED]; Ben C. [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 1:34 PM Subject: Re: [PHP] Using info from a MySQL Query Put your variables into {} like this '{$_POST['email'] }', $sql =SELECT company, name, email FROM $table_name WHERE email = '{$_POST[email]}' AND password = password('{$_POST[password]}'); - Original Message - From: Ben C. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:09 PM Subject: [PHP] Using info from a MySQL Query I am using the following query: $sql =SELECT company, name, email FROM $table_name WHERE email = '$_POST[email]' AND password = password('$_POST[password]'); Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. -- 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] Regular expression problem
Hi Guy and Gay ? I have the following code supposed to transform date format like this 04 desambra 1975 into 1975-12-04. User can use whatever language he want like french, english, malagasy even Bichlamar- for example : 04, otis 1975 = 04 aout 1975 = 04 aogositra 1975 = 04-août 1975 = 04 august 1975 = 04 aug 1975 and the function must return 1975-08-04 It work perfectly and I'm really happy while I don't use minus (-) and If I use it, the function stop working. So how can I use minus in the regular expression ? function my_date($birthday) { $birthday = strtolower($birthday) ; $array_search2 = array( '[âäàåÄÅáæÆ]'i, '[éêëèÉ]'i, '[üûùÜú]'i, '[ïîìí]'i, '[ôöòÖó]'i) ; $array_replace2 = array(a, e, u, i, o) ; $array_search = array('jan[a-zA-Z]{0,10}'i, 'fe[vb]{1}[a-zA-Z]{0,10}'i, 'm[a]{1,2}r[a-zA-Z]{0,10}'i, 'a[vp]{1}r[a-zA-Z]{0,10}'i, 'ma[iy]{1}[a-zA-Z]{0,10}'i, 'j[ou]{1}n[a-zA-Z]{0,10}'i, 'j[uo]{1}l[a-zA-Z]{0,10}'i, '[ao]{1}[out]{1}[a-zA-Z]{0,10}'i, 'sept[a-zA-Z]{0,10}'i, 'o[ck]{1}t[a-zA-Z]{0,10}'i, 'n[o]{1,2}v[a-zA-Z]{0,10}'i, 'de[sc]{1}[a-zA-Z]{0,10}'i ) ; $array_replace = array( 01, 02, 03, 04, 05, 06, 07,08,09,10, 11, 12 ) ; $birthday = preg_replace($array_search2, $array_replace2, $birthday) ; $birthday = eregi_replace(([0-9]{1,2})[\-_:\|/, ]+([a-zA-Z0-9]{1,})[\-_:\|/, ]+([0-9]{2,4}),\\3-\\2-\\1, $birthday) ; $birthday = preg_replace($array_search, $array_replace, $birthday) ; return $birthday ; } echo my_date(12, janoary- 2001) ; // return 12, 01- 2001 (bad) and echo my_date(12, januaari,\\__ 2001) ; return exactly what I want ie 2001-01-12
Re: [PHP] How do I convert an array into a mask?
Why don't you ask Jim Carrey ??? He knew more that whoever here about The MASK !!! Good luck. - Original Message - From: Daevid Vincent [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 3:56 PM Subject: [PHP] How do I convert an array into a mask? Does anyone know of a nice efficient way to convert an array of values into a mask... Here's the deal. Given an array such that: $purchitem[0] = 1; $purchitem[1] = 3; $purchitem[2] = 4; I want to end up with a variable like this: $mask = 10110; Additionally, my theory is that then the person purchases another book later $purchitem[0] = 2; My new mask should be $purchmask = 01000; Then I can load their previous mask from the database and boolean OR it with the new mask to set the correct permissions. i.e. $newmask = $mask | $purchmask; Or ideally = 0 Can I boolean OR strings like that in the way I 'hope' it will work? Do I need to convert it to an intermediate stage or cast it or anything? Does this make sense? It's for an online book shopping cart. I have the reverse working, where I can split the mask into what books. And I also have the $purchitem[] working. -- 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] PHP/Flash
Me :-) I wonder if you can post me these scripts - Original Message - From: Clint Tredway [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 8:46 AM Subject: [PHP] PHP/Flash I have a small example of using Flash/PHP if anyone wants it.. Clint -- 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] randomly select file
Why don't you cope with opendir / readdir () and array_rand () I tried it and I look ok- But, I wonder if there are noble another way to do it? - Original Message - From: ROBERT MCPEAK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 8:40 AM Subject: [PHP] randomly select file Could someone suggest some php for randomly selecting a file from a directory and then displaying the contents of the file? Thanks in advance! -- 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] Does anyone know if this is possible?
It depends on where the textfile are going to be store If you store them into unauthorized directory that php does not have the right (or permission) to write in, I think it cannot be done, but if you put down the file into allowed directory, why not? to make column into your text file I think \t is good- - Original Message - From: Raymond Lilleodegard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 5:28 AM Subject: [PHP] Does anyone know if this is possible? Hi! I have made a website with a webshop and the orders are written down in txtfiles and a faxserver is scanning a directory for txtfiles and sends them as faxes. So I am trying to write the txtfile like I should have written the order in a table. Or you can say I am trying to make some columns in the txtfile. Something like this: 1pizzacheese, beef, tomato,5,- ham, bacon etc 2burgerscheese, bacon2,- Best regards Raymond -- 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] Battling with highlighting search criteria
$result = eregi_replace(($search),span class=hightlight\\0/span,$result) ; I use it, and I work fine for me. - Original Message - From: David Russell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 7:27 PM Subject: [PHP] Battling with highlighting search criteria Hi there, My brain has just gone very fuzzy... I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload permission on a web_user space...
Hi Ben, I am not sure to understand exactly what do you want to do. But I am going to try to answer you about something, First, If you need to create your own ftp software using php, check out ftp library (http://www.faqs.org/rfcs/rfc959.html) there are several function about it, and you can allow visitors to upload, download, rename, delete, move files, create directory, rename directory chop directory etc... through 2 differents webservers using ftp parameters like domain (ip), username, password, int port etc... You can also create your own php software to allow user to view, upload, modify and delete files in your webserver from their browser, and you don't need activating ftp library, but you should set up (php.ini): file_uploads to on upload_tmp_dir to your upload directory upload_max_size = 2M or I don't know. -- check out the documentary (Documentary is also available in french.) If you want allow people to see some file from their browser and download it right_clicking and save target as to their computer, there are several possibility, first you can set it up through your webhosting setting (for example for IIS/Windows 2000) you can check on button browse directory- So when visitors write your directory URL, the browser shows every files in your webserver. Secondly, you can also use your own php file to do it using function such as dir(), opendir(), readdir()-- check out the documentary. and it is better to use HEADER() to download files into visitors browser. Well, I hope helping you as I can. - Original Message - From: Benjamin Trépanier [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 12:55 PM Subject: [PHP] Upload permission on a web_user space... Hello, I'm trying again to ask you that question because I was not understand. I have a unix server hosting service, my hosting service allow me to create web_server. Those are create for my client who have to upload differents things. So when people are connecting to my ftp (example on IE...) they can see any folder in their web_user space and can upload stuff in any folder of their level... So the set upload permission is not working... What can I do Is it possible to create a upload page (php) that allow user to see every folder of his web_user space?? Thanks! Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checkboxes and selection lists
If you have hundred thousand elements for example if you rob up for some country select within tierce code- I thinks doing like the following is better echo select optiona optionb ... optionzz option selected$value /option /select ; And I don't care if it could have 2 same value in the select case... And if there aren't many value, I think the following sounds better: echo SELECT CLASS=select NAME=qual OPTION .($qual==A? SELECTED:).A OPTION .($qual==B? SELECTED:).B OPTION .($qual==C? SELECTED:). C/OPTION /SELECT ; - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 5:06 PM Subject: [PHP] checkboxes and selection lists Hi, as a beginner I find the way you declare variables through HTML-forms quite straightforward. But the reverse, to put the same variables back into a form field is not so obvious for selection lists and checkboxes. Would for instance this be the best way: SELECT CLASS=select NAME=qual OPTION VALUE=A ?=if($qual=='A'){return 'SELECTED'}?A/OPTION OPTION VALUE=B ?=if($qual=='B'){return 'SELECTED'}?B/OPTION OPTION VALUE=C ?=if($qual=='C'){return 'SELECTED'}?C/OPTION /SELECT or would there be something more elegant? Thanks, Marco Internet wordt pas leuk als je mee kunt doen. Ga naar http://www.hetnet.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fread() fails with large files
Use readfile instead fread() if you've got some problem with, it looks better! Header(Content-Type: $type); Header(Content-Disposition: attachment; filename=$downloadname); header(Content-Length: $size); header(Content-Transfer-Encoding: binary); readfile($file); - Original Message - From: Sora B. Harbater [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 12:44 AM Subject: [PHP] fread() fails with large files Hi. I am using Linux/Apache with PHP 4.1.2. I have been experiencing this problem since upgrading from an earlier version of PHP 4. My script forces a download of a PDF file after looking up some info in a database. The code looks like this: $file=/path/to/file; $fp = fopen($file, r); $size=filesize($file); $contents = fread($fp, $size); fclose($fp); Header(Content-Type: $type); Header(Content-Disposition: attachment; filename=$downloadname); header(Content-Length: $size); header(Content-Transfer-Encoding: binary); echo $contents; filesize() is reporting the size properly. The code works perfectly for smaller files, but the fread() fails for files larger than 19 MB or so and I got a page cannot be displayed error. I know that it is fread() which is causing the problem because I commented out all the code that follows it and still get the error. All the files being downloaded are PDF files. Can anyone shed some light on this? -- 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] re:[PHP] uploading help please again
You might receive 2 files throught upload, then the first file name should be $_FILES['origem'] ; and the second file name $_FILES['origem2'] ; To use the different variables you can use, peer John Holmes's answer, there aren't no full answer like this anywhere? to ask if file uploaded is ok uploaded_file() is better than you are doing and use move_uploaded_file() instead copy() and unset() ; like this : if (is_uploaded_file($_FILES['origem']) ) move_uploaded_file($_FILES['origem'], $dest) ; /* $path=(dirname($PATH_TRANSLATED))./primeirapagina/; $origem_name=fdx.jpg; $dest= $path.$origem_name; if (($origem none) ($origem )){ if (copy($origem,$dest)){; } else { echo directoria sem direitos de escrita br; } unlink ($origem); } - Original Message - From: 'marcelo' [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 12:46 PM Subject: RE: [PHP] uploading help please again Ok I'm back This script is to upload 2 image files Whit register_globals = on it Works fine script A p.php titleJornal O Leme/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#006699 table width=100% border=0 cellpadding=0 cellspacing=0 !--DWLayoutTable-- tr td width=100% height=70 valign=topimg src=test.jpg width=600 height=120 /td /tr tr td height=262 valign=toppnbsp;/p form method=post action=pi.php enctype=multipart/form-data table width=75% border=0 align=center bgcolor=#FF tr td width=23%div align=centerfont face=BankGothic Md BT /font/div/td td width=77% bgcolor=#FFnbsp; /td /tr tr tddiv align=center/div/td td bgcolor=#FFnbsp; /td /tr tr tddiv align=center/div/td td bgcolor=#FFnbsp; /td /tr tr tddiv align=leftstrongImagem pequena/strong/div/td td bgcolor=#FF input type=hidden name=MAX_FILE_SIZE value=102400 input type=File name=origem /td /tr tr tddiv align=leftstrongImagem grande/strong/div/td td bgcolor=#FFinput type=hidden name=MAX_FILE_SIZE value=102400 input type=File name=origem2 /td /tr tr tddiv align=center/div/td td bgcolor=#FFnbsp; /td /tr tr tdnbsp;/td tdnbsp;/td /tr /table p align=center input name=submit type=submit value=Adicionar input type=hidden name=page value=inserir1 /form/p /td /tr tr td height=81 valign=topdiv align=center pnbsp;/p p ?php include ('menu.php'); ? nbsp;/p /div/td /tr /table pi.php echo $page; --- returns inserir1 _correct echo $origem; --- returns the temp path of the file _correct set_time_limit(60); $path=(dirname($PATH_TRANSLATED))./primeirapagina/; $origem_name=fdx.jpg; $dest= $path.$origem_name; if (($origem none) ($origem )){ if (copy($origem,$dest)){; } else { echo directoria sem direitos de escrita br; } unlink ($origem); } set_time_limit(60); $path2=(dirname($PATH_TRANSLATED))./primeirapagina/; $origem2_name=porra.jpg; $dest2= $path2.$origem2_name; file://printf($path); file://printf(br); file://printf($origem_name); if (($origem2 none) ($origem2 )){ if (copy($origem2,$dest2)){; file://echo brupload do ficheiro $origem_name efectuada com sucesso !!!; // echo brtamanho do ficheiro $origem_size; // echo brtipo de ficheiro $origem_type; } else { echo directoria sem direitos de escrita br; } unlink ($origem2); } ? /body /html but Whit register_globals = off the script B dont work script B: p.php titleJornal O Leme/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#006699 table width=100% border=0 cellpadding=0 cellspacing=0 !--DWLayoutTable-- tr td width=100% height=70 valign=topimg src=test.jpg width=600 height=120 /td /tr tr td height=262 valign=toppnbsp;/p form method=post action=pi.php enctype=multipart/form-data table width=75% border=0 align=center bgcolor=#FF tr td width=23%div align=centerfont face=BankGothic Md BT /font/div/td td width=77% bgcolor=#FFnbsp; /td /tr tr tddiv align=center/div/td td bgcolor=#FFnbsp; /td /tr tr tddiv align=center/div/td td bgcolor=#FFnbsp; /td /tr tr tddiv align=leftstrongImagem pequena/strong/div/td td bgcolor=#FF input type=hidden name=MAX_FILE_SIZE value=102400 input
Re: [PHP] radio buttons from MySQL query?
I don't think so, Put the bracket with your radio's name not with your the value/// For example : print td width=2input type=radio name=gl_acct[] value=$row['acct']{$row['acct']}/td ... and so one/ - Original Message - From: David Jackson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 1:15 PM Subject: [PHP] radio buttons from MySQL query? How do I go about building radio buttons using the results of a MySQL query. The record layout looks like this: acct cat description I want to use acct as the value=acct in the input statement for the radio box. The code below almost works? TIA, David ?php $header = mysql_query (SELECT * FROM chart ORDER BY acct ); if ($row = mysql_fetch_array($header)) { do { print(tr bgcolor=\white\ ); print 'td width=5input type=radio name=gl_acct value=acct[]/td'; print(td width=\12\); print $row[acct]; print /tdtd width=\12\; print $row[cat]; print /tdtd ; print $row[descript]; print(/td/tr\n); } while($row = mysql_fetch_array($header)); } else {print Sorry, no records were found!;} ? -- 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] Error in code - Seems simple enough
This is rather problem about javascript than PHP - But I think that you need to use double quotes (escaped) to distinguish query and variables in your javascript query: Try out this, It work fine for me: if(!isset($HTTP_SESSION_VARS['svUserAccess'])){ echo td class='mainmenu' align='center' width='12.5%' style='cursor:hand' onMouseover=\this.style.backgroundColor='#C0E0FF'\ onMouseout=\this.style.backgroundColor=''\ onClick=\window.location.href='login.php'\a href='login.php'Login/a/td; } else { echo td class='mainmenu' align='center' width='12.5%' style='cursor:hand' onMouseover=\this.style.backgroundColor='#C0E0FF'\ onMouseout=\this.style.backgroundColor=''\ onClick=\window.location.href='logout.php'\a href='login.php'Logout/a/td; wrote in message news:20021104022815.4043.qmail;pb1.pair.com... I'm having trouble with the following code dispalying an error, which I don't understand because the code actually works (other than the error). Any ideas? ? if(!isset($HTTP_SESSION_VARS['svUserAccess'])){ echo td class='mainmenu' align='center' width='12.5%' style='cursor:hand' onMouseover='this.style.backgroundColor='#C0E0FF'' onMouseout='this.style.backgroundColor=''' onClick='window.location.href='login.php''a href='login.php'Login/a/td; } else { echo td class='mainmenu' align='center' width='12.5%' style='cursor:hand' onMouseover='this.style.backgroundColor='#C0E0FF'' onMouseout='this.style.backgroundColor=''' onClick='window.location.href='logout.php''a href='login.php'Logout/a/td; } ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] radio buttons from MySQL query?
oups ... you're right ! - Original Message - From: John Nichel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: php [EMAIL PROTECTED]; David Jackson [EMAIL PROTECTED] Sent: Monday, November 04, 2002 2:57 PM Subject: Re: [PHP] radio buttons from MySQL query? There is no reason to put brackets behind the name of the radio element. The brackets are neccessary for multi-select elements like checkboxes, but radio buttone are a single select element. Your if statement should be a while loop. I'm sure you don't want to set this ( value=acct[] ) as the value for each radio button. Do it that way, and no matter which one is picked, it will be the same value. rija wrote: I don't think so, Put the bracket with your radio's name not with your the value/// For example : print td width=2input type=radio name=gl_acct[] value=$row['acct']{$row['acct']}/td ... and so one/ - Original Message - From: David Jackson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 1:15 PM Subject: [PHP] radio buttons from MySQL query? How do I go about building radio buttons using the results of a MySQL query. The record layout looks like this: acct cat description I want to use acct as the value=acct in the input statement for the radio box. The code below almost works? TIA, David ?php $header = mysql_query (SELECT * FROM chart ORDER BY acct ); if ($row = mysql_fetch_array($header)) { do { print(tr bgcolor=\white\ ); print 'td width=5input type=radio name=gl_acct value=acct[]/td'; print(td width=\12\); print $row[acct]; print /tdtd width=\12\; print $row[cat]; print /tdtd ; print $row[descript]; print(/td/tr\n); } while($row = mysql_fetch_array($header)); } else {print Sorry, no records were found!;} ? -- 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] Global Variables Off
I think your machine is blasted - Find out an exorcist or a witch or move out to other program- - Original Message - From: Paul [EMAIL PROTECTED] To: 'John Nichel' [EMAIL PROTECTED] Cc: 'Chris Shiflett' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, November 04, 2002 3:02 PM Subject: RE: [PHP] Global Variables Off Makes no difference..I tried them both -Original Message- From: John Nichel [mailto:jnichel;by-tor.com] Sent: Sunday, November 03, 2002 10:59 PM To: Paul Cc: 'Chris Shiflett'; [EMAIL PROTECTED] Subject: Re: [PHP] Global Variables Off Try single quotes... $_GET['test'] Paul wrote: I am passing it via URL as: http://example.org/test.php?test=foo When I do that call to $_GET[test] shows that variable is not set, however, when I run phpinfo() it shows value assigned to _GET. With no change in code, I turn global variables 'on' and the same page works.. Paul PS using php 4.2.3 -Original Message- From: Chris Shiflett [mailto:shiflett;php.net] Sent: Sunday, November 03, 2002 10:15 PM To: Paul Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Global Variables Off You didn't really tell us how you're passing data or what is not working. Try this. Create a test script called test.php that looks like this: ? echo pThe test variable is [ . $_GET[test] . ]/p; ? Assuming this script is located at http://example.org/test.php, access this page using a URL like this: http://example.org/test.php?test=foo Chris Paul wrote: Ok, I have turned global vars off and I have replaced my old $HTTP_GET_VARS with $_GET[] but I seem to not get the values passed. I run the phpinfo and I see the variables being stored as _GET[variable_name] Is calling $_GET[variable_name] correct? If so, why would I not get the value? I use it in the following statement (checking if error_message is empty) : if ($_GET[error_message]) -- 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] search
Perhaps the table name 'desc' is reserved word for 'order by' so MySQL cannot use it as table name- So why don't you print out the mysql_error() using for example die- like this: $inquiry = mysql_query(select id,link,heading,desc from links where heading like '%$entry%' or desc like '%$entry%' or keyword like '%$entry%',$connection)) or die (mysql_error()) ; - Original Message - From: samug [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 02, 2002 3:39 AM Subject: [PHP] search There's no php.sql, so I'll put it here. I'm trying to do a search from mysql database like this: if (!$inquiry = mysql_query(select id,link,heading,desc from links where heading like '%$entry%' or desc like '%$entry%' or keyword like '%$entry%',$connection)){ print LISearch was unsuccesful!; } else{ while ($link = mysql_fetch_row($inquiry)){ print LIA HREF=\ . $link[1]; print \ . $link[2]; print /A I . $link[3] . /I ; } } But everytime I get all the possible entries, even though I'm sure it doesn't match. Thanks for your answers. -- 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] Security - Maybe a silly question
Yes, Between user and server, everydata pass through DNS, routeur, etc... So if you don't want someone (hackers or FBI of CIA) to decode your data, use SSL server (https://) with certificate- - Original Message - From: SED [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 02, 2002 8:37 AM Subject: [PHP] Security - Maybe a silly question When I use sessions in PHP or just plain login/password in $_POST, can 3rd parties or hackers monitor the transmission, between me and user, and somehow decode the transmission and use the variables to login other time or overtake the current session? If so, how likely is for someone to manage it (get the username/password)? Regards, Sumarlidi E. Dadason SED - Graphic Design _ Tel: +354-896-0376, +354-461-5501 E-mail: [EMAIL PROTECTED] website: www.sed.is -- 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] Number of files in a dir
cope with readdir() or dir(). I always use one of these functions and I'm wondered if there are more efficient solution to do it ! - Original Message - From: Shaun Thornburgh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 02, 2002 9:00 AM Subject: [PHP] Number of files in a dir How can i find out how many files exist in a dir? -- 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] Can't store info on a mysql database...
$sql=INSERT INTO `users` (login,passwd) VALUES ('$logintxt', 'password($passwdtxt)') ; mysql_db_query(mysite,$sql); - Original Message - From: Mr. BuNgL3 [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 02, 2002 10:32 AM Subject: [PHP] Can't store info on a mysql database... Hi... My problem is that i can't store info in a mysql database... ex: I want to store this info in my database: login/passwd and i have the php code... ? $logintxt = $HTTP_POST_VARS['logintxt']; $passwdtxt= $HTTP_POST_VARS['passwdtxt']; if (!$logintxt || !$passwdtxt) { include('registo.htm'); } else { $ligacao=mysql_connect(localhost,,); if (!$ligacao) { print(Problemas na ligação á base de dados!); } else { //Procurar se user já existente //$sql=INSERT into users SET login='$logintxt', passwd=MD5('$passwdtxt'); $sql=INSERT INTO users (login,passwd) VALUES ('$logintxt', 'passwd=MD5($passwdtxt))'; mysql_db_query(mysite,$sql); } mysql_close(); } ? what i'm doing wrong? : | thanks... -- 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] uping to plaese help
I bit you are doing something like this: copy($file, file) ; - Original Message - From: marcelo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 02, 2002 11:19 AM Subject: [PHP] uping to plaese help Hi need some help please What is wrong with my code? it is supposed to upload 2 files but instead gives me this error Warning: Unable to open 'Array' for reading The code html head titleO Leme upload/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body ?php $PHP_SELF = $_SERVER['PHP_SELF']; $page = $_REQUEST['page']; $origem = $_FILES['origem']; $origem2 = $_FILES['origem2']; switch($page) { case um: um($origem ,$origem2); break; case dois: dois($origem, $origem2); break; default: um($origem ,$origem2); break; } function um($origem ,$origem2) { ? titleJornal O Leme/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#006699 table width=100% border=0 cellpadding=0 cellspacing=0 !--DWLayoutTable-- tr td width=100% height=70 valign=topimg src=test.jpg width=600 height=120 /td /tr tr td height=262 valign=toppnbsp;/p form method=post action=?php $PHP_SELF ? enctype=multipart/form-data table width=75% border=0 align=center bgcolor=#FF tr td width=23%div align=centerfont face=BankGothic Md BT /font/div/td td width=77% bgcolor=#FFnbsp; /td /tr tr tddiv align=center/div/td td bgcolor=#FFnbsp; /td /tr tr tddiv align=center/div/td td bgcolor=#FFnbsp; /td /tr tr tddiv align=leftstrongImagem pequena/strong/div/td td bgcolor=#FF input type=hidden name=MAX_FILE_SIZE value=102400 input type=File name=origem /td /tr tr tddiv align=leftstrongImagem grande/strong/div/td td bgcolor=#FFinput type=hidden name=MAX_FILE_SIZE value=102400 input type=File name=origem2 /td /tr tr tddiv align=center/div/td td bgcolor=#FFnbsp; /td /tr tr tdnbsp;/td tdnbsp;/td /tr /table p align=center input name=submit type=submit value=Adicionar input type=hidden name=page value=dois /form/p /td /tr tr td height=81 valign=topdiv align=center pnbsp;/p p ?php include ('menu.php'); ? nbsp;/p /div/td /tr /table ?php } function dois($origem, $origem2) { set_time_limit(60); $path=(dirname($PATH_TRANSLATED)).../primeirapagina/; $origem_name=pppv2.jpg; $dest= $path.$origem_name; if (($origem none) ($origem )){ if (copy($origem,$dest)){; } else { echo directoria sem direitos de escrita br; } unlink ($origem); } set_time_limit(60); $path2=(dirname($PATH_TRANSLATED)).../primeirapagina/; $origem2_name=ppv2.jpg; $dest2= $path2.$origem2_name; if (($origem2 none) ($origem2 )){ if (copy($origem2,$dest2)){; } else { echo directoria sem direitos de escrita br; } unlink ($origem2); } } ? /body /html and yes i am new to php tk Marcelo Salvador www.sinesdigital.pt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How printing the name and value of a variable ?
Theoriquement it is not possible, because you cannot use any variable since you don't know its name- But you can cope something with get_defined_vars() in which you set every variable without distinction into an array- and after you select the variable you need using some criterias. like this $array = get_defined_vars() ; foreach ($array as $key=$value) if (ereg(EREG_CRITERIA,$key)) echo La variable $KEY est egale a $value ; Elsewhere if you know the name of the variable you would like to use do simply like this: $tigidizougou = 12; echo THE VARIABLE tigidizougou EQUALS .$tigidizougou; - Original Message - From: franck raynal [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Friday, November 01, 2002 9:09 AM Subject: [PHP] How printing the name and value of a variable ? Hello, I'd like to print the name of a variable, in order to get something like this : THE VARIABLE tigidizougou EQUALS 12 ! from the original code below : $tigidizougou = 12; echo THE VARIABLE .(please help me right here). EQUALS .$tigidizougou; Any idea ? Thanks you. Franck -- 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] rename()
$_FILES['userfile']['name'] $_FILES['userfile']['type'] $_FILES['userfile']['size'] $_FILES['userfile']['tmp_name'] First once you upload file from browser using form ...input type=file name=userfile, the filename is automatically renamed by another one and put down to the upload_tmp_dir and after you move or copy it into your destination directory. move_uploaded_file($_FILES['userfile'], string destination) or Copy(string filename, string destination) rename automatically the picture name to string destination, and you can set the destination's file extension using $_FILES['userfile']['type'] or $_FILES['userfile']['name'] using php function like eregi() for example- - Original Message - From: Edward Peloke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 01, 2002 9:25 AM Subject: [PHP] rename() I am trying to allow the user to upload pictures. What is the best way to rename them? If I use the rename function, I have to upload the pictures to the same place as the script and then move it. ALso, if I am not sure of the extension, how can I simply rename it? Can I do multiple files at once? Thanks, Eddie -- 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] why does eregi match for whitespace when there is none?
I don't think that eregi or ereg consider \s as whitespace- Instead, use or \040- - Original Message - From: Peter J. Schoenster [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 01, 2002 4:44 PM Subject: [PHP] why does eregi match for whitespace when there is none? Here is the example: ?php $string = 'asfddsaz'; if (eregi('\s', $string)) { echo Whitespace present; }else { echo NO Whitespace present; } ? Why does the above return true? There is no whitespace in the string. What am I missing? Peter -- 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] POST-ing or GET-ing an array
Why don't you launch your script once you are in the next page? like: a href=next_page.phpnext/a So you don't have to get or post anything? $sql = select stuff from my_table; $result = mysql_query($sql); $count = 0; while ($myrow = mysql_fetch_assoc($result)) { $id = $myrow[id]; $my_array[] = $id; } - Original Message - From: Petre Agenbag [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 4:40 AM Subject: [PHP] POST-ing or GET-ing an array Hi I KNOW I'm gonna get flamed, but I can't find this anywhere in my books or in the manual, yet I know I've read it somewhere. I created an array in a loop as such: $sql = select stuff from my_table; $result = mysql_query($sql); $count = 0; while ($myrow = mysql_fetch_assoc($result)) { $id = $myrow[id]; $my_array[$count] = $id; } Now, I want to send that array to another page with a normal: a href=next_page.php?array=$my_arrayNext/a BUT, that obviously doesn't work... Please just help me out, I'm suffering... -- 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] SMS message ?
Hi all, I'm a newbie, and I'd like some advice, and I don't have any idea, maybe it's a silly question. Is-it possible to send SMS message to mobile phone using PHP? For example, every monday I send some news about my web site to the mobile phone of my visitors with their approval, of course. If possible, how to do it. If not, does anyone have any other ideas how to do this? Best regards, Ranaivo Rija [EMAIL PROTECTED] BP 1528 Port Vila Vanuatu
[PHP] HTTP_POST_FILES undefined - What happen?
Hi all, Thought I turned on register_globals on in the php.ini, my server didn't know the HTTP_POST_FILES. echo $HTTP_POST_FILES[$file]['type'] ; echo $HTTP_POST_FILES[$file]['name'] ; echo $HTTP_POST_FILES[$file]['size'] ; I've always get these messages: PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6 Any suggestions ? Ravelomanana Rija [EMAIL PROTECTED] BP 1528 Port Vila Vanuatu
Re: Re[2]: [PHP] HTTP_POST_FILES undefined - What happen?
Thanks all, This is the correct script : Function verify($file) { GLOBAL $HTTP_POST_FILES ; echo $HTTP_POST_FILES['file']['type'] ; echo $HTTP_POST_FILES['file']['name'] ; echo $HTTP_POST_FILES['file']['size'] ; ... } I forgot to put the GLOBAL in the front of the function. Now, my script work well. Ravelomanana Rija [EMAIL PROTECTED] BP 1528 Port Vila Vanuatu - Original Message - From: Tom Rogers [EMAIL PROTECTED] To: Tom Rogers [EMAIL PROTECTED] Cc: Rija [EMAIL PROTECTED]; PHP-General [EMAIL PROTECTED] Sent: Thursday, July 25, 2002 12:19 PM Subject: Re[2]: [PHP] HTTP_POST_FILES undefined - What happen? Hi, Thursday, July 25, 2002, 11:15:33 AM, you wrote: TR Hi, TR Thursday, July 25, 2002, 10:39:08 AM, you wrote: R Hi all, R Thought I turned on register_globals on in the php.ini, my server didn't know the HTTP_POST_FILES. R echo $HTTP_POST_FILES[$file]['type'] ; R echo $HTTP_POST_FILES[$file]['name'] ; R echo $HTTP_POST_FILES[$file]['size'] ; R I've always get these messages: R PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning: Undefined variable: HTTP_POST_FILES in R c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6 R Any suggestions ? R Ravelomanana Rija R [EMAIL PROTECTED] R BP 1528 Port Vila R Vanuatu TR If they are being used in a function you will need to do: TR function whatever(){ TR global $HTTP_POST_VARS; TR . TR . TR . TR } TR Just a guess :) TR -- TR Best regards, TR Tom sorry that should have been global $HTTP_POST_FILES; -- Best regards, Tom -- 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] How to store an image into a mysql database using php language?
I want to store image data into mysql table using BLOB but I don't know how to read it after. To record the image, I doesn't have any problem, but to read the file after and to view the image, I can't do anything the variable show only comment like this: memobin24.bin So how can I do? This was the script. ? Include(connect.inc) ; $fp = fopen(image/photo.jpg,r) ; if ($fp) { $code2 = ; while (!feof($fp)) { $buffer = fgets($fp, 4096); $code2 = $code2.$buffer; } } $code2 = addslashes($code2) ; $table = 'image' ; $instruction = mysql_query(INSERT into $table values ('','fichier inage','$code2','') or die(FATAL ERROR) ; ?