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 - cr

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: ; // loop through the resul

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] 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 repo

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: http:/

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: http://www.php.

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
minutes later: > Trend SMEX Content 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 (Wedne

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 particul

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 "mis"spellings, e.g. "fsck"? > > - what happens with dodgy formatting, e.g "f s c k"? > > - what ha

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

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. > And now we are experiencing a really heavy > load on the server. (no root access, but we think > it's PHP). You're running it on a server with no root access? Is it a

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 th

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 "unde

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 wit

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 unsubscrib

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

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 :-) R

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.

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 probabl

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

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, an

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 da

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: "; echo "a is $a"; echo "b is $b"; } test(1, 2); ?> C

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: Your browser sees this as an input with a value of "jane" and an attribute called "enterprises", which it doesn't recognise (and therefore ignores completely). Wh

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 dod

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 orig

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 incomplet

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 , wrap it in an , and use the onclick handler to call a javascript function that submits the form. Of course

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] 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 w

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 thi

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 (file_e

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

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: http:/

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 accor

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: http://www.p

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() f

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 = mktime(0,0,

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: $_SERVER['HTT

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] formtext

2003-03-03 Thread Jon Haworth
Hi Diksha, > Parse error: parse error in /var/www/html/bdoi_change/f1.php on > line 10 > > > > > > > > Business Directory Of India > > You can't use HTML directly when you're inside a PHP block - het rid of the ""; // etc Cheers Jon -- PHP General Mailing List (http://www.php.net/

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: > > echo" > Please enter other login id: > "; You need to escape the quotes inside the string, or use single quotes to define it. Either this: echo "Please ente

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 wr

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 "¶" instead, like this: $inputresult = str_replace('\n', '¶\n', $testtextarea); 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 d

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] table cell space under image in IE

2003-03-13 Thread Jon Haworth
Hi Larry, > Why would they have 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:

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 pag

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 Jo

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/ Chee

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] 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

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 .

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 st

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 large

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] 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 st

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, b

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:

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 se

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: http

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

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

2003-04-04 Thread Jon Haworth
Hi Dan, > the ini file looks like: hostip&user&password&databasename > 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, t

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: ... and then, o

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

2003-06-03 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: "; echo sec2hms(60). ""; echo sec2hms(66). ""; echo sec2hms(3600). ""; echo

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 ca

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: http://www.php.net/un

RE: [PHP] unix timestamp

2002-09-06 Thread Jon Haworth
Hi Andy, > I am trying to create a unix timestamp which dates back > a certain amount of days. Lets say I would like to have > a unix timestamp from 7 days ago. > what I tryed is just to subtract values since this are > counted s since the start of the unix epoche, but this > does not work in

RE: [PHP] Low Cost PHP Hosting

2002-09-06 Thread Jon Haworth
Hi Phil, > I am trying to find a low cost host for testing out PHP web applications on the Internet. http://34sp.com/ are pretty good, and at £15 a year (about US$20 I believe), they're certainly low cost :-) I'd stay away from http://zenithtech.com/ though, lots of people I know have had a ve

RE: [PHP] which version to use?

2002-09-06 Thread Jon Haworth
Hi Anil, > What version combinations of php and mysql should be used? PHP 4.2.2 is the latest and is highly recommended. For MySQL it depends somewhat on which features you need - if you can live without the stuff in the 4.x versions, you're probably best off with 3.23.52. Cheers Jon -- PH

RE: [PHP] Web based FTP client

2002-09-06 Thread Jon Haworth
Hi Mark, > I am trying to build or find a web FTP client. > I want it to look like a windows based FTP client a list box on one > site for the user's file system and a list box on the other for the > ftp server. A couple of s side by side should let you do that. The biggest problem I can see y

RE: [PHP] Calculating Totals from table columns without a second query to the DB

2002-09-06 Thread Jon Haworth
Hi Jay, > while($row = mysql_fetch_object($result)){ >print("" . $row->value . "\n"); >print("" . $row->another_value . "\n"); >$value1 = $value1 + $row->value; >$value2 = $value2 + $row->another_value; > } > > Challenge; Can this be made as simple for rows too? $val)

RE: [PHP] How to pass null as value?

2002-09-11 Thread Jon Haworth
Hi Chuck, > how do you pass null on to a page as a value. > Let say in a field where you have a yes and no. > Null needs to equal no. Pass from where? If it's a checkbox on a form, just use isset() to test for the existence of the variable: true means it's ticked, false means it isn't. If i

RE: [PHP] stopping repeated posts to a Bulletin Board

2002-09-17 Thread Jon Haworth
Hi, > What is the best way to avoid the "repeated comment/post" > syndrome caused by the user clicking the submit button one > too many times The canonical way is to attach a token to the form (a random number will usually do) and insert that into the table along with the comment/post, after

RE: [PHP] Auto-increment value

