RE: [PHP] Dear Lazy Web: Pseudo Randomisation Strategies on Listing Websites

2010-08-20 Thread Jon Haworth
Hi Col, Interesting problem. Are there any other approaches I've missed? Off the top of my head, how about this: 1. Add a new unsigned int column called SortOrder to the table of widgets or whatever it is you're listing 2. Fill this column with randomly-generated numbers between 0 and

RE: [PHP] Text editor

2010-07-27 Thread Jon Haworth
Hi Jordan, Do you somebody know some simple text editor with buttons for bold italic etc. TinyMCE is worth a look: http://tinymce.moxiecode.com/ HTH Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Counting back 90 days...

2004-01-05 Thread Jon Haworth
Hi Tris, But is there an easy was to calculate 90 days from the timestamp... There are 86400 seconds in a day... can't you just do something like: $timestamp -= (86400 * 90); Or even $timestamp -= 7776000; // 90 days Cheers Jon -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] register_globals security

2003-11-13 Thread Jon Haworth
Hi Fernando, I have a PHP application that passes variables (values) from a form. I get these using $_POST However I do also post some variables via a link. Which ofcourse requires register_globals to be ON. Do you mean variables in a URL, like this: www.example.com/index.php?foo=1bar=2

Re: [PHP] Allowing specific IP's to bypass security.

2003-10-21 Thread Jon Haworth
Hi Tris, reset the session variable: $_SESSION['details_captured'] == FALSE; Re-asign it to yes: $_SESSION['details_captured'] == yes; You're using ==, which is the comparison operator - give it a go with just a single = instead. Cheers Jon -- PHP General Mailing List

Re: [PHP] Resource Limits

2003-09-27 Thread Jon Haworth
Hi, How can I get the values of 'max_execution_time', 'max_input_time' and 'memory_limit' from my php script ? Use the ini_get function: http://php.net/ini-get Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Editor - which to use?

2003-09-24 Thread Jon Haworth
Hi, Good coder will understand this at a glimpse: [snip horrible code] if($pos_params!=false) Assuming it's a boolean, $pos_params is *already* true or false, so testing it like this is pretty much pointless. It makes more sense (and is much more readable IMHO) to do something like this: if

Re: [PHP] Getting part of a string...Was protecting a file via php

2003-09-16 Thread Jon Haworth
Hi Steve, $pfile = str_replace('get.php?file=','','$file'); $p = explode('.', $pfile); // How do I say look at the extension and put it into the switch? $extension = $p; // end of the bit I'm stuck on. At this point $p is an array rather than a variable, so you'll need to get the last

Re: [PHP] Training Help

2003-09-12 Thread Jon Haworth
Hi Ryan, Sounds like register_globals is turned off on your server (this is generally a Good Thing). Rather than having all your form fields converted directly into variables - which your book is assuming, as it's how PHP used to do it - you'll need to access them via the $_POST array. Try

Re: [PHP] Training Help

2003-09-12 Thread Jon Haworth
Hi Ryan, $tireqty = $_POST['tireqty']; $oilqty = $_POST['oilqty']; $sparkqty = $_POST['sparkqty']; That'll certainly fix the problem, but it kind of defeats the point of using $_POST :-) Ideally you'd clean the data at this point to make sure no-one's trying to submit anything nasty (Google

Re: [PHP] game in php

2003-09-07 Thread Jon Haworth
Hi, I have this database with this fields; id and number_attacks. And every 10 minutes number_attack to be increased by 1. You'll need to set up some sort of scheduled task (if you're on unix, your best bet is probably cron) - this task should call a script that connects to your database and

Re: [PHP] Can Objects be passed to another page?

2003-09-03 Thread Jon Haworth
Hi, is it possible to pass an Object to another php page? Have a look into serialization: http://php.net/manual/en/language.oop.serialization.php Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] snippet

