[PHP] Re: [PHP-DB] Radio buttons

2002-08-26 Thread Support @ Fourthrealm.com
Your radio buttons look fine. I would ensure to add quotes (single or double) around the attribute settings, for HTML compliance. If you must go without quotes, then make sure that you don't put spaces in any of the attribute values. INPUT type=radio value=6 name=surf_erf As for the form

Re: [PHP] help me regarding redirecting a page

2002-09-09 Thread Support @ Fourthrealm.com
Anjali, Use a BUTTON type element, and some javascript: INPUT TYPE=button VALUE=Cancel Return to menu ONCLICK=self.location=menu.ihtml' Peter At 01:57 PM 9/8/2002 -0700, you wrote: hello, i dont know how to redirect a page... i mean i want to have the effect of submit button without

Re: [PHP] select box

2002-09-09 Thread Support @ Fourthrealm.com
If you want to put the SELECTED option into your select list while you are building the page, use an if statement in the option... ... something like this: OPTION VALUE=1 ?php if ($this==$that) {echo SELECTED; } ? Option 1 OPTION VALUE=2 ?php if ($this==$that2) {echo SELECTED; } ? Option 2

Re: Fw: [PHP] Re:[PHP]question

2002-09-11 Thread Support @ Fourthrealm.com
Meltem, You're much better off to use JavaScript to perform the form validation. This way, when the user clicks on the Submit button, JavaScript can make sure that values are filled in, or that they are within range, and can then pop up a message advising them of any errors, and that they

Re: [PHP] Processing PHP in Template File

2002-09-12 Thread Support @ Fourthrealm.com
John Include your template this way: $file_name=templates/somefile.php $New_Content1 = 'This is the new text'; $New_Content2 = 'This is the other text'; include $file_name; In the template file, have ?php echo $New_Content; ? etc wherever the content should appear. Then you can put other

[PHP] Date(), adjusted for one year

2002-09-18 Thread Support @ Fourthrealm.com
Hi guys, What is the easiest way to get the date of one year from today? Accommodating for leap years is not essential (but would be a nice bonus). Thanks, Peter - - - - - - - - - - - - - - - - - - - - - Fourth Realm Solutions [EMAIL PROTECTED] http://www.fourthrealm.com Tel: 519-739-1652 - -

Re: [PHP] Date-format

2002-09-18 Thread Support @ Fourthrealm.com
Reformatting before an inserting/updating is one option, but how would we change the mySQL database to accept the other format? Peter At 04:18 PM 9/12/2002 +0800, Jacob Miller wrote: Why can't you just reformat it before inserting it into the db? $date = 31.12.2002; $parts

[PHP] Efficiency

2002-09-18 Thread Support @ Fourthrealm.com
Which is more efficient? a) a sql loop where everything is displayed/formatted using echo stmts, like this: $result = mysql_query(SELECT * FROM news WHERE active=1); while ($row = mysql_fetch_object($result)) { echo TRTD$row-title /TD/TR; } mysql_free_result($result); ? OR b) a sql

RE: [PHP] Date-format

2002-09-18 Thread Support @ Fourthrealm.com
Thanks everyone for the helpful answers. I agree that manuals are useful, but there are times when an example works better. I took all of this information, and some details from earlier posts about dates, and produced the following function to make it easy to format dates without have to go

[PHP] use of mysql_free_result (was Re: [PHP] Efficiency)

2002-09-18 Thread Support @ Fourthrealm.com
Rick, or anyone, Based on what you said below, can you describe for me when the mysql_free_result tag should be used, and when it is not necessary? I'm fluent in other web languages (iHTML, ASP), but am fairly new to PHP, so I'm still learning the intricacies of the language, and the best way

[PHP] reuse database connections

2002-09-18 Thread Support @ Fourthrealm.com
Another question about efficiency / using server resources: In another language I use, I can re-use an ODBC connection to make further queries/update/etc to the database to save the overhead of closing and reopening the connection to the db over and over. It works sometime like this (in the

Re: [PHP] Re: PHP source code

2002-09-19 Thread Support @ Fourthrealm.com
A solution that I use is to put important information in an include file, and store it in a User-Authentication protected folder, ie. /admin/ This adds one extra layer of protection to your files, and keeps the average joe-surfer from being able to get the files. Peter At 08:24 PM

Re: [PHP] How do I use a Javascript variable in PHP?

2002-09-23 Thread Support @ Fourthrealm.com
Tom, JavaScript is a client side language, while PHP is server side. This means that the PHP is parsed and evaluated before it ever reaches the surfers browser. And since the JavaScript variable will not be available until it is created by the browser, there is no way to interact with it.

Re: [PHP] How do i assign Integers only and not real numbers?

2002-09-23 Thread Support @ Fourthrealm.com
Hi Tom, Try this: $years = round($years + ( $themonth / 12 )); From the manual: float round ( float val [, int precision]) Returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero (default). ceil() and floor()

Re: [PHP] date functions

2002-09-23 Thread Support @ Fourthrealm.com
Patrick Off the top of my head... Convert both date1 and date2 to unix timestamps, and subtract one from the other. That will give you the number of seconds between them. Then, convert to hours, minutes, etc as required. Peter At 10:38 PM 9/23/2002 +0200, Patrick wrote: i got 2 dates and

RE: [PHP] Thoughts on a simple search engine...

2002-09-24 Thread Support @ Fourthrealm.com
Chuck, Setup your form like this (assuming search.php is the name of your page): FORM ACTION=search.php METHOD=post INPUT TYPE=hidden NAME=step VALUE=2 . /FORM Then in your search.php page, use this structure: # --- set $step to passed value, or else set to default --- if

RE: [PHP] Getting started with PHP

2002-09-26 Thread Support @ Fourthrealm.com
Sauron, Since you're running Win2K, then you can use IIS already installed instead of Apache. I use Win2K Server, with IIS, PHP 4, and mySQL on my local box, and it works just fine. Peter At 10:55 AM 9/26/2002 -0400, Steve Bradwell wrote: Welcome Steve, You'll need to do two things to get

Re: [PHP] Date Formatting

2002-12-13 Thread Support @ Fourthrealm.com
Use this: function makedate($format, $indate) { $temp = explode(-, $indate); $fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]); $temp = date($format, $fulldate); return ($temp); } and call it with