2002-09-18 Thread Jon Haworth
Hi Bob, > SELECT idno ORDER BY idno DESC LIMIT 1; > assuming idno is what gets auto incremented That's not the best idea - what happens if two users are inserting records into the table at nearly-but-not-quite the same time? 1. Insert A goes through 2. Insert B goes through 3. LastID A returns

[PHP] Best practice question

2002-09-19 Thread Jon Haworth
Hi list, What are peoples' thoughts on "one should always return a value from a function, even if it's always going to be true"? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Best practice question

2002-09-19 Thread Jon Haworth
Hi Adam, > > What are peoples' thoughts on "one should always return > > a value from a function, even if it's always going to be > > true"? > > > I'd say skip it if you know your never returning anything > different. Yeah, that's what I was leaning towards :-) What prompted the question wa

FW: [PHP] about forms with php

2002-09-20 Thread Jon Haworth
Hi, > onSubmit="checkemail(email.value);return false" > > > and when I click submit.. javascript is working but > it is not going to the sign_up_ page .. It's because of the "return false": that means "after running the checkemail function, cancel the form submission". I think you want t

RE: [PHP] about forms with php

2002-09-20 Thread Jon Haworth
Hi, > by the way If I remove return false .. script is > checking the correctness but just after it is going > to the page "sign_up_ page .php "..I just want > it to go to the page when the email is correct .. > Is it possible to manage ? Yes. You need to have the "return true" or "return fa

RE: [PHP] Function: return multple values

2002-09-23 Thread Jon Haworth
Hi Faisal, > Is it possible to return multiple values in a function. > For instance, i want to do something like this: > > function calculate_money($sum) > { > // some hanky panky calculations > return $type; > return $amount; > } You have to return the values in an array, and use list()

RE: [PHP] == case-sensitive?

2002-09-23 Thread Jon Haworth
Hi Hawk, > I've never really payed attention to this before, > but now I noticed that == is case-sensitive, how > do I make it == with different "cases" ? Just force the case while you're comparing the two: if (strtolower($a) == strtolower($b)) { echo "case-insensitive match"; } else { ec

RE: [PHP] mysql_num_rows error

2002-09-23 Thread Jon Haworth
Hi Nick, > I am new to php and that the folowing error: > Warning: mysql_num_rows(): supplied argument > is not a valid MySQL result resource in > /home/tbonestu/public_html/smallimages.php > > i dont know what i am doing wrong here is the code: > > @ $db = mysql_pconnect(connect info); Alo

RE: [PHP] URL Rewriting

2002-09-23 Thread Jon Haworth
Hi Bill, > I've been using PHP for a couple of years now and only > recently (since upgrading to RH7.3) began to > experience an odd problem. When navigating around my > site or when I run HT://Dig across it the links are > suddenly being rewritten back as > http://my.dom.com/some_page?PHPSESSID

RE: [PHP] Stress Test Script?

2002-09-25 Thread Jon Haworth
Hi Jay, > Does anyone have a good php script that will > test (i.e. benchmark) my MySQL machine and my > Web server? Give ab a go - it comes with Apache, you should find it in your bin/ directory. "man ab" for all the gory details. Cheers Jon -- PHP General Mailing List (http://www.php.net

RE: [PHP] Time is off?

2002-09-25 Thread Jon Haworth
Hi Brandon, > I did a basic script and the > time is off in that script [...] I have checked the > server time and the server hardware clock. Well, date("h:I") means "display the hours (in 12-hour format), followed by a colon, followed by a 1 or a 0 depending on whether daylight saving is i

RE: [PHP] quick mysql question

2002-09-27 Thread Jon Haworth
Hi Doug, > where can i find info on setting up a mysql > database on a remote server? i know how to > set them up on a local machine, but i can't > figure out how to get to the command line > setting on a remote server... me@mybox:~$ ssh my.remote.server Or am I missing something? Cheers J

RE: [PHP] Recursive Replace

2002-10-02 Thread Jon Haworth
Hi Rick, > How can I combine that line of code with > str_replace() or some other replace function > in order to turn "\n" into "" for each line. I think you're looking for http://www.php.net/nl2br. Specifically: for ($i = 7; $i < sizeof($info); $i+=1) echo nl2br($info[$i]); Cheers

RE: [PHP] Getting users IP address into a variable.

2002-10-02 Thread Jon Haworth
Hi, > > I'm sure there has to be a way to verify which IP > > address is accessing from. > > $ip=HTP_GET_ > > $REMOTE_ADDR ...and to deal with some (but not all) proxies: $ip = (getenv("HTTP_X_FORWARDED_FOR")) ? getenv("HTTP_X_FORWARDED_FOR") : getenv("REMOTE_ADDR"); Either wa

RE: [PHP] the files I'm working with

2002-10-04 Thread Jon Haworth
Hi Marek, > safe enough would be to put this at the begining > if(!ereg('^[0-9]+$',$song) { > die('Sorry...') > } Sure, but why incur the expense of using the ereg() parser? If you're only ever going to be testing whether $song is a number or not, use http://php.net/is-numeric. Cheers Jon

  1   2   3   4   >