2003-08-05 Thread Jon Haworth
Hi Harry, can someone explain this for me: ... $sFont =submit(font) ? SITE_ROOT . PROG_PATH . submit(font) : ; ... It's called the ternary operator, and it's a shorthand for if...else... The line you're asking about is equivalent to: if (submit(font)) { $sFont = SITE_ROOT . PROG_PATH .

Re: [PHP] controlling winamp with COM

2003-07-22 Thread Jon Haworth
Hi, It might even be possible that Winamp itself provides hooks to a running instance of itself via command line parameters (one can hope) which would simplify the task greatly. Winamp (v2 at any rate, I haven't worked with v3) has a great API, including hooks via the command line, which is

Re: [PHP] How to..

2003-07-21 Thread Jon Haworth
Hi Haseeb, i.e. divide the functions into files. and then include only that file that has the function. That's how I usually do it - for example, I have a file called dates.lib.php which contains all my functions for handling dates and times, a file called db.lib.php which has my database

Re: [PHP] News Reader

2003-07-21 Thread Jon Haworth
Hi David, Could someone advise me of a good news reader. Agent is pretty good: http://www.forteinc.com/agent/ Mozilla has a mail and news component, which you can download on its own if you don't want the browser, IRC client, HTML editor, etc: http://www.mozilla.org/projects/thunderbird/

Re: [PHP] Help with Date

2003-07-21 Thread Jon Haworth
Hi Elliot, I need a function to create the dates of previous Fridays, in 21-JUL-2003 format. It'll be different depending on what you want to happen if you pass a Friday timestamp to the function, but it should be something like: function friday($ts) { while (date(w, $ts) != 5) $ts -=

Re: [PHP] Help with UPDATE command...

2003-07-19 Thread Jon Haworth
Hi Tony, The UPDATE command does not seem to support the ORDER BY part despite it being listed in the instructions on the mysql.com website. This is only supported in versions 4 and above - if you're using 3.23 you can get away with LIMIT in your update queries, but not ORDER BY. Cheers Jon

Re: [PHP] Communication between PHP Server code and HTML/JavaScript client without refreshing the page

2003-07-04 Thread Jon Haworth
Hi Sharat, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I don't think this is possible: once PHP has run (and sent your Javascript to the browser), it's finished - you can't use it again until the next time the page

Re: [PHP] - Default Date

2003-06-23 Thread Jon Haworth
Hi Gary, Is there a default variable built into PHP that has today's date? Have a look at http://php.net/date for this - http://php.net/mktime will probably be of interest as well. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] typecasting .. easy?

2003-06-19 Thread Jon Haworth
Hi Roy, If $amount equals for example 52., how do I get that to print as 52.00 similarly, if amount = 52.5 how do I get that to print as 52.50 Have a look at the number_format() function, it should do what you want. It'll also add commas to break up any thousands in your number (you can

RE: [PHP] convert seconds to hours, minutes, seconds

2003-06-04 Thread Jon Haworth
Hi Chinmoy, I have a value 178607, which is stored as seconds. I like to convert it (178607 Secs) to Hours, Minutes and Seconds appropiatly. Can anybody help me supplying the code? Try something like this: ?php function sec2hms ($secs) { $hms = ; $hours =

RE: [PHP] determine action of a form dynamically?

2003-06-03 Thread Jon Haworth
Hi Mukta, I want action of a form to be PHP_SELF untill user presses continue button. If continue button is pressed than next.php should be the action of the form. how to do this? One way would be to have two buttons in your form, but submit to only one page: form action=process.php input

RE: [PHP] Opinion on a method....

2003-04-04 Thread Jon Haworth
Hi Dan, I would like to get some opinions here on a method I'm doing to grab connect information for a mysql connection. Currently I am doing: $pinfo = fopen (/director1/directory2/filename.ini,r); Does this filename.ini contain the code to connect to your database? If so, I usually do two

RE: [PHP] Opinion on a method....

2003-04-04 Thread Jon Haworth
Hi Dan, the ini file looks like: hostipuserpassworddatabasename after I import it, I split it up, and assign each to a variable name. I also have it outside the doc root, and it gives a generic error msg for every error in the system. Should do it - it's a bit of a long-winded route, though.

RE: [PHP] checkdate function

2003-04-01 Thread Jon Haworth
Hi Siva, checkdate function verifies whether the date is valid or not by taking month, day and year as arguments. The problem is when someone enters a three digit year by mistake (200 instead of 2003), this function does not catch it. Yes, I've been bitten by this as well :-) We are

RE: [PHP] FTP

2003-04-01 Thread Jon Haworth
Hi Tomás, What's the meaning of this error?: FTP_PUT: Could not determine CWdir: No such directory. ^ Are you trying to save a file in a directory that doesn't exist? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] [Newbie] Password()

2003-03-31 Thread Jon Haworth
Hi Bobby, In my code I am trying to send an email (containing a password) to a user when he has forgotten his password. [...] The problem is that security leads to needing to encrypt passwords in the database. Im using the password function within mysql. Is there any way of reversing the

RE: [PHP] problem with mysql.

2003-03-31 Thread Jon Haworth
Hi Ryan, when configuring php i use --with-mysql and it configures just fine. i've even added an =/path/to/php after it to no avail. Try --with-mysql=/path/to/mysql instead of --with-mysql=/path/to/php. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] global var.

2003-03-31 Thread Jon Haworth
Hi Sebastian, $variable = $id; // some other stuff @mysql_query here $id = mysql_insert_id(); How do I get $id from insert_id() to pass to $variable above? Hard to explain the situation i am in, but the query has to be below $variable ::blink:: Perhaps something like: $loc =

RE: [PHP] Session Theft

2003-03-28 Thread Jon Haworth
Hi Haseeb, if i can get something from user end that is unique for that user.for e.g. his/her IP . Firstly, an IP address can be shared between multiple users, or it can change constantly for one user. Here's what a page request from an AOL user looks like (I've snipped the request paths,

RE: [PHP] connecting to mysql db

2003-03-25 Thread Jon Haworth
Hi Iggy, I mean the difference between having that code on every page or calling it from an external page doesn't tell me if it is realy necessary to do it all the time. Yes, you do have to connect to the database in every script that needs to access it. Usually this is done at the start

RE: [PHP] random letter/character?[Scanned]

2003-03-19 Thread Jon Haworth
Hi, function gen_password($length = 8) { $chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789; [snip] Just as a tip - if you want to save hassle for yourself and your users, remove the following characters from that string: - 1 (number one) - l (lower-case letter L) -

RE: [PHP] Re: newbie:restricting users to change data in a textarea

2003-03-18 Thread Jon Haworth
Hi Coert, There is one field that I whant to stop them from changing You can put READONLY in your TEXTAREA tag While this would probably keep the honest people honest (assuming it's supported across all browsers), it won't stop anyone who wants to pollute the database. What's to stop

RE: [PHP] querying for values inside range

2003-03-18 Thread Jon Haworth
Hi Jason, $sql = select * from table where age=$age1 and age=$age2; what if i don't know which is value is greater, age1 or age2? PHP has a couple of handy functions for this: min() and max() $min = min($age1, $age2); // get smallest of two values $max = max($age1, $age2); // get largest of

RE: [PHP] table cell space under image in IE

2003-03-13 Thread Jon Haworth
Hi Larry, Why would they have /form take up visible space? It's a block-level element, like a paragraph or a div. Hmm, I guess I'll have to find a new angle or hide the closing form beyond the table. You don't have to resort to kludges, just tell the browser what you actually want: td

RE: [PHP] how to uploads files

2003-03-12 Thread Jon Haworth
Hi Luis, how can i uploads files to my server by php script ? The manual explains this (read the user notes as well, though): http://www.php.net/manual/en/features.file-upload.php Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] rates for differents date?

2003-03-07 Thread Jon Haworth
Hi Shaine, ok question: 7days in a week. day 1-2 costs $10, day 3-5 cost $15, day 4-7 costs $10. I'm assuming you meant 6-7 here instead of 4-7, otherwise you've introduced a contradiction with days 3-5. how can I work out the total if someone stays from say day 2-5? or what about day

RE: [PHP] \n

2003-03-04 Thread Jon Haworth
Hi John, Nothing fancy. Can't get it to echo ¶ Is that a pilcrow sign? If so, have you tried para; instead, like this: $inputresult = str_replace('\n', 'para;\n', $testtextarea); Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] formtext

2003-03-03 Thread Jon Haworth
Hi Diksha, Parse error: parse error in /var/www/html/bdoi_change/f1.php on line 10 html head title /title /head /body h1Business Directory Of India/h1 pre ?php form You can't use HTML directly when you're inside a PHP block - het rid of the ?php on line 9, or use echo from line

RE: RE: [PHP] formtext

2003-03-03 Thread Jon Haworth
Hi Diksha, Parse error: parse error, expecting `','' or `';'' in /var/www/html/bdoi_change/f1.php on line 11 the code is: ?php echoform Please enter other login id:input type=text name=login /form; You need to escape the quotes inside the string, or use single quotes to define it.

RE: [PHP] info required reg. PHP

2003-03-03 Thread Jon Haworth
Hi, 1) Can we display an alert box using PHP. No, you need to use Javascript's alert() function. PHP is server-side only. 2) I would like to know the max. number of records or max. space a database (mentioned below) can provide. Oracle, MySQL and SQL Server are limited only by the space

RE: RE: [PHP] formtext

2003-03-03 Thread Jon Haworth
Hi Diksha, Please excuse the line wrapping in my last post - you may have to copy 'n' paste into a text editor to see it as it should be :-) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] PHP on IIS session problems