[PHP] running slow on Win2k

2002-10-07 Thread Support @ Fourthrealm.com
Hi everyone, I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even slower when accessing a mySQL database. It's a PIII-800 with 256MB RAM. It is otherwise a great machine, and fast. Any suggestions? Peter - - - - - - - - - - - - - - - - - - - - - Fourth Realm Solutions

Re: [PHP] running slow on Win2k

2002-10-07 Thread Support @ Fourthrealm.com
the systems my clients use. So, I just need to know if there are some tweaks I should be considering to speed up PHP? Peter At 12:31 AM 10/8/2002 +0900, @ Edwin wrote: Hello, On Tuesday, October 8, 2002 12:19 AM Support @ Fourthrealm.com wrote: Hi everyone, I notice that my PHP runs really slow

[PHP] HTTP_USER_AGENT - list of possibilities

2002-10-08 Thread Support @ Fourthrealm.com
Hey everyone... do you know where I can find a list of the common returns of the $_SERVER[HTTP_USER_AGENT] variable? For example: I.E. 5.0 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; .NET CLR 1.0.3705) Netscape 4.08 = Mozilla/4.08 [en] (WinNT; U ;Nav) Thanks, Peter - - - - - - -

Re: [PHP] running slow on Win2k

2002-10-11 Thread Support @ Fourthrealm.com
More details on this... As I pay more attention to when it is sluggish or not, I notice that it seems to run fine on a typical page, with or without mySQL connections. But... the slowdown comes whenever I'm into my frame-based Admin, where 2-3 frames are typically loading at the same time.

[PHP] Recommend a merchant/store product

2002-10-28 Thread Support @ Fourthrealm.com
Hey everyone, For years I have used a fantastic merchant ( http://www.ihtmlmerchant.com ), which is feature packed and easy to setup and use. It's written in a competing language called iHTML ( http://www.ihtml.com ). As I am getting considerably proficient at coding PHP, I find that I

[PHP] Recommend a merchant/store product

2002-10-28 Thread Support @ Fourthrealm.com
Hey everyone, For years I have used a fantastic merchant ( http://www.ihtmlmerchant.com ), which is feature packed and easy to setup and use. It's written in a competing language called iHTML ( http://www.ihtml.com ). As I am getting considerably proficient at coding PHP, I find that I

Re: [PHP] date

2002-11-19 Thread Support @ Fourthrealm.com
Eddie, This is a function that I wrote to handle this same situation: # --- Function to format date output --- function makedate($format, $indate) { $temp = explode(-, $indate); $fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);

Re: [PHP] Seconds to minutes

2002-11-19 Thread Support @ Fourthrealm.com
Bob, Instead of dividing, use modulus to get the exact number of remaining seconds, and then determine the minutes from that. Here is some code that I've quickly adapted from another language I use, to take the total minutes, and convert it to hours:minutes display. $totalmins = 193; $showmins

Re: [PHP] scrolling data from db

2002-11-20 Thread Support @ Fourthrealm.com
Eddie, I use the attached on a site of mine... works with JavaScript and DIV tags. There are 2 parts to the file - the javascript, and then the HTML code to make it happen. Tweak according to your needs. Peter At 11:00 AM 11/20/2002 -0500, you wrote: I have a large amount of data to present

RE: [PHP] scrolling data from db

2002-11-20 Thread Support @ Fourthrealm.com
? Are the iframes limited? Thanks, Eddie -Original Message- From: Support @ Fourthrealm.com [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 11:23 AM To: Edward Peloke; [EMAIL PROTECTED] Subject: Re: [PHP] scrolling data from db Eddie, I use the attached on a site of mine... works

Re: [PHP] scrolling data from db

2002-11-20 Thread Support @ Fourthrealm.com
Justin, Creative thinking to a smart solution. I will keep that in mind for future sites. Peter At 10:35 AM 11/21/2002 +1100, Justin French wrote: If you know that your client base will ever only use IE, then go for it. Otherwise, you'll have to avoid the iframe. That sounds a little

Re: [PHP] Show only user that variable musiccontain pop

2002-11-27 Thread Support @ Fourthrealm.com
If you only have one condition, then get rid of the AND in the where statement; Select only the fields that you need, instead of * Like this: SELECT id FROM $TBL_NEWS WHERE music LIKE '%pop%' ORDER BY name Peter At 03:16 PM 11/27/2002 -0500, Benjamin Trépanier wrote: Hi, I need