Re: [PHP] Post variables getting lost
On Mon, Oct 27, 2003 at 03:00:32AM -0200, Joao Andrade wrote: : : Hey people, : : Something odd is happening :) I've this form on a page: : : form method=post action=\basics\quotation-add Backslashes are allowed? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] process forking?
This is a browser thing. So far as I know all browsers pretty much freeze while a save dialog box is open. In some case things still happen. They just aren't noticable until you close the dialog box. On Monday 27 October 2003 00:33, Stephen Cronan wrote: Hi All, I've written a digital asset management system and my dilema is, to save a file from the sytem, i pass the files through a php script so i can change file names and keep the files out of the web tree. I use a little popup window so they can select what format they want to download the file as, but the problem is when downloading a file it seems to halt the rest of the site from being able to do anything until the download is complete. so i'm just trying to get the rest of the site to function while the download is in process, thank in advance. S. -- Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net == A computer scientist is someone who fixes things that aren't broken --Unknown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Matchmaking System
A most amusing project has just come my way. I have a client who wishes to start an online matchmaking/dating service, one not unlike Match.com or Yahoo! Personals. There is a rather unique twist to this service, one that I cannot publicly discuss, but in general terms it is no different than any other such offering. Is anyone aware of any pre-existing framework(s) for a matchmaking application? Perhaps someone knows of an article/tutorial regarding the design of such an app. I've no problem doing this from scratch, in fact the idea rather intrigues me, but I'm not one to re-invent the wheel if I can avoid it. Thanks a lot to all those who respond. Edward Dudlik Those who say it cannot be done should not interrupt the person doing it. wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] baffled on error_reporting
This should be reported at least as a documentation bug (if it's not already mentioned, I'm lazy to search :) Gerard Samuel wrote: Yes I know about turning off error reporting, but what happens after that point. An example. -- common.php -- ?php // php.ini error reporting is set to E_ALL error_reporting( 0 ); // sets it to 0 var_dump(error_reporting()); // Returns 0 ? -- foo.php -- ?php @require('./common.php'); // Here is the problem var_dump(error_reporting()); // Returns 2047 ? If I remove @ from require('./common.php'); in foo.php, the var_dump() then correctly reports it as 0 instead of 2047 Kinda goofy if you ask me... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XML/MySQL
Thanks to everyone who has responded. I have a lot of useful suggestions, and a warm feeling about this newsgroup ;-). I hope I can be of help to everyone in the future. cheers ian Ian Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Apologies to anyone also subscribed to php.xml.dev, who will have read this earlier, but it doesn't seem as frequently read as this news group... so I am reposting... Hi I want to write a function that will take any SQL query as a parameter, and generate XML that represents the recordset. e.g. SELECT * FROM Customers returns: recordset record id=1 name=Mr Smith purchases=2/ record id=2 name=Mr Jones purchases=25/ record id=3 name=Mr Davis purchases=7/ /recordset There are two approaches I think. One is to use the XML DOM, the other is simply to join lots of strings together. What is the best approach? Thanks (and this is my first post to a newsgroup, and my first post to this one, so excuse me if I've missed something vital!) cheers ian ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IMAP Package.
Hi Php-general, How exactly do I install the IMAP Package? I have the default RedHat IMAP installed. Will installing this break that? Or is it possible to specify those controls in the make process? If so what path is it I need? Thanks for any help Michael -- Best regards, Michael ([EMAIL PROTECTED]) Driving People Insane: Five days in advance, tell your friends that you can't attend their party because you're not in the mood. http://www.thompsonmike.co.uk/ PGP KeyID := 0xA9547E32 'To see a world in a grain of sand And heaven in a wild flower To hold infinity in the palm of your hand And eternity in an hour' Using TheBat! Version 2.00.6 Running On Windows XP (2600, Service Pack 1) Sent From OneAndOne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Accounting package
Hi, I have a need for a very simple financial accounting package which is webbased. Is there any such thing around? Thanks Nico -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] silly question about zend
I wanted some sort of IDE for PHP, so decided to use Zend (which i believe quite popular). I installed it on my redhat linux 8.0- both client and server components. Instructions was smooth and gave me success msg, but now I do not know how to open the IDE... so stupid question.. but still want to know .. how to open Zend so that can write PHP ?... regards manisha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Accounting package
On Monday, October 27, 2003, at 07:54 PM, [EMAIL PROTECTED] wrote: Hi, I have a need for a very simple financial accounting package which is webbased. Is there any such thing around? Would anyone use one? I certainly wouldn't -- for security, speed, usability and about 300 other reasons :) Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php://input
Can anyone share about how to use php://input instead of $HTTP_RAW_POST_DATA ? __ Mau ringtones yang gaya ? -- http://www.ponselgaya.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Handling Notices
Hey guys, I was checking over one of my sites the other day trying to weed out the elusive notices that E_ALL turned up and I got some notices that I'm not too sure how to handle. I know how to handle most of these errors however the ones that are snagging me up are the Notice: Undefined index: _blah_ in _blah_. Most of these are array indices in super globals such a $_GET, $_SESSION, etc. How can I get rid of these little buggers? Thanks, Nathan Taylor
[PHP] Converting a string to formatted html
Hi all, I know this can be done somehow but I am not sure. I have a form being submitted to a php file and I wanted a textfield to be converted to formatted html. At the moment none of the line breaks are being submitted and inverted commas have slashes. I know the slashes can be removed using stripslashes function. I thought line breaks would come through with \n but that isn't being transmitted over the form. Can anyone help? Best wishes, Ian Gray - Ian A. Gray Manchester, UK Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 Business Enquiries: +44(0)870 770 8832 E-mail: [EMAIL PROTECTED]: www.baritone.uk.com (Performance) www.vocalstudio.co.uk (Vocal Tuition)www.selectperformers.com (Web design for professional musicians) -
[PHP] Change text size with GD
Hello, I would like to draw text in a rectangle on an image. The text must take all the place in the rectangle. The trouble is that with imagestring(), there are only 5 fonts (1, 2, 3, 4, 5) and the bigger (5) is still too smaller for my rectangle. Is there another way to change the size of the text ? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Newbie Guide] For the benefit of new members
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. == 1. If you have any queries/problems about PHP try http://www.php.net/manual/en first. You can download a copy and use it offline also. You can also try http://www.php.net/manual/faq.php to get answers to frequently answered questions about PHP (added by Christophe Chisogne). 2. Try http://www.google.com next. Try searching for php YOUR QUERY and you may be lucky to get an answer within the first 10 results. 3. Glancing through the list archive you can find many of the common topics discussed repeatedly and can get your answer from those discussions. There is a new searchable archive (launched on October 21, 2003) at http://phparch.com/mailinglists, which provides a comprehensive and convenient search tool. 4. If you are stuck with a script and do not understand what is wrong, instead of posting the whole script, try doing some research yourself. One useful trick is to print the variable/sql query using print or echo command and check whether you get what you expected. After diagnosing the problem, send the details of your efforts (following steps 1, 2 3) and ask for help. 5. Provide a clear descriptive subject line. Avoid general subjects like Help!!, A Question etc. Especially avoid blank subjects. 6. When you want to start a new topic, open a new mail and enter the mailing list address [EMAIL PROTECTED] instead of replying to an existing thread and replacing the subject and body with your message. 7. PHP is a server side scripting language. Whatever processing PHP does takes place BEFORE the output reaches the client. Therefore, it is not possible to access the users' computer related information (OS, screen size etc) using PHP. You need to go for JavaScript and ask the question in a JavaScript list. (You can access information SENT by the user's browser while requesting pages from your server. You can get the details about browser, OS etc as reported by this request. - contributed by Wouter van Vliet) 8. It's always a good idea to post back to the list once you've solved your problem. People usually add [SOLVED] to the subject line of their email when posting solutions. By posting your solution you're helping the next person with the same question. [contribued by Chris W Parker] 9. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html [contributed by Jay Blanchard) 10. One of the repeatedly discussed question in the list is Best PHP editor. Everyone has his/her favourite editor. You can get all the opinions by going through the list archives. If you want a list try this link : http://phpeditors.linuxbackup.co.uk/ (contributed by Christophe Chisogne). Hope you have a good time programming with PHP. Best regards, -- Integrated Management Tools for leather industry -- http://www.leatherlink.net Ma Siva Kumar, BSG LeatherLink (P) Ltd, Chennai - 600106 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Converting a string to formatted html
(I'm re-submitting this 'cos I sent it in html- woops!) Hi all, I know this can be done somehow but I am not sure. I have a form being submitted to a php file and I wanted a textfield to be converted to formatted html. At the moment none of the line breaks are being submitted and inverted commas have slashes. I know the slashes can be removed using stripslashes function. I thought line breaks would come through with \n but that isn't being transmitted over the form. Can anyone help? Best wishes, Ian Gray = - Ian A. Gray Manchester, UK Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 Business Enquiries: +44(0)870 770 8832 E-mail: [EMAIL PROTECTED]: www.baritone.uk.com (Performance) www.vocalstudio.co.uk (Vocal Tuition)www.selectperformers.com (Web design for professional musicians) - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image created with GD does not appear
Hello, I generate an image with GD in the file generate_image.php ?php // generate_image.php require('config.php') require('functions.php'); require('secure.php'); header('Content-Type: image/png'); $im = imagecreate(15, 15); // generation of the image // ... imagepng($im); imagedestroy($im); ? But when I call this page in an image tag like this : img src=generate_image.php border=0 The image is not found (I have the small red cross). If I drop the 3 lines (require) at the beginning of the page then it works fine. The image is well displayed. So I tought it was a problem with the headers, but I have verified, the 3 included files doesn't send any header. That's very strange because if I have the 3 includes files in the code and then I go direct to the location of the file generate_file.php (and so I don't call it with a tag), then the image is well displayed. Did you have an idea why the imaeg is not displayed when I call it with an img tag ? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting a string to formatted html
Ian, PLEASE search the archives before asking the list -- this question is asked every couple of days, which is quite frustrating. See http://au.php,net/nl2br Justin French On Monday, October 27, 2003, at 09:15 PM, Ian Gray wrote: Hi all, I know this can be done somehow but I am not sure. I have a form being submitted to a php file and I wanted a textfield to be converted to formatted html. At the moment none of the line breaks are being submitted and inverted commas have slashes. I know the slashes can be removed using stripslashes function. I thought line breaks would come through with \n but that isn't being transmitted over the form. Can anyone help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Globals set to off - Sessions
I am not sure what I have to do in order to control sessions in PHP 4.33 when globals are set to off. I used to use the following function to check if the user was of admin status; function check_admin_user() // see if somebody is logged in as admin and notify them if not { global $admin_user; if ( (session_is_registered(admin_user)) (isset($admin_user)) ) return true; else return false; } Then in my protected pages I would say; if (check_admin_user()) // if you're an admin user display the following { Session_register(admin_user); // Do admin functions } Else { //Do login form } How do I adapt the check_admin_user() function and the pages to work in 4.33? Thanks, Steve Jackson Web Development and Marketing Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Installation Fails
Hi PHP, I am trying to re-install my PHP system after rebuilding with IMAP controls built, and now I am getting the following error: line 1: re2c: command not found this is on php-4.3.3/ext/standard/var_unserializer.c I am using the following ./configure ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-imap=/usr/local/imap-2000e this worked perfectly well before, cant understand why its falling over here. Any help welcomed -- Best regards, Michael ([EMAIL PROTECTED]) We'll give you piece de resistance and a tour de force http://www.thompsonmike.co.uk/ PGP KeyID := 0xA9547E32 'To see a world in a grain of sand And heaven in a wild flower To hold infinity in the palm of your hand And eternity in an hour' Using TheBat! Version 2.00.6 Running On Windows XP (2600, Service Pack 1) Sent From OneAndOne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MP3 Ripping
(Windows 2k, Apache, PHP, MySQL, Large Computer with Raid Array and Big Drives!!!) (Appology if this is been asked before, but I couldnt see it) Hello, First of all I had better say I don't think I am doing anything illegal. I have over a thousand origional CD's, and would basically like not having to swap the CD's etc. It's amazing some of the tracks I love but never play. I end up playing the albums, and not the singles etc. What I basically would like is to have a form of automatic jukebox on my computer. So what I have done is made a MySQL database with all the Artist, Genre, CD's and Tracks (including mixes). I have typed in all the information into this, and checked it as much as possible. What I would like is to put the music track in a blob field, rather than a file. Is there someway that PHP can read the CD and rip the files??? Or would I need to rip the tracks in a program, and then basically upload them in a form? (The second option would take longer for me of course) Now I could write some sort of C++ or Java program that uses this data and plays the CDs with some fancy choosing of artists and genre etc. But can anyone think of a way to do it from PHP? Someone said WinAmp had a command line interface, perhaps send it tracks from a PHP file. Not sure if it returns informaiton to PHP. One thing I did think was learning the PHP-GTK, with this project as a goal. But I know I can do what I want to do in Java, just not sure if there are any good mp3 modules etc for PHP. Any help would be appreciated! Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Change text size with GD
I use the function imageTTFtext allows you to specify a string with a font and a font point size. Hope that helps. Chris -Original Message- From: Cranky [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 10:16 To: [EMAIL PROTECTED] Subject: [PHP] Change text size with GD Hello, I would like to draw text in a rectangle on an image. The text must take all the place in the rectangle. The trouble is that with imagestring(), there are only 5 fonts (1, 2, 3, 4, 5) and the bigger (5) is still too smaller for my rectangle. Is there another way to change the size of the text ? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Randomizing 3 different numbers.
I am tring to output 3 different random numbers between 1 and 20 into 3 different strings. Using Rand() for each string isn't sufficient as I may get the same number repeated for one of the other strings- eg 1,1,3 or 5,3,3 . It's important that I get three different numbers outputted into for example $one, $two, $three. Can anyone help? Ian = - Ian A. Gray Manchester, UK Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 Business Enquiries: +44(0)870 770 8832 E-mail: [EMAIL PROTECTED]: www.baritone.uk.com (Performance) www.vocalstudio.co.uk (Vocal Tuition)www.selectperformers.com (Web design for professional musicians) - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Globals set to off - Sessions
function check_admin_user() { //global $admin_user; // if ( (session_is_registered(admin_user)) (isset($admin_user)) ) if ( isset($_SESSION['admin_user']) ) return true; else return false; } Steve Jackson wrote: I am not sure what I have to do in order to control sessions in PHP 4.33 when globals are set to off. I used to use the following function to check if the user was of admin status; function check_admin_user() // see if somebody is logged in as admin and notify them if not { global $admin_user; if ( (session_is_registered(admin_user)) (isset($admin_user)) ) return true; else return false; } Then in my protected pages I would say; if (check_admin_user()) // if you're an admin user display the following { Session_register(admin_user); // Do admin functions } Else { //Do login form } How do I adapt the check_admin_user() function and the pages to work in 4.33? Thanks, Steve Jackson Web Development and Marketing Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using php for non-web based applications
[snip] I am not sure if this is the right list to post to as most of you guys are probably run php as an Apache module. However, I am currently using my own xml data format for a non-web based application and I would like to be able to embed php within it. Is there a C/C++ library that I can link against to execute the ?php ... ? inside my xml when I load it? Can someone point me in the right direction? [/snip] This may help http://www.priadoblender.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MP3 Ripping
Steve Vernon wrote: [ snipped ] So what I have done is made a MySQL database with all the Artist, Genre, CD's and Tracks (including mixes). I have typed in all the information into this, and checked it as much as possible. What I would like is to put the music track in a blob field, rather than a file. Is there someway that PHP can read the CD and rip the files??? Or would I need to rip the tracks in a program, and then basically upload them in a form? (The second option would take longer for me of course) The track itself? You mean the contents of the mp3 file?! *shake head* I don't know why you would want to do that -- other than probably giving mysql and your hard disks a good workout, this will not lead to any efficiency. Now I could write some sort of C++ or Java program that uses this data and plays the CDs with some fancy choosing of artists and genre etc. But can anyone think of a way to do it from PHP? Someone said WinAmp had a command line interface, perhaps send it tracks from a PHP file. Not sure if it returns informaiton to PHP. I'm going to entertain this idea just because I need a break from babysitting my X emerge... If you want to send the file -- I suppose you could stream it to Winamp -- or use the command line interface to winamp and just pass it a file through the browser. But again, why do you want to do this through a browser? There are a few thousand mp3 ripping and cataloging programs out there. Windows Media Player (with third party plugins) will also rip Mp3s and catalog them. Winamp also rips and encodes. LAME is a very good free ripper. One thing I did think was learning the PHP-GTK, with this project as a goal. But I know I can do what I want to do in Java, just not sure if there are any good mp3 modules etc for PHP. I know of a few that are for reading track information from mp3s, but not one that does what you want. I suppose you can customize one of those to your liking. Tell me why you want to do this via PHP + Web Server + MySQL + Web Browser again? -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Handling Notices
Nathan Taylor wrote: Hey guys, I was checking over one of my sites the other day trying to weed out the elusive notices that E_ALL turned up and I got some notices that I'm not too sure how to handle. I know how to handle most of these errors however the ones that are snagging me up are the Notice: Undefined index: _blah_ in _blah_. Most of these are array indices in super globals such a $_GET, $_SESSION, etc. How can I get rid of these little buggers? The notice is basically saying that you are trying to assign a value to a variable for an index that doesn't exist (so the value of the variable can't be guaranteed). One way is to verify that the index exists before you assign its value to a variable. This is my favorite way : $var = isset($_POST['key']) ? $_POST['key'] : NULL; You might also want to check out extract() -- which does the same thing. By the way -- pat yourself on the back for going with error_reporting(E_ALL). Its one of the first steps towards effective programming. :) -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Oh why won't it work
I am having problems sorting stuff into an array. It doesn't seem to work quite how everything I read says it should. It is probably my understanding of it but either way I don't really know whats going on. I am trying to put everything out of a table into an array so I can call up the individual rows by a sequential number and then the information in each row by a colume heading. so for the name value in row 1 I want to have $null[1][name]. The purpose of this is to amke a menu system where it automatically sorts the rows into the relevent order. The parentid associates a row with another to signify that it comes under that menu heading. I want it to have 3 levels, so I have included 3 loops all looking for data whos parent id is the same as the previous ones id. If that makes any sence. But when I run this script, it looses the first row and doesn't really output anything logical. For now I have commented out 2 of the loops to try and make it easier to see where I have gone wrong. To see what output I get http://www.busc.net/bristol/website/admin.php is the code that I have included underneath. Thanks html head titleBristol University Skiclub Admin Section/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body table width=600 height=181 border=0 align=center tr td ?php include includes/constants.php; $link = @mysql_connect($DB_server, $DB_user, $DB_pwd) or die (Could not connect); @mysql_select_db($DB_user) or die (Could not select database); $n = 1; $null=getinfo('0'); for ($i=1; $i=sizeof($null); $i++); { print_r($null); /* print $nul[$i]['name']; $j=$null[$i]['id']; /*$fisrt=getinfo[1]; for ($k=1; $k=sizeof($first); $k++); { echo $first[$k]['name']; $l=$first[$k]['id']; $second=getinfo['$m']; for ($m=1; $m=sizeof($second); $m++); { echo $second[$m]['name']br; } }*/ } ? /td nbsp;/td tdnbsp;/td /tr /table /body /html ?php function getinfo($pid) { $query = SELECT name,parentid FROM ubsc_menu WHERE parentid='$pid' ORDER BY parentid; $result = mysql_query ($query) or die (Query failed); $row=mysql_fetch_array($result,MYSQL_ASSOC); while ($row=mysql_fetch_array($result,MYSQL_ASSOC)) { foreach ($row as $colname = $value) { $array[$n][$colname] = $value; } $n++; } return $array; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Change text size with GD
Thanks for your reply. With this function is it possible to specify the size of the text with width and height and not only with an integer ? Because the size of the rectangle on which I want to draw the text is various (I receive the size of the rectangle by parameter). And other thing, I try to load a font to retrieve the width and height with imagefontwidth and imagefontheight. My code is like that : ?php $arial = imageloadfont('arial.ttf'); echo 'brWF : '.imagefontwidth($arial); echo 'brHF : '.imagefontheight($arial); ? And the file arial.ttf is in the same directory as this script But when I load the page, I have this error message : Warning: ImageFontLoad: error reading font in Thanks for your help Chris Neale wrote: I use the function imageTTFtext allows you to specify a string with a font and a font point size. Hope that helps. Chris -Original Message- From: Cranky [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 10:16 To: [EMAIL PROTECTED] Subject: [PHP] Change text size with GD Hello, I would like to draw text in a rectangle on an image. The text must take all the place in the rectangle. The trouble is that with imagestring(), there are only 5 fonts (1, 2, 3, 4, 5) and the bigger (5) is still too smaller for my rectangle. Is there another way to change the size of the text ? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MP3 Ripping
dont need php - mysql to do this. there is a mp3 streaming sever built for winamp. look for shoutcast. it'll everything you need, with little leg work from you. Burhan Khalid [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Steve Vernon wrote: [ snipped ] So what I have done is made a MySQL database with all the Artist, Genre, CD's and Tracks (including mixes). I have typed in all the information into this, and checked it as much as possible. What I would like is to put the music track in a blob field, rather than a file. Is there someway that PHP can read the CD and rip the files??? Or would I need to rip the tracks in a program, and then basically upload them in a form? (The second option would take longer for me of course) The track itself? You mean the contents of the mp3 file?! *shake head* I don't know why you would want to do that -- other than probably giving mysql and your hard disks a good workout, this will not lead to any efficiency. Now I could write some sort of C++ or Java program that uses this data and plays the CDs with some fancy choosing of artists and genre etc. But can anyone think of a way to do it from PHP? Someone said WinAmp had a command line interface, perhaps send it tracks from a PHP file. Not sure if it returns informaiton to PHP. I'm going to entertain this idea just because I need a break from babysitting my X emerge... If you want to send the file -- I suppose you could stream it to Winamp -- or use the command line interface to winamp and just pass it a file through the browser. But again, why do you want to do this through a browser? There are a few thousand mp3 ripping and cataloging programs out there. Windows Media Player (with third party plugins) will also rip Mp3s and catalog them. Winamp also rips and encodes. LAME is a very good free ripper. One thing I did think was learning the PHP-GTK, with this project as a goal. But I know I can do what I want to do in Java, just not sure if there are any good mp3 modules etc for PHP. I know of a few that are for reading track information from mp3s, but not one that does what you want. I suppose you can customize one of those to your liking. Tell me why you want to do this via PHP + Web Server + MySQL + Web Browser again? -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Idea for new operator
Will he get one? -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com ## Please, if you are using windows, you may be infected by Swen. Please go here to find out more: http://us.mcafee.com/virusInfo/default.asp?id=helpCenterhcName=swen http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED] ## Leif K-Brooks [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Larry E. Ullman wrote: I was feeling generous so I went back in time and added this functionality to PHP as of version 3. I call it the strcasecmp function. I placed the description and usage of the function in the PHP manual: http://www.php.net/strcasecmp That was nice of you, but he wanted an operator. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST variables, funny thing
A funny thing was happeng with a GET variable here, after testing it with an if clause, it would be set to 1, like this, after that: if ( $_POST['nova'] =! ) $_POST['nova'] = 1... Is that alright? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Oh why won't it work
Without going too deep into your code, I think I see (parts of) your problem. In a nearly similar case, I used this code to deal with the problem. // This example is putting the data from a table into a 2-dimentional array: // When using mysql_data_seek() you have all the selections from the query in an array, an you can point to which row you want at any time. // Remember: the rowpointer row_num starts at 0 and runs to max_rows - 1. $query = SELECT *. $max_rows = mysql_num_rows($result); $row = mysql_fetch_array($result); $row_num = 0; $ix = 0; while ($row_num = $max_rows-1) { mysql_data_seek($result,$row_num); $row = mysql_fetch_array($result); $ix++; $array[$ix] [1]= $row[1]; $array[$ix] [2]= $row[2]; $array[$ix] [3]= $row[3]; $row_num++; } Hopes this helps a bit. Regards Reidar Solberg Tom Wollaston [EMAIL PROTECTED] skrev i melding news:[EMAIL PROTECTED] I am having problems sorting stuff into an array. It doesn't seem to work quite how everything I read says it should. It is probably my understanding of it but either way I don't really know whats going on. I am trying to put everything out of a table into an array so I can call up the individual rows by a sequential number and then the information in each row by a colume heading. so for the name value in row 1 I want to have $null[1][name]. The purpose of this is to amke a menu system where it automatically sorts the rows into the relevent order. The parentid associates a row with another to signify that it comes under that menu heading. I want it to have 3 levels, so I have included 3 loops all looking for data whos parent id is the same as the previous ones id. If that makes any sence. But when I run this script, it looses the first row and doesn't really output anything logical. For now I have commented out 2 of the loops to try and make it easier to see where I have gone wrong. To see what output I get http://www.busc.net/bristol/website/admin.php is the code that I have included underneath. Thanks html head titleBristol University Skiclub Admin Section/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body table width=600 height=181 border=0 align=center tr td ?php include includes/constants.php; $link = @mysql_connect($DB_server, $DB_user, $DB_pwd) or die (Could not connect); @mysql_select_db($DB_user) or die (Could not select database); $n = 1; $null=getinfo('0'); for ($i=1; $i=sizeof($null); $i++); { print_r($null); /* print $nul[$i]['name']; $j=$null[$i]['id']; /*$fisrt=getinfo[1]; for ($k=1; $k=sizeof($first); $k++); { echo $first[$k]['name']; $l=$first[$k]['id']; $second=getinfo['$m']; for ($m=1; $m=sizeof($second); $m++); { echo $second[$m]['name']br; } }*/ } ? /td nbsp;/td tdnbsp;/td /tr /table /body /html ?php function getinfo($pid) { $query = SELECT name,parentid FROM ubsc_menu WHERE parentid='$pid' ORDER BY parentid; $result = mysql_query ($query) or die (Query failed); $row=mysql_fetch_array($result,MYSQL_ASSOC); while ($row=mysql_fetch_array($result,MYSQL_ASSOC)) { foreach ($row as $colname = $value) { $array[$n][$colname] = $value; } $n++; } return $array; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] POST variables, funny thing
[snip] A funny thing was happeng with a GET variable here, after testing it with an if clause, it would be set to 1, like this, after that: if ( $_POST['nova'] =! ) $_POST['nova'] = 1... Is that alright? [/snip] GET (see your question) or POSTnot that it matters. if($_POST['nova'] != ){ $_POST['nova'] = 1; } will work (note the change of the not equal to operator) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sockets - fine tunning
* Thus wrote Cosmin ([EMAIL PROTECTED]): On Sun, 2003-10-26 at 15:30, Raditha Dissanayake wrote: are you getting any 1xx status codes from the web server? here are the full headers: Transfer-Encoding: chunked This is probably the problem. If you inspect your data, you'll notice that it has extra characters in it right now. You can change your protocol version to HTTP/1.0 or send a header to tell the server you don't want chuncked (don't know that off hand). Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] baffled on error_reporting
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]): This should be reported at least as a documentation bug (if it's not already mentioned, I'm lazy to search :) I dunno, this seems like a php bug to me. The @ should only effect the reporting status of the current line, not disabling certain functions within the included file. Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Idea for new operator
* Thus wrote DvDmanDT ([EMAIL PROTECTED]): Will he get one? I doubt it. Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Accounting package
Hi, I have a need for a very simple financial accounting package which is webbased. Although its not written in PHP, www.sql-ledger.org is a nice one. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Accounting package
On Mon, 2003-10-27 at 09:19, Dan Joseph wrote: Hi, I have a need for a very simple financial accounting package which is webbased. Although its not written in PHP, www.sql-ledger.org is a nice one. Ditto that... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fairly simple array question
* Thus wrote Terence Parker ([EMAIL PROTECTED]): How can I transfer the results above into an array such that I only need to check $group_result-group_id against $usergroup[$group_result-group_id] ? -- I know that won't work syntactically, it's an example only. Or is there a better way of doing this? Is there a function that merely asks if an item (say, '6') exists in ALL the results above? An alterative is get the data you need back from the database then you just have one result to go through in php. select ug.username, g.* from groups g left join usergroup ug on (g.id = ug.group_id) where ug.username = 'tparker'; +--+---+ | username | g.id | g.name | +--+---+ | tparker |3 | group3 | | tparker |6 | group6 | | NULL |1 | group1 | if (empty($result-username)) { // not in group } else { // in group } Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post variables getting lost
--- Joao Andrade [EMAIL PROTECTED] wrote: form method=post action=\basics\quotation-add Windowsitis? Mind your slashes. Also, you should quote HTML attributes (though this isn't your problem). So, try this: form action=/basics/quotation-add method=post tdinput type=text size=30 name=author_name [snip] tdinput type=text size=30 name=new Same thing here. Quote your attributes. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST variables, funny thing
--- Joao Andrade [EMAIL PROTECTED] wrote: if ( $_POST['nova'] =! ) Equal not? Perhaps you mean not equal? :-) Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] baffled on error_reporting
On Monday 27 October 2003 09:08 am, Curt Zirzow wrote: * Thus wrote Marek Kilimajer ([EMAIL PROTECTED]): This should be reported at least as a documentation bug (if it's not already mentioned, I'm lazy to search :) I dunno, this seems like a php bug to me. The @ should only effect the reporting status of the current line, not disabling certain functions within the included file. Yeah, I believe its a bug, as the @ only should affect the line in question at that instance, then go back to what it was previously. At least I think thats how it was supposed to work. Ill file a bug report and see what they say... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PhP/MySQL Search Results code
Newbie question - please excuse. I'm using Dreamweaver to generate most of my PhP. I have created a search page and am trying to generate the results page. The search form is using the GET function and the form field name is manufacturer. The following code is generated by DW in the results page... ?php $vManufacturer_rs_RobesonResultsList = Reece; if (isset(manufacturer)) { $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? manufacturer : addslashes(manufacturer); } mysql_select_db($database_VandyDivAddresses, $VandyDivAddresses); $query_rs_RobesonResultsList = sprintf(SELECT robeson_inv.manufacturer, robeson_inv.model, robeson_inv.specs, robeson_inv.qty FROM robeson_inv WHERE robeson_inv.manufacturer = '%s' ORDER BY robeson_inv.model, $vManufacturer_rs_RobesonResultsList); $rs_RobesonResultsList = mysql_query($query_rs_RobesonResultsList, $VandyDivAddresses) or die(mysql_error()); $row_rs_RobesonResultsList = mysql_fetch_assoc($rs_RobesonResultsList); $totalRows_rs_RobesonResultsList = mysql_num_rows($rs_RobesonResultsList); ? I'm always getting an error when testing the page. The error is... Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /home/s/k/user992816/html/RobesonWeb/TMP4np9nf7zp.php on line 4 The line to which it refers is the line stating, $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? manufacturer : addslashes(manufacturer); Anyone know what the problem may be? Thanx in advance for any help provided, Robb Kerr Digital IGUANA Helping Digital Artists Achieve their Dreams http://www.digitaliguana.com http://www.cancerreallysucks.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Randomizing 3 different numbers.
Before you add a number to a string make sure that the number is not in any of the other ones if they exist. Use a do-while loop on it... $one = rand( 1,20 ); do { $two = rand( 1, 20 ); }while( $two == $one ); do { $three = rand( 1, 20 ); }while( ($three == $one) ($three == $two) ); echo One: $one\n; echo Two: $two\n; echo Three: $three\n; HTH -- Ray On Mon, 2003-10-27 at 05:26, Ian Gray wrote: I am tring to output 3 different random numbers between 1 and 20 into 3 different strings. Using Rand() for each string isn't sufficient as I may get the same number repeated for one of the other strings- eg 1,1,3 or 5,3,3 . It's important that I get three different numbers outputted into for example $one, $two, $three. Can anyone help? Ian = - Ian A. Gray Manchester, UK Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 Business Enquiries: +44(0)870 770 8832 E-mail: [EMAIL PROTECTED]: www.baritone.uk.com (Performance) www.vocalstudio.co.uk (Vocal Tuition)www.selectperformers.com (Web design for professional musicians) - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oh why won't it work
* Thus wrote Tom Wollaston ([EMAIL PROTECTED]): I am having problems sorting stuff into an array. It doesn't seem to work quite how everything I read says it should. It is probably my understanding of it but either way I don't really know whats going on. Did you not read my response to your question about this earlier? You have the same exact code you posted a few days ago that will not work. Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PhP/MySQL Search Results code
[snip] if (isset(manufacturer)) { $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? manufacturer : addslashes(manufacturer); } Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /home/s/k/user992816/html/RobesonWeb/TMP4np9nf7zp.php on line 4 [/snip] Looks like 'manufacturer' needs a $ in fromt of it to make it a variable if (isset($manufacturer)) { $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? $manufacturer : addslashes($manufacturer); } HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oh why won't it work
On Mon, 27 Oct 2003 13:00:19 -, you wrote: $n is created /outside/ the function. $n = 1; So you can't use it here. It's not in scope. $array[$n][$colname] = $value; But when I run this script, it looses the first row and doesn't really That's because you get the first row here. $row=mysql_fetch_array($result,MYSQL_ASSOC); And immediately throw it away as you enter the loop. while ($row=mysql_fetch_array($result,MYSQL_ASSOC)) I answered thia (and fixed your code) last time you posted. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PhP/MySQL Search Results code
The line should be $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? $manufacturer : addslashes($manufacturer); Robb Kerr wrote: Newbie question - please excuse. I'm using Dreamweaver to generate most of my PhP. I have created a search page and am trying to generate the results page. The search form is using the GET function and the form field name is manufacturer. The following code is generated by DW in the results page... ?php $vManufacturer_rs_RobesonResultsList = Reece; if (isset(manufacturer)) { $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? manufacturer : addslashes(manufacturer); } mysql_select_db($database_VandyDivAddresses, $VandyDivAddresses); $query_rs_RobesonResultsList = sprintf(SELECT robeson_inv.manufacturer, robeson_inv.model, robeson_inv.specs, robeson_inv.qty FROM robeson_inv WHERE robeson_inv.manufacturer = '%s' ORDER BY robeson_inv.model, $vManufacturer_rs_RobesonResultsList); $rs_RobesonResultsList = mysql_query($query_rs_RobesonResultsList, $VandyDivAddresses) or die(mysql_error()); $row_rs_RobesonResultsList = mysql_fetch_assoc($rs_RobesonResultsList); $totalRows_rs_RobesonResultsList = mysql_num_rows($rs_RobesonResultsList); ? I'm always getting an error when testing the page. The error is... Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /home/s/k/user992816/html/RobesonWeb/TMP4np9nf7zp.php on line 4 The line to which it refers is the line stating, $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? manufacturer : addslashes(manufacturer); Anyone know what the problem may be? Thanx in advance for any help provided, Robb Kerr Digital IGUANA Helping Digital Artists Achieve their Dreams http://www.digitaliguana.com http://www.cancerreallysucks.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PhP/MySQL Search Results code
That was it! Thanx for the help. This board has proven invaluable to me. Robb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Files in /etc/php.d/
About a year ago, I installed RH 9.0 and in the process installed/updated php 4.2.2. The directory, /etc/php.d/ contains many ini files instructing php to load modules including mysql.so and interbase.so. phpinfo() shows that they have been included. Not being a Linux guru - in fact, knowing just enough to keep it running as my http and ftp server - and having lost my notes, I cannot remember what I did to get this configuration. In loading RH 9 onto another computer, the /etc/php.d/ directory does not contain these files *and* phpinfo() does not show mysql or interbase. Can someone help me get my bearings? Do I need to get the latest php rpm and run configure using the --with-xxx flag for each of the modules I want included? Lost. Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PhP/MySQL Search Results code
* Thus wrote Robb Kerr ([EMAIL PROTECTED]): I'm always getting an error when testing the page. The error is... Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /home/s/k/user992816/html/RobesonWeb/TMP4np9nf7zp.php on line 4 The line to which it refers is the line stating, $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? manufacturer : addslashes(manufacturer); hmm.. what part of line 4? take the php line and put it on 4 different lines $vManufacturer_rs_RobesonResultsList = (get_magic_quotes_gpc()) ? manufacturer : addslashes(manufacturer); What line is the error on now? line 6? ah.. so what exacly is manufacturer? A variable, constant, string or number? I'm going to make the assumption that it is a variable. So you need to prepend a $ to the word manufacturer ($manufacturer). If you test it now, you'll probaly get a notice/warning about line 7 (depending on php's error_reporting level). You'll probably want to make that manufacturer a variable also. Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Randomizing 3 different numbers.
Sorry for top-posting, gotta configure my mail client better later. Small error here: }while( ($three == $one) ($three == $two) ); Change to: }while( ($three == $one) || ($three == $two) ); -Original Message- From: Ray Hunter [mailto:[EMAIL PROTECTED] Sent: den 27 oktober 2003 15:56 To: [EMAIL PROTECTED] Subject: Re: [PHP] Randomizing 3 different numbers. Before you add a number to a string make sure that the number is not in any of the other ones if they exist. Use a do-while loop on it... $one = rand( 1,20 ); do { $two = rand( 1, 20 ); }while( $two == $one ); do { $three = rand( 1, 20 ); }while( ($three == $one) ($three == $two) ); echo One: $one\n; echo Two: $two\n; echo Three: $three\n; HTH -- Ray On Mon, 2003-10-27 at 05:26, Ian Gray wrote: I am tring to output 3 different random numbers between 1 and 20 into 3 different strings. Using Rand() for each string isn't sufficient as I may get the same number repeated for one of the other strings- eg 1,1,3 or 5,3,3 . It's important that I get three different numbers outputted into for example $one, $two, $three. Can anyone help? Ian = - Ian A. Gray Manchester, UK Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 Business Enquiries: +44(0)870 770 8832 E-mail: [EMAIL PROTECTED]: www.baritone.uk.com (Performance) www.vocalstudio.co.uk (Vocal Tuition)www.selectperformers.com (Web design for professional musicians) - -- 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] Randomizing 3 different numbers.
Dont you mean || at the last loop? You loop as long as 3 is equal to both 1 and 2, || would cause it to loop while it's equal to any of them.. -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com ## Please, if you are using windows, you may be infected by Swen. Please go here to find out more: http://us.mcafee.com/virusInfo/default.asp?id=helpCenterhcName=swen http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED] ## Ray Hunter [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Before you add a number to a string make sure that the number is not in any of the other ones if they exist. Use a do-while loop on it... $one = rand( 1,20 ); do { $two = rand( 1, 20 ); }while( $two == $one ); do { $three = rand( 1, 20 ); }while( ($three == $one) ($three == $two) ); echo One: $one\n; echo Two: $two\n; echo Three: $three\n; HTH -- Ray On Mon, 2003-10-27 at 05:26, Ian Gray wrote: I am tring to output 3 different random numbers between 1 and 20 into 3 different strings. Using Rand() for each string isn't sufficient as I may get the same number repeated for one of the other strings- eg 1,1,3 or 5,3,3 . It's important that I get three different numbers outputted into for example $one, $two, $three. Can anyone help? Ian = - Ian A. Gray Manchester, UK Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 Business Enquiries: +44(0)870 770 8832 E-mail: [EMAIL PROTECTED]: www.baritone.uk.com (Performance) www.vocalstudio.co.uk (Vocal Tuition)www.selectperformers.com (Web design for professional musicians) - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Files in /etc/php.d/
I supose you need to install php-mysql, php-interbase ... Todd Cary wrote: About a year ago, I installed RH 9.0 and in the process installed/updated php 4.2.2. The directory, /etc/php.d/ contains many ini files instructing php to load modules including mysql.so and interbase.so. phpinfo() shows that they have been included. Not being a Linux guru - in fact, knowing just enough to keep it running as my http and ftp server - and having lost my notes, I cannot remember what I did to get this configuration. In loading RH 9 onto another computer, the /etc/php.d/ directory does not contain these files *and* phpinfo() does not show mysql or interbase. Can someone help me get my bearings? Do I need to get the latest php rpm and run configure using the --with-xxx flag for each of the modules I want included? Lost. Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] register_globals
Hi all, I use suse8.2 professional I have upgraded php 4.3.1 to 4.3.3 with rpm suse project. In the php.ini I have set the registr_globals=3D Off and Ih th directory /srv/www/html/mysites1 I have created the file .htaccess with: php_flag register_globals on for only this site. With the function phpinfo I have see that the Master Value is Off and the= Load Value is On but the site don't running successfully. With suse8.1 with php4.2.2 I have nothing problem. Any idea ? Thankind in advance and sorry for my english. Giuliano. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] register_globals
[snip] With the function phpinfo I have see that the Master Value is Off and the= Load Value is On but the site don't running successfully. With suse8.1 with php4.2.2 I have nothing problem. Any idea ? [/snip] Does the site rely on files outside of that directory? Do you 'allow overrides' for the directory in Apache? (httpd.conf) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] register_globals
--- [EMAIL PROTECTED] wrote: In the php.ini I have set the registr_globals=3D Off I'm assuming that 3D was put in there by some faulty mail client? Also, make sure you spell it register_globals. php_flag register_globals on for only this site. With the function phpinfo I have see that the Master Value is Off and the Load Value is On but the site don't running successfully. Well, that sounds like what you are trying to do? What is wrong exactly? Not every error is the fault of register_globals, after all. :-) Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Post variables and mysql queries
This may be a dumb question but here goes. I have been trying to use $_POST globals in sql queries. If I use the following query string it does not work $query=Select * from users where userid='$_POST['userid']'; However, this works $userid=$_POST[userid] $query=Select * from users where userid='$userid'; Is there a mistake in my syntax? thanks, Luis R. Lebron Sigmatech, Inc
Re: [PHP] Post variables and mysql queries
--- Luis Lebron [EMAIL PROTECTED] wrote: $query=Select * from users where userid='$_POST['userid']'; Use curly braces: $query = select * from users where userid = '{$_POST['userid']}'; Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] register_globals
--- [EMAIL PROTECTED] wrote: The problem concern: The correct site is: www.gardafun.com with apache.1.3.27 and php-4.0.6 with register_globals = On The new webserver is 213.21.138.119 with suse8.2 apache1.3.27 and php-4.3.3 with register_globals=off in the php.ini and in the .htaccess the directive: php_flag register_globals on The same sites don't work in the new websites but with the phpinfo I see that the Load Value for register_globals for this site is On. You need to explain what is wrong. You seem confident that register_globals is your problem, but you've not told us why you think so. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Post variables and mysql queries
$query=Select * from users where userid='.$_POST['userid'].'; ;-) pete Luis Lebron wrote: This may be a dumb question but here goes. I have been trying to use $_POST globals in sql queries. If I use the following query string it does not work $query=Select * from users where userid='$_POST['userid']'; However, this works $userid=$_POST[userid] $query=Select * from users where userid='$userid'; Is there a mistake in my syntax? thanks, Luis R. Lebron Sigmatech, Inc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Randomizing 3 different numbers.
Just to give you something to chew on, try the code below. ?php $myResultsArray = array(); $numberOfRandNumbersToGet = 3; $randomNumberRange= 20; while(count($myResultsArray) $numberOfRandNumbersToGet) { do { $rand = rand(1, $randomNumberRange); }while(in_array($rand, $myResultsArray)); $myResultsArray[] = $rand; } print_r($myResultsArray); // If you really want $one, $two, $three for exactly three results: list($one, $two, $three) = $myResultsArray; echo 1: $one\n2: $two\n3: $three\n; ? It is slightly more generic, and you can change things a little without having to modify a whole bunch of if() statements. -Original Message- From: Ian Gray [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 12:26 To: [EMAIL PROTECTED] Subject: [PHP] Randomizing 3 different numbers. I am tring to output 3 different random numbers between 1 and 20 into 3 different strings. Using Rand() for each string isn't sufficient as I may get the same number repeated for one of the other strings- eg 1,1,3 or 5,3,3 . It's important that I get three different numbers outputted into for example $one, $two, $three. Can anyone help? Ian = - Ian A. Gray Manchester, UK Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 Business Enquiries: +44(0)870 770 8832 E-mail: [EMAIL PROTECTED]: www.baritone.uk.com (Performance) www.vocalstudio.co.uk (Vocal Tuition)www.selectperformers.com (Web design for professional musicians) - -- 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] MP3 Ripping
erythros and Burhan, Thanks for the reply. Basically I started putting my music into a program , and the program I did it on didn't like the amount of tracks (kept crashing), and didn't give me as many options as I would like. I'm not worried about a fancy interface and graphical displays of the music. What I could do is make a folder inside a folder with the artist name and the CD, and then the MP3 files inside with the name (and possibly mix) as part of the name. But what if the CD has music from different artists? What if the program does not like a high number of files? What if the file name gets to be more than 255 characters? What if I want to do something bit more advanced with a catelouged set of data. The last sentence relates to a project I did at Uni, to do with automatic mixing between tracks. I realise the code I did then is copyright, but I have a few ideas I want to try out. I sometimes do a bit of DJing at a local bar/club, but for the first couple of hours we just play a couple of mix CD's, before I get up and DJ. What I was thinking was letting the computer DJ itself, and letting people using a simple interface select some songs. But I would want to limit the type of songs, because some songs don't work at certain times of the night. Just would be nice to have it all using MySQL, so people can see pics of the artists etc. There are some quiet nights where basically either mix cd's or the radio is used all night. A database is there to hold your data, and basically display it in a format when asked, that you asked for. (Ok not a dictionary definition). Basically a file system is a simple database, but just to hold files. I know the load on the server would be crazy, but I'm not worried about that. All I plan to do at the moment is to output to a tempoary file, and then feed it into a program such as WinAmp to play the file. I don't want to do any Streaming- well perhaps some screaming! Ideally there would be a software product out there to do all this, but I don't think so, not with some of the ideas I have which I haven't even listed!!! So is there ANY way from PHP to read a CD, rip the tracks and place them in BLOB fields in MySQL? Or do I have to write something in C++ or Java? Just would be nice if there was something in PHP. Thanks, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MP3 Ripping
[snip] ...some stuff... [/snip] Have you looked at Ampache? http://www.ampache.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post variables and mysql queries
Luis Lebron wrote: snip If I use the following query string it does not work $query=Select * from users where userid='$_POST['userid']'; snip Use curly braces to eval array elements inside of a string $query = SELECT * FROM users WHERE userid='{$_POST['userid']}'; -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Verify bUixCtJf for jay.blanchard@niicommunications.com
[snip] Your message has been received, but it hasn't been delivered to me yet. As I don't have any record of you sending me mail from this address before, I need to verify that you're not a spammer. Please reply and alter the Subject line to remove the word REMOVETHISWORD, and your previous message will be delivered, as will all your future messages. Thanks, and apologies for the inconvenience. [/snip] Do you realize how large a PITA this is? For everyone who sends an e-mail to the PHP general list they have to take the time to answer this. SPAM about SPAM. Wonderful. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: Verify bUixCtJf for jay.blanchard@niicommunications.com
Jay Blanchard wrote: [snip] Your message has been received, but it hasn't been delivered to me yet. As I don't have any record of you sending me mail from this address before, I need to verify that you're not a spammer. Please reply and alter the Subject line to remove the word REMOVETHISWORD, and your previous message will be delivered, as will all your future messages. Thanks, and apologies for the inconvenience. [/snip] Do you realize how large a PITA this is? For everyone who sends an e-mail to the PHP general list they have to take the time to answer this. SPAM about SPAM. Wonderful. I saw this in my inbox, and all future messages from Mr./Ms. Prabhat Gupta have earned a one-way ticket to /dev/null. :) -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters [solved]
Hi Timo, Nachricht vom Freitag, 24. Oktober 2003, 17:58:39: I am trying to get my pages through the w3c-validator for html. It doesn't like my FORM action=mypage.php?para1=val1para2=val2 Changing to amp; got my page through the validator, but broke my app, which seems not to be getting any parameters over URL anymore. How can I fix that? I found that amp; works in form action and gets there, but stays amp; if you put it in a header(Location: ... ) function. Thx to all those who helped me in that, especially Chris Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] register_globals
Please include the list in all of your replies. I skim message subjects and don't read all messages. If you reply only to me, there's a good chance it will not be read, and no one else will have a chance to answer your question. --- [EMAIL PROTECTED] wrote: As i know, if register_globals is turned to on, my site should run as on a 4.0.6 php server, right? No, register_globals is not the only change that has been made to PHP since 4.0.6. That would be the only way that enabling register_globals on a new version of PHP would be guaranteed to run exactly like version 4.0.6. But it doesn't run correctly, quieres are not working and others many problems. You really need to explain what your problem is. This is the third time you've been asked to do so. We cannot possibly read your mind and answer a question you have not asked. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code optimization: single vs. double quotes?
olinux mailto:[EMAIL PROTECTED] on Friday, October 24, 2003 9:41 PM said: echo td bgcolor=\$bgcolor2\nbsp;/td/tr; uggh - apparently you've never had to redesign a site/application that uses this style. This is one table cell, but when you work this style through a big app, it's a huge pain (waste of time) to make any changes. Apparently. What do you recommend? c. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code optimization: single vs. double quotes?
[snip] echo td bgcolor=\$bgcolor2\nbsp;/td/tr; uggh - redesign recommend? [/snip] CSS! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] usort
No need to write your own function, it's already in PHP. :-) What you're looking for it natsort(). It uses natural order string comparison (which takes into account numbers instead of just using characters like a regular search does). There are also lots of other 'nat' functions, such as strnatcmp(). David Otton wrote: On Sat, 25 Oct 2003 04:03:12 +0300, you wrote: I don't know what the names are. I just know that there might be numbers. :) It still doesn't work. It gives very odd results with the $x_out variables. ?php function cmp ($a, $b) { if ($a == $b) { return (0); } $a = explode ('_', $a); $b = explode ('_', $b); if ($a[0] == $b[0]) { return (((int)$a[1] (int)$b[1]) ? -1 : 1); } return (($a[0] $b[0]) ? -1 : 1); } $a = array('file_3.ext', 'file_10.ext', 'xxx.ext', 'file_2.ext', 'file_1.ext'); usort ($a, 'cmp'); print_r ($a); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Post variables and mysql queries
$query='Select * from users where userid='.$_POST['userid'].''; I tend to use single quotes whenever I can and to use concatenation instead of using in-string variables. I do this for three reasons. The first is efficiency. Strings surrounded by single chars are not parsed for any values, such as variables and backslashed characters (except for '). This saves in execution time every time the script is executed. It also helps with readability of the code as some syntax highlighting doesn't catch variables in strings. The last reason is that I know exactly what the code is going to do. I never really know what will be used as the variable when I do it in a string. Will it follow a -? What about two? I don't always know and it's easier to debug without all of the extra hassle. Pete M wrote: $query=Select * from users where userid='.$_POST['userid'].'; ;-) pete Luis Lebron wrote: This may be a dumb question but here goes. I have been trying to use $_POST globals in sql queries. If I use the following query string it does not work $query=Select * from users where userid='$_POST['userid']'; However, this works $userid=$_POST[userid] $query=Select * from users where userid='$userid'; Is there a mistake in my syntax? thanks, Luis R. Lebron Sigmatech, Inc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] silly question about zend
On Monday 27 October 2003 04:08, Manisha Sathe wrote: I wanted some sort of IDE for PHP, so decided to use Zend (which i believe quite popular). I installed it on my redhat linux 8.0- both client and server components. Instructions was smooth and gave me success msg, but now I do not know how to open the IDE... so stupid question.. but still want to know .. how to open Zend so that can write PHP ?... regards manisha It depends on where you told it to install the links. I believe the default if your home directory. (The one who installed it.) Look in their directory for a directory called ZDE* there should be a symbolic link in one of them unless you changed it. (Note: The names are ridiculously long) -- Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net == A computer scientist is someone who fixes things that aren't broken --Unknown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code optimization: single vs. double quotes?
Jay Blanchard mailto:[EMAIL PROTECTED] on Monday, October 27, 2003 9:31 AM said: CSS! :) Oh that's what he meant? I thought he was talking about the quoting style used on that line. Chris. p.s. The last time I actually used bgcolor was probably almost a year ago. :) -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multi-dimensional array help
This array problem has been stumping my brain for a little while now... here's a sample of my data: $purchases[001][200304] = array('regular'=3, 'booked'=4); $purchases[002][200303] = array('regular'=5, 'booked'=1); $purchases[002][200304] = array('regular'=1, 'booked'=0); $purchases[002][200307] = array('regular'=0, 'booked'=2); $purchases[003][200303] = array('regular'=0, 'booked'=4); $purchases[003][200301] = array('regular'=5, 'booked'=0); $purchases[004][200309] = array('regular'=0, 'booked'=2); The first array element of $purchases is a Part Number (or SKU). The second element of $purchases is the month/year for which the assigned data (regular and booked values) are set. I need to take this data and place it into a table that has a row for each part number, and 12 months worth of cells. An example of the desired chart (apologies to the non-fixed font viewers!): SKU| Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec ---+-+-+-+-+-+-+-+-+-+-+-+ 001| | | | 3/4 | | | | | | | | ---+-+-+-+-+-+-+-+-+-+-+-+ 002| | | 5/1 | 1/0 | | | 0/2 | | | | | ---+-+-+-+-+-+-+-+-+-+-+-+ 003| 5/0 | | 0/4 | | | | | | | | | ---+-+-+-+-+-+-+-+-+-+-+-+ 004| | | | | | | | | 0/2 | | | In this case, the table layout would be 4 rows and 12 cells. In this sample data's case, there are three rows of Part Number 002. This needs to be combined into one row. There will only be a maximum of 12 elements for each SKU (there will never be duplicated Month/Year values). Can anyone lead me in the right direction? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] database
Hi, I'm very new with php, so perhaps it's a silly question. I want a connection with a mysql database. This works. I can open, retrieve data, and close the database. But this happens in the same page. Now I want one page that has a function who's opening and close the connection. In another page I want include this page. But I don't know the syntax. e.g page connectie.php Function openDB() { $link = mysql_connect(localhost, host, pas) or die(geen connectie mogelijk : . mysql_error()); print connectie ok; mysql_select_db(database) or die(geen database gevonden); } Function closeDB() { mysql_close($link); } End Function ? ?php page input.php include ('connectie.php'); //open connectie $connectie = openDB(); //code //close connectie $connectie = closeDB(); This gives an error when I want to close the db. In the function I said close($link) but of course he cann't see this variabel. How can I fix that? Alain D'Haene Or is it possible the set the connection in an Object, and use this object during the Session? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] database
Alain, You can pass it in the function as a variable. E.g... Function closeDB($ref_link) { mysql_close($ref_link); } closeDB($connectie); Hope this Helps, Jordan S. Jones -- I am nothing but a poor boy. Please Donate.. https://www.paypal.com/xclick/business=list%40racistnames.comitem_name=Jordan+S.+Jonesno_note=1tax=0currency_code=USD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multi-dimensional array help
On Mon, 2003-10-27 at 12:44, Aaron Gould wrote: This array problem has been stumping my brain for a little while now... here's a sample of my data: $purchases[001][200304] = array('regular'=3, 'booked'=4); $purchases[002][200303] = array('regular'=5, 'booked'=1); $purchases[002][200304] = array('regular'=1, 'booked'=0); $purchases[002][200307] = array('regular'=0, 'booked'=2); $purchases[003][200303] = array('regular'=0, 'booked'=4); $purchases[003][200301] = array('regular'=5, 'booked'=0); $purchases[004][200309] = array('regular'=0, 'booked'=2); The first array element of $purchases is a Part Number (or SKU). The second element of $purchases is the month/year for which the assigned data (regular and booked values) are set. I need to take this data and place it into a table that has a row for each part number, and 12 months worth of cells. An example of the desired chart (apologies to the non-fixed font viewers!): SKU| Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec ---+-+-+-+-+-+-+-+-+-+-+-+ 001| | | | 3/4 | | | | | | | | ---+-+-+-+-+-+-+-+-+-+-+-+ 002| | | 5/1 | 1/0 | | | 0/2 | | | | | ---+-+-+-+-+-+-+-+-+-+-+-+ 003| 5/0 | | 0/4 | | | | | | | | | ---+-+-+-+-+-+-+-+-+-+-+-+ 004| | | | | | | | | 0/2 | | | In this case, the table layout would be 4 rows and 12 cells. In this sample data's case, there are three rows of Part Number 002. This needs to be combined into one row. There will only be a maximum of 12 elements for each SKU (there will never be duplicated Month/Year values). Can anyone lead me in the right direction? I was feeling generous so I whipped up the answer for you :) ?php $purchases[001][200304] = array('regular'=3, 'booked'=4); $purchases[002][200303] = array('regular'=5, 'booked'=1); $purchases[002][200304] = array('regular'=1, 'booked'=0); $purchases[002][200307] = array('regular'=0, 'booked'=2); $purchases[003][200303] = array('regular'=0, 'booked'=4); $purchases[003][200301] = array('regular'=5, 'booked'=0); $purchases[004][200309] = array('regular'=0, 'booked'=2); echo 'table border=1'.\n .'tr' .'thSKU/th' .'thJan/th' .'thFeb/th' .'thMar/th' .'thApr/th' .'thMay/th' .'thJun/th' .'thJul/th' .'thAug/th' .'thSep/th' .'thOct/th' .'thNob/th' .'thDec/th' .'/tr'.\n; foreach( $purchases as $sku = $skuData ) { echo 'tr' .'td'.sprintf( '%03d', $sku ).'/td'; for( $i = 1; $i = 12; $i++ ) { $key = '2003'.sprintf( '%02d', $i ); echo 'td'; if( isset( $skuData[$key] ) ) { echo $skuData[$key]['regular'].'/'.$skuData[$key]['booked']; } else { echo 'nbsp;'; } echo '/td'; } echo '/tr'.\n; } echo '/table'.\n; Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Post variables and mysql queries
On Mon, Oct 27, 2003 at 09:38:32AM -0800, Justin Patrin wrote: : : $query='Select * from users where userid='.$_POST['userid'].''; : : I tend to use single quotes whenever I can and to use concatenation : instead of using in-string variables. I do this for three reasons. The : first is efficiency. Strings surrounded by single chars are not parsed : for any values, such as variables and backslashed characters (except for : '). This saves in execution time every time the script is executed. No argument here, except that I don't know if the savings is really noticable for such a small string. : It also helps with readability of the code as some syntax highlighting : doesn't catch variables in strings. IMHO, in-string variables are more readable that trying to read some-string-with-some-quote-character, dot, some-string, dot, some-string, etc. : The last reason is that I know : exactly what the code is going to do. I never really know what will be : used as the variable when I do it in a string. Will it follow a -? What : about two? I don't always know and it's easier to debug without all of : the extra hassle. That's what the curly brackets are for. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] function problem (simple redirect)
I'm trying to make this function work, but I'm not good at functions. I have created a variable for testing payment equal to 1 or 0 to see what would happen based on whatever the condition is in my database (the sql stuff is not here because i have to figure this thing out first). I get a t_string error or t_varialbe but I don't know what to do to fix it. Frank code -- $payment = 1; echo $payment; function $payment{ if ($payment == 0); header (location:test_page.html); }else{ ($payment == 1); header (location:test_page2.html); } __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] function problem (simple redirect)
function $payment{ Change that to: function payment{ $global $payment; Regards, -Gregory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] function problem (simple redirect)
Make that: function payment{ global $payment; -Gregory -Original Message- From: Gregory Kornblum [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 1:30 PM To: 'Frank Tudor'; 1PHP Subject: RE: [PHP] function problem (simple redirect) function $payment{ Change that to: function payment{ $global $payment; Regards, -Gregory -- 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] Multi-dimensional array help
On 27 Oct 2003 13:20:48 -0500, you wrote: echo 'table border=1'.\n .'tr' .'thSKU/th' .'thJan/th' .'thFeb/th' .'thMar/th' .'thApr/th' .'thMay/th' .'thJun/th' .'thJul/th' .'thAug/th' .'thSep/th' .'thOct/th' .'thNob/th' .'thDec/th' .'/tr'.\n; for ($i = 1; $i = 12; $i++) { echo ('th' . strftime (%b, strtotime (1970-$i-01)) . '/th'); } is shorter, and stands a chance of working across locales. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MysSQL db not restoring
Curt Zirzow mailto:[EMAIL PROTECTED] on Friday, October 24, 2003 5:19 PM said: You probably have a field name that is a keyword of some sort. Hard to tell without seeing the create table syntax. I checked this out and I did not have any keywords as column names. Would it help if I posted the dump file or a portion of it? Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function problem (simple redirect)
--- Frank Tudor [EMAIL PROTECTED] wrote: function $payment{ You probably mean payment, not $payment. header (location:test_page.html); The Location header has an uppercase L, a space after the colon, and an absolute URL after the space. Your example violates all three. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: function help redirect help
$payment = 1; function payment(){ global $payment; if ($payment == 0); header (location:test_page.html); } global $payment; elseif ($payment == 1) { header (location:test_page2.html); } __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: function help redirect help
Here is what Ihave I am getting a elseif parse error. Is there something I'm leaving out? Frank code --- $payment = 1; function payment(){ global $payment; if ($payment == 0); header (location:test_page.html); } global $payment; elseif ($payment == 1) { header (location:test_page2.html); } __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: function help redirect help
Remove the second 'global $payment;'. Regards. -Gregory -Original Message- From: Frank Tudor [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 2:01 PM To: 1PHP Subject: [PHP] RE: function help redirect help Here is what Ihave I am getting a elseif parse error. Is there something I'm leaving out? Frank code --- $payment = 1; function payment(){ global $payment; if ($payment == 0); header (location:test_page.html); } global $payment; elseif ($payment == 1) { header (location:test_page2.html); } __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ -- 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] database
I have try but I get the following error: Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/schoolre/public_html/Hitek/Online/connectie.php on line 16 Alain Jordan S. Jones [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Alain, You can pass it in the function as a variable. E.g... Function closeDB($ref_link) { mysql_close($ref_link); } closeDB($connectie); Hope this Helps, Jordan S. Jones -- I am nothing but a poor boy. Please Donate.. https://www.paypal.com/xclick/business=list%40racistnames.comitem_name=Jord an+S.+Jonesno_note=1tax=0currency_code=USD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: function help simple redirect
Sorry I'm getting this error message Parse error: parse error, unexpected T_ELSEIF __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: function help redirect help
--- Frank Tudor [EMAIL PROTECTED] wrote: I am getting a elseif parse error. Let me clean up your code a bit, and hopefully the error will stand out. function payment() { global $payment; if ($payment == '0'); header ('Location: http://example.org/test_page.html'); } global $payment; elseif ($payment == '1') { header ('Location: http://example.org/test_page2.html'); } Can you see the problem(s) now? Never underestimate the benefits of writing clean code. :-) Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: function help simple redirect
$payment = 1; function payment(){ global $payment; if ($payment == 0){ header (Location: test_page.html); } elseif ($payment == 1) { header (Location: test_page2.html); } } -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com ## Please, if you are using windows, you may be infected by Swen. Please go here to find out more: http://us.mcafee.com/virusInfo/default.asp?id=helpCenterhcName=swen http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED] ## Frank Tudor [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Sorry I'm getting this error message Parse error: parse error, unexpected T_ELSEIF __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: function help redirect help
I made the changes but I am getting: Parse error: parse error, unexpected T_ELSEIF I did take the second global statement out after I cut and pasted your code and modified the urls so now here is what it looks like (the whole thing). Frank ?PHP $payment = 1; function payment() { global $payment; if ($payment == '0'); header ('Location: http://ftudor/test/test_page.html'); } elseif ($payment == '1') { header ('Location: http://ftudor/test/test_page2.html'); } ? __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: function help redirect help
--- Frank Tudor [EMAIL PROTECTED] wrote: function payment() { global $payment; if ($payment == '0'); header ('Location: http://ftudor/test/test_page.html'); } elseif ($payment == '1') { header ('Location: http://ftudor/test/test_page2.html'); } Your code looks cleaner, so now isn't the error very obvious? It seems to me that you intended your first conditional statement to send the Location header when true. Therefore, you did not mean to put a semicolon there but rather a curly brace. This is why your function ends prematurely (assuming you did not intend for it to end there), and then you have an elseif statement dangling around with no corresponding if. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP with Frames (cont.)
No, he's right - this is an issue. Do variables persist between PHP files? In the attached scripts I have a login page which directs the user, on a sucessful login, to a front page which is a frameset. The login.php opens a connection to a MySQL database ($connection) but once the browser has been re-directed to the frame-root.html page this variable is no longer available. Kb wrote: Hi, Does anyone know why my PHP pages won't work in Frames? I have 5 frames, each of which are displaying PHP pages.and none of the PHP code works. If I run the code outside of Frames it works fine! I've can't find any decent references for PHP in Frames. Your help would be appreciated. Thanks Kevin -- UEA/MUS::Record Library -- UEA/MUS::Record Library -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: function help simple redirect
This one worked (kinda) I have no more errors but it doesn't do the redirect (hmmm)?? So now here is what it looks like: I am putting in the $payment=1; so it will automatically go to test_page2.html but it just sits there. Is there a headers thing already going on blocking this? I know don't need the quotes around the 1 because it's a number vaule and not a string. Can anyone think of any other reason why it might not work? Frank ?PHP $payment = 1; function payment(){ global $payment; if ($payment == 0){ header ('Location: http://ftudor/test/test_page.html'); } elseif ($payment == 1) { header ('Location: http://ftudor/test/test_page2.html'); } } ? __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: function help simple redirect
--- Frank Tudor [EMAIL PROTECTED] wrote: I am putting in the $payment=1; so it will automatically go to test_page2.html but it just sits there. [snip] header ('Location: http://ftudor/test/test_page2.html'); What happens when you type it into your browser manually? http://ftudor/test/test_page2.html That might be your problem now. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: function help simple redirect
On Monday, October 27, 2003 11:26 AM, Frank Tudor wrote: This one worked (kinda) I have no more errors but it doesn't do the redirect (hmmm)?? ?PHP $payment = 1; function payment(){ global $payment; if ($payment == 0){ header ('Location: http://ftudor/test/test_page.html'); } elseif ($payment == 1) { header ('Location: http://ftudor/test/test_page2.html'); } } ? You need to add payment(); to your php code. The function is defined, but it's not going to do anything until you call it. Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: function help redirect help
Can you see the problem(s) now? Never underestimate the benefits of writing clean code. :-) Hehe, you should see my code.. function dp_neg($v1,$v2){ $neg = ((substr((string)$v1,0,1)==-)||((substr((string)$v2,0,1)==-))); $bneg= ((substr((string)$v1,0,1)==-)((substr((string)$v2,0,1)==-))); if(!$bneg $neg){ $tmp=$v1*$v2; $tmp=(string)$tmp; $an=str_replace(-,+,$tmp); } else{ $an=-.($v1*$v2); } return $an; } function xyz($f,$s){ $f=s_str($f); $s=s_str($s); $t=($f==$s)?$f:s_str($f.$s); return $t; } function s_str($str) {$l=strlen($str);for($x=0;$x$l;$x++){$ar[]=$str{$x};}sort($ar);return implode('',$ar);} $e_a[0]=gs($e1);$e_a[1]=gs($e2); $e_a[2]=gs($e3);$e_a[3]=gs($e4); for($i=0;$i4;$i++){ $t[$i]=split(:,$e_a[$i]);} $r[0][0]=dp_neg($t[0][3],$t[2][3]); $r[0][1]=xyz($t[0][2],$t[2][2]); $r[1][0]=dp_neg($t[0][3],$t[3][3]); $r[1][1]=xyz($t[0][2],$t[3][2]); $r[2][0]=dp_neg($t[1][3],$t[2][3]); $r[2][1]=xyz($t[1][2],$t[2][2]); $r[3][0]=dp_neg($t[1][3],$t[3][3]); $r[3][1]=xyz($t[1][2],$t[3][2]); for($i=0;$i4;$i++){ $exp .= ((substr($r[$i][0],0,1)==-)?$r[$i][0].$r[$i][1]:($r[$i][0].$r[$i][1])). ;} No, that probably wont compile as that's only a little part of it, but still a pretty easy part of it.. :) -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com ## Please, if you are using windows, you may be infected by Swen. Please go here to find out more: http://us.mcafee.com/virusInfo/default.asp?id=helpCenterhcName=swen http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED] ## -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php