2003-03-03 Thread Jon Haworth
Hi Victor, Warning: session_start() [function.session-start]: open(/tmp\sess_f4aa3ef3c537bb6327d5e7b991e91be7, O_RDWR) failed: No such file or directory (2) in c:\inetpub\wwwroot\picoblog\admin.php on line 2 Pay attention to the error messages. This one explains exactly what you're doing

RE: [PHP] Preventing the hijacking of pictures

2003-02-28 Thread Jon Haworth
Hi, $_SERVER[HTTP_REFERRER] does not help. Not sure if you've got it that way in your code, but that might be because it's spelt HTTP_REFERER - yes, it's wrong, you're right, but you have to live with it :-) I think you may also need to quote it like this, but I'm not sure:

RE: [PHP] Capitalising Personal Names

2003-02-28 Thread Jon Haworth
Hi Danny, I need to clean up the capitalisation of user-entered personal names. Well it's hardly rocket science - a flick through the manual and I came up with : $name=ucwords(strtolower($name)); While that would work in many cases, how do you catch exceptions such as the following?

RE: [PHP] date, first of next month?

2003-02-27 Thread Jon Haworth
Hi Bryan, $t = mktime(0,0,0,date('m')+1,1,date('Y')); Gives you timestamp of first day, next month. Format accordingly with date(). is there such a say to now get the date of the first weekday after that date? You can brute force it: // grab the timestamp $t =

RE: [PHP] Date check

2003-02-11 Thread Jon Haworth
Hi Fredik, I have to dates that i want to check who is biggest. This does not work: if( $date1 $date2){ How can i check them? Presumably they're in SQL format, or something similar? The easiest way is to convert them to unix timestamps (look into the date() and mktime()

RE: [PHP] Dynamic input fields in Form

2003-02-07 Thread Jon Haworth
Hi Frank, I have a form where the user selects for example; how many cars you have: 4. Then it most dynamicly create 4 input fields [...] Using only PHP, you'll have to make this a two-step process where page 1 collects the number of cars and posts to page 2, which generates the form

RE: [PHP] mysql auto increment question

2003-02-07 Thread Jon Haworth
Hi Robbert, Is there an easy way to find out what the auto_incremented number is so I can use it to update the other table? Sure, have a look at mysql_insert_id: http://php.net/mysql_insert_id Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Include today's date in a SQL statement?

2003-02-05 Thread Jon Haworth
Hi Brian, What would the SQL be to find a record where: start_date today = end_date ... WHERE start_date today AND today = end_date If you're asking how do I get today's date into an SQL statement, there are two ways: - use your DBMS's built-in function to get today's date - use PHP's

RE: [PHP] Documentation Help

2003-02-05 Thread Jon Haworth
Hi Hardik, I worked on educational intranet and library management system. I did comment my code but i dont know how to document functional and technical specification as well as database schema. Theoretically, you should write the specs before the program (that way, the program matches

RE: [PHP] reading CD information

2003-02-05 Thread Jon Haworth
Hi Adam, Is it possible to have PHP read cd label information? Where is the CD? If it's in the CD-ROM drive of the webserver: probably. If it's in the CD-ROM drive of a visitor to your website: no. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] HTML if no PHP

2003-02-04 Thread Jon Haworth
Hi Bob, I want to display an HTML page if PHP can't load an include file or otherwise has an error or just doesn't work. How do I do this? Not sure you can, especially not for the just doesn't work scenario. FWIW, you can test for the existence of a file before including it: if

RE: [PHP] SQLqry in PHP

2003-01-30 Thread Jon Haworth
Hi Per, I try to use a SQLqry in PHP, but i get this anwser in my browser: FATAL: emalloc(): Unable to allocate 1073741824 bytes 1,073,741,824 bytes is exactly 1 gig - that's a *lot* of memory... Is this an astonishingly large query? Seems the PHP interpreter can't grab enough memory to do

RE: [PHP] SQLqry in PHP

2003-01-30 Thread Jon Haworth
Hi, Yes, the field in the mssql database is 1073741824, but i want only to grab a few byte. I think you'll need to do this in the database, then. If you try and grab the whole field and then parse it in your script, you have to actually get that gig of data into your script - I assume this

RE: [PHP] A way to break up the string????

2003-01-29 Thread Jon Haworth
Hi Scott, Just curious, is there a PHP function that will break up the string for us? http://php.net/explode Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Adjusting Indexed Field After Deleting Entry

2003-01-27 Thread Jon Haworth
Hi, I originally had a link #1, #2, and #3. I obviously deleted them. I was wondering if there is a way to use PHP/MySQL to get the indexed numbers to re-assign so that the first link you see is always #1 the second link you see is always #2 and so on? Thanks in advance, Roger PS The

RE: [PHP] Adjusting Indexed Field After Deleting Entry

2003-01-27 Thread Jon Haworth
Hi, I originally had a link #1, #2, and #3. I obviously deleted them. I was wondering if there is a way to use PHP/MySQL to get the indexed numbers to re-assign so that the first link you see is always #1 the second link you see is always #2 and so on? (apologies for previous incomplete

RE: [PHP] IFRAMES PHP

2003-01-27 Thread Jon Haworth
Hi Greg, But the buttons are outside of the iframe, so that no matter how large the frame gets, the buttons are always in the same place :/ So stick an image of the button outside the iframe, wrap it in an a, and use the onclick handler to call a javascript function that submits the form. Of

RE: [PHP] A rather strange problem.

2003-01-23 Thread Jon Haworth
Hi Denis, if the field is Jane Enterprises, the textbox shows only jane. At the moment, if you view the HTML, you'll see: input value=Jane Enterprises Your browser sees this as an input with a value of jane and an attribute called enterprises, which it doesn't recognise (and therefore

RE: [PHP] $_GET space in index changed to underscore

2003-01-23 Thread Jon Haworth
Hi Per, Anyone who knows why get variables whit spaces in looking like this in the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in $_GET['aa_bb'] instead of $_GET['aa bb']? I don't think spaces are legal in variable names - PHP's probably just trying to recover from the dodgy

RE: [PHP] Problem with functions

2002-12-20 Thread Jon Haworth
Hi, I keep getting errors in my script that says 'x' function is undefined or 'y' function is undefined. I defined it as 'function test ($a, $b)' and call it using 'test($a, $b)' You need to post code :-) Try this: ?php function test ($a, $b) { echo I am the test functionbr /;

RE: [PHP] Displaying first 20 characters of a comment

2002-12-19 Thread Jon Haworth
Hi Kevin, I am trying to find out what the best way is to display only the first 20 or so characters of a comment. [...] I am not sure if it is best to do it with the select statement or format it with the PHP. Either way I am not sure how. If you only want the first 20 characters, and

RE: [PHP] validate date

2002-12-19 Thread Jon Haworth
Hi Diana, If a user inputs a date into a form, what function can I use to validate that he put in a valid date? You can't. Here are two dates in two different formats. Only one is valid. - 13/04/01 - 13/04/01 Can you spot which is which? I want to use checkdate but that needs the date

RE: [PHP] Undefined variable error message

2002-12-18 Thread Jon Haworth
Hi Michael, All of the PHP scripts hosted on a Linux server I'm working with have suddenly begun producing an error message: undefined variable 'variablename' Looks like someone's tweaked the error reporting level so it's on E_ALL, which can be a somewhat alarmist setting :-) Read

RE: [PHP] Javascript var to PHP

2002-12-18 Thread Jon Haworth
Hi Cesar, I want one of my links to open a brand-new pre defined window using a javascript but I don't know how to pass a variable so the opened PHP file knows which info to get from MySQL... In your launchinfopage() function, presumably you're specifying the url of the page (foo.php

RE: [PHP] Javascript var to PHP

2002-12-18 Thread Jon Haworth
Hi Cesar, Jon, thanx for the fast response, but the problem is that the link is made dynamically from a DB and the varvalue changes on every link... if it helps, I make this link list with a FOR loop in PHP and the varvalues I want to pass are the IDs of a table elements. You probably

RE: [PHP] How to upload a file

2002-12-18 Thread Jon Haworth
Hi Somesh, This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. What's your upload_max_size set to in php.ini? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] How to upload a file

2002-12-18 Thread Jon Haworth
Hi Somesh, This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. What's your upload_max_size set to in php.ini? It is as follows ; Maximum allowed size for uploaded files. upload_max_filesize = 8M I don't have a clue then, sorry :-(

RE: [PHP] Use of undefined constant error

2002-12-17 Thread Jon Haworth
Hi, Notice: Use of undefined constant id - assumed 'id' in ... Try changing this: if(isset($_GET[id])){ to this: if(isset($_GET['id'])) { note quotes PHP thinks you're trying to use a constant called id, which you haven't defined - hence the undefined

RE: [PHP] Showing 10 record items per page...?

2002-12-17 Thread Jon Haworth
Hi David, If I have lets say 30 items that match the query, I would like the page to display this at the bottom Previous 10 page 1 2 3 Next 10 of 30 To get the 20 results starting at #100, your query will be something like SELECT foo FROM bar LIMIT 100, 20 To do paged results with

RE: [PHP] PHP with GD Support

2002-12-17 Thread Jon Haworth
Hi Oliver, ich want to install php.4.2.3 with gd-suport. Any hints are welcome. You'll need to look it up, or do a configure --help or something, but I imagine you compile with something like --with-gd=/path/to/gd Cheers Jon -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] if question

2002-12-17 Thread Jon Haworth
Hi John, Can anyone tell me why this doesn't seem to work ?? It probably is working, but it's obviously not doing what you want :-) if (($stelle_who != '1') OR ($stelle_who != '2') OR ($stelle_who != '3') OR ($stelle_who != '5') ) { This will always evaluate to true: if $stelle_who is

RE: [PHP] Performance issues

2002-12-12 Thread Jon Haworth
Hi Karel, mysql entries: at least 2M php code: at least 1M lines More than a million lines of code? That's a *big* app. 1megabyte of code :) not 1M lines Aha :-) and the problem began slow, not noticable... But it's now worse then ever. Are you doing something that degrades,

RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Hi Christopher, I'm wondering if someone has a great source for a master-list of controversial and vulger words that I can use on my site. I would like to pattern match input text against this master-list in order to prevent vulger and controversial words from appearing on my site.

RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Filter has detected sensitive content. Place = 'Christopher Raymond'; [EMAIL PROTECTED]; Sender = Jon Haworth Subject = RE: [PHP] Filter vulger / controversial words - need word source Delivery Time = December 11, 2002 (Wednesday) 22:13:00 Policy = Dirty Words Action on this mail = Delete

RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Following up to my own post And again... I wonder if it was Shorpe I suppose I'll find out when/if I get another bounce :-) I got another bounce :-) Whoever is running this filter obviously doesn't want to do business with any of the 70,000 odd people who live in a particular

RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Hi, I think we've seen this discussion on the list before (so Christopher, check the archives!) Quite :-) The problems that others have experienced in the past are: - what happens with misspellings, e.g. fsck? - what happens with dodgy formatting, e.g f s c k? - what happens with

RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Hi Sean, if you want a partial list of offensive terms - try looking at the meta keywords on a few porn sites ... Excellent idea! Unfortunately I'd have to explain that to my boss... No, really, I'm doing some research... Cheers Jon -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
if you want a partial list of offensive terms - try looking at the meta keywords on a few porn sites ... Excellent idea! Unfortunately I'd have to explain that to my boss... No, really, I'm doing some research... but won't your gateway/web server's filter prevent access to such

RE: [PHP] How know from wich page you came from

2002-12-10 Thread Jon Haworth
Hi Rodrigo, Hi guys I need a way to know how to know from wich page the visitor came echo $_SERVER[HTTP_REFERER]; HTH Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] run query

2002-12-10 Thread Jon Haworth
Hi Diana, After I run a query lik this, $db-query($sql); what is the quickest way to find out how many records result? Look into mysql_num_rows (or the equivalent if you're not using MySQL) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Pls Help: Moving script from Win to Linux

2002-12-10 Thread Jon Haworth
Hi Shane, I can pass variables till I am blue in the face, even see them in the URL but they are still showing up as (!isset) Are you accessing these variables through $var or $_GET[var]? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Creating a report in PHP

2002-12-09 Thread Jon Haworth
Hi Todd, Is there a report generator that will give me the flexibility to use fonts and fontfaces that works with PHP and MySQL? I don't know of a PHP-based report generator (although a hunt round sourceforge might turn something up), but you can: 1. use PHP scripts to output your reports

RE: [PHP] How do I run a command as root?

2002-12-02 Thread Jon Haworth
Hi Luke, I'm trying to find out how to run a command on the server as root. Does anybody know how to do this? How about using a combination of exec() and sudo (assuming you're in the sudoers file, that is)? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Newbie Question

2002-12-02 Thread Jon Haworth
Hi Hacook, I have a mySQL database called srchresult in a srchresult base. In it, i have 9 fields. Everything works perfectly. I would like to know how can i list in a HTML table 30 results for example but only with 7 columns (7 fields only) ? Try this: ?php // open the db connection -

RE: [PHP] Who can tell me the best php-base webmail?

2002-12-02 Thread Jon Haworth
Hi Joskey, Who can tell me the best php-base webmail? IMP (http://www.horde.org/imp/) is pretty good, I use it for my webmail and don't have any complaints. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Hello ! How to write a programme in PHP which executes a routine at a given time ?

2002-11-28 Thread Jon Haworth
Hi Jonathan, Do you mind to tell me how to make a PHP programme to execute a centian routine at a given time ? Thank you ! PHP doesn't have anything built in that'll do this for you (at least, nothing that I'm aware of). The best solution is to call your script from your OS's scheduler -

RE: [PHP] character ' in switch

2002-11-21 Thread Jon Haworth
Hi Martin, I would like to know how can I put ' character to case in switch... switch ($action) { case about: code break; case what's new: -- i want this... code break; Try wrapping the cases in quotes: switch ($action) { case about:

RE: [PHP] url - self

2002-11-21 Thread Jon Haworth
Hi Paul, I just need to know how to get the url of the page calling the function so I can delete the information from the appropriate table. Does $PHP_SELF not give you what you're after? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] New generation of PHP Program, reaction to ASP.NET

2002-11-20 Thread Jon Haworth
Hi, Are you interested in this?! New generation of PHP Program, reaction to ASP.NET I saw it when you posted it yesterday and tried it out, but it didn't work for me. I imagine this is because I've disabled Javascript. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] Loooooooooonnnnnnnnnnggggggggg

2002-11-19 Thread Jon Haworth
Hi, I made a script that works on a very long charachter chain and its process is lnggg about 5 minutes ! Do you have any tips to make it faster ? My mysterious ninja PHP developer powers have told me that you need to fiddle with lines 23 and 72, that's where it's slowing down.

RE: [PHP] something like array_walk?

2002-11-15 Thread Jon Haworth
Hi, I want to take an array and get the soundex() for each element in that array and return the results into another array. How about: $color = array(blue, green, orange, purple, red, yellow); $soundex = array(); foreach ($color as $foo) { $soundex[] = soundex($foo) } HTH Cheers Jon

RE: [PHP] I'm in need of a PHP web host recommendation

2002-11-15 Thread Jon Haworth
Hi Phil, would like to hear some recommendations of some good companies that host PHP/MySQL and also JSP. http://34sp.com/ are great if you don't mind .uk-based hosting. I've heard good things about http://oneandone.co.uk/ but haven't used them myself. At the other end of the scale, you

RE: [PHP] Re: How do i make an upload script?

2002-11-14 Thread Jon Haworth
Hi, How do i make an upload script? http://us.php.net/manual/en/features.file-upload.php ok, this is upload.php: form enctype=multipart/form-data action=upload.php method=post input type=hidden name=MAX_FILE_SIZE value=1000 Send this file: input name=userfile type=file input

RE: [PHP] airport codes db

2002-11-13 Thread Jon Haworth
Hi Eddie, I am working on a php page where I need some airport codes data, I have seen a few places online where you can buy this data so I was wondering if anyone has used any of these databases and if anyone had a good source for a mysql airport code db. Google is your friend.

RE: [PHP] Can somebody help me with making a login Script?

2002-11-12 Thread Jon Haworth
Hi Matt, can somebody please help me make an login script step one by one? My website is Http://tweak2x.cjb.net and I am looking for a login section for memebers. Start by reading this article: http://zend.com/zend/tut/authentication.php And then get back to us with any problems you run

RE: [PHP] random numbers

2002-11-12 Thread Jon Haworth
Hi Tamas, /* srand is not important since php v=4.2.0 */ $numbers = range (1,90); $x = array_rand ($numbers, 5); foreach ($x as $v) echo {$numbers[$v]} ; It works fine, except the first query: php may restart the random numbers, if it is not used for some seconds. I'm not sure how to

RE: [PHP] random numbers

2002-11-12 Thread Jon Haworth
Hi Tamas, ?php for ($i=1; $i=6; $i++) $x[] = mt_rand(1, 90); foreach ($x as $current) echo $current. br /; ? Thanks for help, but your program may generate same numbers between the 5 generated numbers, hovewer I want to generate different numbers such as lottery-numbers.

  1   2   3   4   >