RE: [PHP] Populate var with function output string?

2003-03-03 Thread David Freeman
*** function write_string(count) { for ($x = 0; $x $count; $x++) { echo option value=$x Row $x/option; } } $my_string = write_string(5); echo $my_string; *** 8-Untested

RE: [PHP] Another Logging Question

2003-02-23 Thread David Freeman
Right now, it's logging the client's IP, the page that they're viewing, the page that they came from, the time of the visit, and their system and browser info. Ummm, you do understand that, for Apache at least, all of this information can be made available through it's logging? You also

RE: [PHP] Locality from URL

2003-02-23 Thread David Freeman
Does anyone know of an intelligent way to establish a user's location (roughly) from either IP address or some other variable available to the server from the browser? (Other than polling the user) Not really - the problems you face are: 1. Processing Delays - if you need to do whois

RE: [PHP] Date formating

2003-02-15 Thread David Freeman
I have a string in this format: 2003-02-15 13:19:02 I want to display it in a more readable format like Staurday, 11 Februardy, 2003, 13:19:02. How can I achieve that. I tried date() function but could not get what I wanted. The date format above is a standard mysql date/time

RE: [PHP] Re: recursion?????

2003-02-15 Thread David Freeman
as a general rule of thumb, try to do as much checking as you can with JavaScript. For those checks such as is the field a valid date, is the field numeric and so on, it is much faster to check on the client, than to send the data back to the server and check it there.

RE: [PHP] recursion?????

2003-02-14 Thread David Freeman
What I want to do is have the registration form, on submit, check the data validity right then, if there is an error, redisplay the form with an * next to the field that is incorrect. This is the code logic rather than the actual working code: ---Start of PHP Page--- 1. Check for form

RE: [PHP] restricting access to files using PHP

2003-02-12 Thread David Freeman
i've written a secure PHP login script which will allow users to login to a directory such as this: however, how do I restrict people from accessing HTML files in that directory (which they can easily do so by typing the URL into their browser),

RE: [PHP] File upload???

2003-02-11 Thread David Freeman
Can anybody help me with file uploading, again... Have you tried using the fairly simple example that is given at yet? I've found that starting with this example and then adding all the extras tends to work well when you've got problems.

FW: [PHP] help with script!!!

2003-02-02 Thread David Freeman
echo(| %s | %s | %s | %s | %s |br /, $array[id], $array[username], $array[password], $array[status], $array[notes]); If you look at you'll see that echo does not support this syntax. If you want to use this syntax then you should probably be using some form of

RE: [PHP] question

2003-02-02 Thread David Freeman
Karl, what is a winmail.dat file? Is it too much to ask that you do some of this sort of thing for yourself? Here, I'll help you... 1. Connect to the Internet (if necessary) 2. Load a web browser 3. Navigate to 4. Type what is a winmail.dat file into the search box

RE: [PHP] using input tags with php

2003-02-01 Thread David Freeman
i want to set up a form that will load values from a table and make them the value of the edit box... then when people press an update button then all of the stuff that changes from the record already in the table gets changed... anybody know how to make it where you can get the

RE: [PHP] using input tags with php

2003-02-01 Thread David Freeman
i am having a problem using input tags by using current values kept in a mysql table. how do you get the values out of the table and into a form so they show as the value= part of the tag? Start by making a basic test: ?PHP $some_string = some string; echo input type=\text\

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

2003-01-29 Thread David Freeman
G'day Scott Just curious, is there a PHP function that will break up the string for us? I'm not specifically having a go at you but more observing that some people use this list as a first line of question rather than doing some work themselves. Assuming that I didn't already know what

RE: [PHP] if (a == b) ...

2003-01-29 Thread David Freeman
I have a conditional: if (a == b) a is the number 0, but b is a string Friday August 22. The condition is evaluating as true, which is not what I want. What am I misunderstanding? You're comparing a string to a number perhaps? I tried this: -8- $a = 0; $b = Friday August

RE: [PHP] Which country?

2003-01-20 Thread David Freeman
Is there a way to get to know from which country a user is calling the webside with my php-script? Probably only if you're going to ask them to tell you what country they are in. You can look at the resolved domain that they are coming from and it's country code - this might be indicative

RE: [PHP] Which country?

2003-01-20 Thread David Freeman
You could rely somewhat of the time zone codes as you refer to them, the only issue is in some parts of the world this would include 10 countries at a time. But what time zone are you getting? The time zone of the browser? The time zone of the proxy cache that's in a possibly different

RE: [PHP] $_POST vars problem

2003-01-20 Thread David Freeman
On another note, I have found that if I include (and use) the submit button everything works perfectly, HOWEVER if I just enter data and hit return then it messes up. You could try including a hidden submit field like this: input type=hidden name=submit value=1 For name=submit change

RE: [PHP] Time code!!!

2003-01-20 Thread David Freeman
Hi Karl First up, would you mind posting your messages in plain text instead of html format? It's just a courtesy to the rest of us. does anyone have the code to where i can have the time printed on my home page like for example Monday, January 19, 2003 Sure, check out the date()

RE: [PHP] forms

2003-01-13 Thread David Freeman
G'day CJ This is really a html more than a php question. Yep, it probably is... Is it possible to have two buttons and have different actions for each button in the same form? Yep, you can. form etc input type=submit name=first_submit_action value=do this input type=submit

RE: [PHP] Deleting rows from a table with autoincrement. . .

2003-01-10 Thread David Freeman
My question is this: is it possible to use autoincrement to generate the id's and still keep them sequential when I delete say, item 3 of 5. Generally speaking, an auto-increment column will not fill gaps and keep sequential orders. Your choice, basically, is to write your code

RE: [PHP] Months of the year

2003-01-06 Thread David Freeman
How do I create a drop down list that automatically generates a list of months for the next 12 months upto and including this month This would do it... select name=st_month style=width: 80px class=forms ?PHP $curr_month = date(n, mktime()); for ($x = 1; $x = 12; $x++) { $month_name

RE: [PHP] Re: PHP and MySQL bug

2003-01-05 Thread David Freeman
@MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't work Personally, I'd call it bad programming practice to do a database update and not check to see if it worked or not. In this case, how are you determining that the query did not work? Are you manually checking

RE: [PHP] array help please

2003-01-05 Thread David Freeman
$mysql query1 result array[cityid][cityname] mysql query2 result array[cityid][cityname] now what i want to do is kick out any doubles in my array and resort them alphebetically by cityname ?! It's difficult to answer this question without knowing more about the context and

RE: [PHP] Running PHP on Windows OS

2002-12-31 Thread David Freeman
So, there is something in the new security of XP and Win 2K SP 3 that does not let the dll load and run. Ever since I loaded SP 3 I have had problems - like many others! Don't know about Win2k as I haven't tried it but Apache/PHP/MySQL is working perfectly well on my Win XP laptop.

RE: [PHP] Date fields

2002-12-28 Thread David Freeman
G'day Peter I have a form with several date fields. I want to be able to set these by selecting from a calendar display. Does anyone know of any php function or code which would let me do this? If you mean having some sort of pop-up calendar display that the user can select a date from

[PHP] PHP/MySQL Interaction

2002-12-12 Thread David Freeman
Hi All This is probably off-topic here and my only real excuse is that after having searched google as well as both php and mysql sites/manuals I'm no closer to an answer for something I'd like to get solved this morning... I have two database tables (mysql). One contains information about

RE: [PHP] Query to select every other record

2002-11-17 Thread David Freeman
Does anybody know of a SELECT QUERY that will select every other record of a table ? I want to do this so that I can display my products in 2 columns (I will also be using arrays of course). Don't know of a select that'll do it, but then I don't really understand why you'd want to

RE: [PHP] Firewall Question

2002-11-05 Thread David Freeman
My OS is Windows XP Pro but the computer with admin privaliges is Windows 98. It's not software, it's hardware. It's built into the HUB of the LAN. There is some software to open ports but I'm not sure what it is or anything like that. Thanks for the help so far. No offence

RE: [PHP] Am I blind? simple 15 line code producing error - SOLUTION FOUND! - tks

2002-11-04 Thread David Freeman
To those of you that helped me with this problem I have spent time eliminating lines of code.. the problem was in the following line: if ($_SESSION[first_name]) the line should be like this if (ISSET($_SESSION[first_name])) The change that would induce this error is likely to be

RE: [PHP] Re: File Upload Problem

2002-10-30 Thread David Freeman
G'day David My problem is that files uploaded through a form are increasing in size. Doesn't that look like the EOL characters are being translated after the fashion of ftp ascii transfers? Maybe have a look at the two versions in a hex viewer and see if that is the case?

[PHP] File Upload Problem

2002-10-29 Thread David Freeman
Hi All I'll start by saying that I've checked the online manual (and comments) as well as having done a Google search on this with no success. My problem is that files uploaded through a form are increasing in size. For example, I upload an image that is 7658 bytes and the uploaded version is

RE: [PHP] File upload and php... not a beginner question...

2002-10-16 Thread David Freeman
I'm currently working on a big photo album tool, and I want to provide user the ability to upload a lot of jpeg files in one time... The big problem with form is it's too slow... Does anyone know how to by-pass this ( with java or other tools )? It's primarly slow because

RE: [PHP] $_FILES posting limited to 5?

2002-10-16 Thread David Freeman
For all those who don't know my question from yesterday, I have a form where I can upload up to 9 files at a time. Unfortunately, only the first 5 of those files are being uploaded at any given time. I haven't specifically checked your program logic but I believe that this is where

RE: [PHP] Re: $_FILES limited to 5? (Server versions)

2002-10-16 Thread David Freeman
Just wanted to let everyone know: PHP version is 4.2.1 Apache is 1.3.24 Running WindowsXP Pro Oh, yeah, that. My dev environment is almost exactly the same. CYA, Dave -- PHP General Mailing List ( To unsubscribe, visit:

RE: [PHP] Getting the highest number in a column

2002-10-15 Thread David Freeman
Using PHP and a MySQL database, I want to grab the highest number in a particular column. As is usual for questions like this, the answer is most likely that you should do it in your sql query. In this case, something like this would probably do it: SELECT MAX(some_column) FROM

RE: [PHP] Re: Another odd file problem / Limit on File uploads?

2002-10-15 Thread David Freeman
post_max_size = 10M upload_max_filesize = 8M memory_limit = 8M As I said before, however.. even without throwing files there, my loop test code only spits out '01234', meaning that its only looping 5 times through the code before exiting... Does file handling only allow

RE: [PHP] A little help needed, I cant figure!

2002-10-13 Thread David Freeman
Song Table: Song_id A_id Type Name Length Lyrics ... That's my ideas on how to do it. There are many ways to do it, though. Totally agree with what John says. If the lyrics are long (as I assume they will be) then I'd probably hive the lyrics off into a table

RE: [PHP] A little help needed, I cant figure!

2002-10-13 Thread David Freeman
Indeed, another problem I have is that if a single is on an album, which track it is on the album. Off hand, I'd say that if you need this information as well (ie. You want to recreate the songs on album list in the correct order) then you need to extend one of your tables to include this

RE: [PHP] Working with dates in PHP

2002-10-11 Thread David Freeman
I am at my wits end at the moment. I am pulling a datetimestamp out of a database and attempting to get the year month and day out of it. Do it in your sql query. Check out chapter 6 of the MySQL manual for ways to manipulate dates. Eg. $query = select DATE_FORMAT(DTStamp, '%e %b

RE: [PHP] Function is_readable doesn't work correctly

2002-10-08 Thread David Freeman
?php if (is_readable(owner.php)) echo READABLE; else echo UNREADABLE; include (owner.php); ? According to the manual, the results of is_readable() is cached. So, if you've been testing this and have both readable and unreadable you may have the wrong one cached.

RE: [PHP] parsing variables through webpages

2002-10-07 Thread David Freeman
I send hidden variables from a form to a php. In the php I have the following code to convert the global vars sent: If (isset($_GET['foo'])) $foo = $_GET['foo'] else $foo = 0; But this only works using the GET method! If you're sending the variable

RE: [PHP] running slow on Win2k

2002-10-07 Thread David Freeman
I have no interest in getting into a Win2K/Linux debate. There are strengths and reasons for using both systems. Good for you, I was about to post something similar. For the record my dev environment is a laptop with a Celeron 1.2/256MB/WinXP Pro and it's running Apache, MySQL and PHP

RE: [PHP] need help for a where clause

2002-10-06 Thread David Freeman
I need a where clause in following situation: Say I want to query two tables: A and B. In table A there is field Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want to do a query, in which the where clause must do these things: if A.Afn=1, then check

RE: [PHP] Quick question.

2002-10-02 Thread David Freeman
I am the webmaster of the site, i pay for the server space, is that what you mean? First up Simon, I deleted over a hundred lines of no longer relevant content from your message including things like signatures. You should probably trim messages down when you reply to them... Next up,

RE: [PHP] Update identical table

2002-09-29 Thread David Freeman
I have 2 identical tables called tmp_data and data. (on the same mysql database). What would be the simple and more convenient way to update table data with a row from table tmp_data. What about getting rid of tmp_data completely and adding an extra column to your data table. The

RE: [PHP] Need some help please.

2002-09-18 Thread David Freeman
I am having trouble with a PHP script. I am not the one who made this and my knowledge on php is very little. I came across this php script Tried loading this and had too many page errors to figure out what you are doing.

RE: [PHP] Need some help please.

2002-09-18 Thread David Freeman
Thats a Nice feaure you have, How do you do that? I have a cron event on my server that grabs the relevant page from the web site soon after it is updated (around 20 past each hour) using lynx -dump url which then pipes the resulting page dump through grep to grab just the line of data that

RE: [PHP] Re: unless something...

2002-09-12 Thread David Freeman
Doing stuff with || is always a good way to stuff up. In the case of your example it will always evaluate to true. if ($A != $C || $B != $C) { I think, but im fairly new This would work if you did this: If (!($A == $C || $B == $C)) { In perl, I would do this: unless ($c =~

RE: [PHP] Help getting count to show up.

2002-09-10 Thread David Freeman
ex. SELECT feild1, field2, COUNT(*) FROM tables GROUP BY category, format. Try this instead: SELECT field1, field2, COUNT(*) AS field3 FROM TABLS GROUP BY category,format Now you'll find your count is available as 'field3'. CYA, Dave -- PHP General Mailing List

RE: [PHP] QUery success, but blank results/variables

2002-09-09 Thread David Freeman
If you've typed your code in accurately then... $detailqry = SELECT id, parentitemid, itemtypeid, itemstatusid, [etc] $result = mysql_query($detailqry) or die(Failed finding task details); somewhere in about here you want to have something like: $sqldata = mysql_fetch_array($result);

RE: [PHP] Returning Rows Question

2002-09-04 Thread David Freeman
How do you alternate colors of the rows in a table inside a while statement when dealing with the output of data from a DB. I am sure it's something simple but I keep getting into some really long math thing... For two alternating colours I normally do something like this: $use_col

RE: [PHP] Average Number For Math Functions

2002-08-29 Thread David Freeman
Ok so how do I sum up an entire column in my db? For example if one row is : 1 , the next is 2, and the next is 1 - I need to have a total of 4 and the be able to divide by the num_rows The problem I ma having is the inside row addition If you're doing it on values from a database

RE: [PHP] Date conversion problems

2002-08-26 Thread David Freeman
I have, in my database, a bunch of dates stored like this: -M. Month is obviously the number of the month (5), not the name (May). I want to convert the format to MMM, (ex: May, 2002), Do the conversion in MySQL - it'll save you grief in the long run... SELECT

RE: [PHP] Can someone - anyone see my error?

2002-08-25 Thread David Freeman
And here is the error I get: - Warning: Unable to create '/home/thehobby/public_html/php/phpforums/uploads/': Is a Does this directory exist? Does the user that your web server is running as have permission to write files in this directory?

RE: [PHP] php/shell/permissions problems....

2002-08-19 Thread David Freeman
I've got a php form, that gathers certain information, and then passes that info on to a couple of shell scripts to move files around, create links, import data into some mysql databases via sql files, etc. The two shell scripts work fine when I'm logged in as root via telnet.

RE: [PHP] database value count retrieval

2002-08-19 Thread David Freeman
SELECT COUNT(x) FROM table; Make 'x' equal to any column name in the table and add WHERE to the clause as needed. err...all very well, but how do i retrieve the value afterwards? $sqlcom=select count(codigo) from comments where codigo=$id; SELECT

RE: [PHP] assoc array question

2002-08-15 Thread David Freeman
while (list ($key, $val) = each ($info)) { do stuff } $count = 0; $last = sizeof($info); While (list($key, $val) = each($info)) { if ($count == 0) { // first time through } if ($count == $last) { // last time through } // do stuff $count++; } -- PHP

RE: [PHP] Undefined variable: PHP_SELF

2002-08-15 Thread David Freeman
I keep getting Undefined variable: PHP_SELF when using the following: form method=post action='$PHP_SELF' Global variables are off... What am I doing wrong? In current versions of PHP, $PHP_SELF is available if globals are on. You'll need $_SERVER['PHP_SELF'] instead if you're

RE: [PHP] Re: Pictures and sound in MySQL and access via PHP

2002-08-11 Thread David Freeman
How do you make a link in MySQL? I tried following code were the field geluid contains a link to a mp3 while ($row=mysql_fetch_array($result)) { echo trtd; echo $row[woord_nl]. /tdtd . $row[woord_ost]. /tdtd . $row[betekenis_nl]. /tdtd . $row[geluid]; echo /td/tr; }

RE: [PHP] Converting datestamp to text?

2002-08-10 Thread David Freeman
In my MySQL db I have a date-field on every entry looking like this : 2002-08-10 When presented on a PHP page, I want it converted to Saturday, Augusth 10th, 2002. How do I achieve that? I've been playing around with the date-command and strtotime-command but haven't

RE: [PHP] Tried that..

2002-08-10 Thread David Freeman
I've tried that, but as usual rtfm doesn't help me. I need concise examples :( How would I write this basic select query to get the date in my format (Saturday, August 10th, 2002)? SELECT datum FROM news_items (where datum is the date-stamp in -MM-DD format) Rasmus is

RE: [PHP] Re: Protect PHP coding

2002-08-04 Thread David Freeman
I know I shouldn't do more to keep this going but I'll make this one, and only, post. this all started when rasmus had a problem with the click in my original post From what I read, Rasmus made a correction to your opinion. You are entitled to your opinion, but perhaps you should learn

RE: [PHP] Vars passed via URL disappearing

2002-08-02 Thread David Freeman
I just upgraded to PHP 4.2.2 and am trying to make my sites work with register_globals turned OFF. I notice, however, that with register_globals turned off any variables I pass via the URL don't seem to be recognized by the script it was passed to. I thought register_globals only

RE: [PHP] Resetting ID

2002-07-30 Thread David Freeman
What i want to do is delete the entire IDs and generate them again so that they are in one single order like 1,2,3,4,5... .like this. I suspect that if your table, as you use it, needs this ordering then you've got something wrong. It really shouldn't matter much what the internal IDs

RE: [PHP] MySQL password()

2002-07-30 Thread David Freeman
Mmm.. think you misinterpreted my question... PASSWORD(str) how do you unPASSWORD(str) in PHP? Basically, you don't. Instead, what you do is use the password that was provided as user input. You create a suitable

RE: [PHP] fullname

2002-07-30 Thread David Freeman
is there some other easyer way to do in one line than this?: $fullname = $session[f_name]; $fullname .= ; $fullname .= $session[l_name]; $fullname = $session[f_name] . . $session[l_name]; CYA, Dave -- PHP General Mailing List ( To unsubscribe, visit:

RE: [PHP] Re: Public Scripts in a commercial product

2002-07-29 Thread David Freeman
Yes, I am afraid that regarding GPL I have to agree with Microsoft when they say it is a cancer. The problem is that if you want to distribute something that incorporates GPL licensed components, your software also needs to be distributed as GPL and so it gets contaminated. This

RE: [PHP] RTRIM() - Won't accept 2nd Param

2002-07-27 Thread David Freeman
When I issue this command to remove any commas at end of string: $query = rtrim($query, ,); PHP give me an error saying Wrong parameter count for rtrim(). How can this be? The online manual shows rtrim can accept two parameters. Shouldn't this work? I have PHP 4.0.6

RE: [PHP] Paying Job...

2002-07-25 Thread David Freeman
Do you charge by the page, script or by the hour (that would be nice). We do this sort of thing in, basically, one of three ways... 1. Client gives us a budget and we give them a clear idea of what that budget will get them. 2. Client gives us a good idea of what they want to achieve

RE: [PHP] datetime field - still a newbie

2002-07-24 Thread David Freeman
I have a datetime field in one of my mysql tables...when displaying some of my records I want to display the date in the aforementioned datetime field, but if the date is today I want to display today instead. If the date is yesterday I want it to display that so I how do I

RE: [PHP] redirecting after login

2002-07-23 Thread David Freeman
what doesn't work is after they login to Page 1, the redirect sends them to Page 2 and right back to Page 1 because the global session isn't staying registered. Are you putting session_start() at the top of each page where you want to be able to use the session stuff you've set?

RE: [PHP] Inclusion error

2002-07-16 Thread David Freeman
Failed opening '/var/www/html/BOOKS/newbooks.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in Unknown on line 0 I am getting the following error, when the file newbooks.php is invoked. The first lines in this entire file starts with the ?php tag,

RE: [PHP] retrieving random data from mysql database

2002-07-15 Thread David Freeman
When you say, Order by RAND() I would think the Order by construct expects a column name. In your case, it gets a decimal value. How does Order by treat decimal values? Oh, I just checked the manual: In MySQL Version 3.23, you can, however, do: SELECT * FROM table_name ORDER

RE: [PHP] mysql LIMIT

2002-07-14 Thread David Freeman
can I use limit to show the 2nd record on without knowing how many more records there might be? also, what happens if I set the limit in a mysql statement (LIMIT 5,10), but there are only 3 results? 7 results? My answer would tend to be that you should try it for yourself and

RE: [PHP] retrieving random data from mysql database

2002-07-14 Thread David Freeman
can you teach me how to retrieve random data from my database? like for example...i have a list of names on my database and i'd like to retrieve only one name at a time..randomly. how do i go about this? This is really a database question rather than a php question and you haven't

RE: [PHP] PHP/MySQL -- Date/Time Confusion

2002-07-12 Thread David Freeman
Which method is the best way to store date/time in MySQL and then which PHP command is the best to use to convert that date to something useful? Get comfortable with MySQL's date functionality and you'll find that you don't often need to do the date comparisons and manipulation in php

RE: [PHP] Best String to Array Solution

2002-07-11 Thread David Freeman
Greetings, this may be simple, but it's late and my brain needs a hand. I have a string such as first,second,third,fourth I need a way to take each one of the items separated by the comma to be an item in an array. Check out explode() and I think you'll find what you need.

RE: [PHP] Button can't see form!

2002-07-05 Thread David Freeman
The problem I have is with a page I build dynamically. The whole page is encased in form/form tags. In between these tags there are sections echoed as a result of a databasse query. Each of these sections is a form. form name=addproduct table !-- loop round result set

RE: [PHP] FW: Help please!

2002-07-02 Thread David Freeman
id 3 from the database. What I really want is to state width is 100 and height is 100 for example so I do not have to downlaod the entire picture and specify the width and height as part of the image: Do not want img src=getdata.php?id=3 width=100 height=100

RE: [PHP] mySQL time = year 2038 [SOLVED]

2002-07-01 Thread David Freeman
Yep, I was using the DATE() function in PHP to convert a TIMESTAMP from a MySQL DB query. I was getting a year of 2038 because MySQL and PHP use different TIMESTAMP formats. $getmyTime = mysql_query(SELECT UNIX_TIMESTAMP(timestamp_col) AS yournamehere FROM myDBnamehere WHERE

RE: [PHP] include files or fopen

2002-06-30 Thread David Freeman
I am trying to write a program that is very modular in nature one of the features I need the user to be able to do is install/uninstall or enable/disable the module though the interface. I have, in the past, stored such information in a database. In projects that have need of such

RE: [PHP] Javascript to PHP?

2002-06-29 Thread David Freeman
My apologies if this has been asked a thousand times. I've just joined the list. I has, but you get that... I can't find any information on passing JavaScript variables to PHP on the same page (i.e. not through the POST information of a submitted form). Is this because it's not

RE: [PHP] Seperating presentation from logic

2002-06-26 Thread David Freeman
? // general_config.php $siteTitle $colBg = #FF; $colText = #FFCC99; $colLink = #EE; $colComplimentary = #CC6600; $fontHeading = FONT class=\heading\ face=\verdana, arial\ size=\3\; Wouldn't you ultimately be better off moving most of this sort of thing into

RE: [PHP] PHP not working on Apache at XP Pro.

2002-06-26 Thread David Freeman
I've got Windows XP Pro OS. I installed and am running mySQL on that. However, PHP is not getting configured with Apache on it. I got the latest Apache, 1.3.24 or something, not the Version 2. Anyway, Apache runs perfectly on it. However, when i put in the required PHP lines in

RE: [PHP] Seperating presentation from logic

2002-06-26 Thread David Freeman
Wouldn't you ultimately be better off moving most of this sort of thing into style sheets and then have the designers play with the style sheets instead? What if your designer wants to change from a two column table to a four column table. Or change the menu from a vertical

RE: [PHP] php JavaScript

2002-06-24 Thread David Freeman
I've tried to include a simple javascript in a .php file, but couldn't get it to work. Actually not even the php code worked at all... Is there any specific configuration flag that needs to be set up in the Apache server so that the javascripts work correctly? Not

RE: [PHP] Testing PHP on a local machine

2002-06-24 Thread David Freeman
I want to set up a site at home to play with php I have windows xp pro, dreamweaver MX and mysql Do I need anything to view live application data locally in my browser You'll need to install a web server that supports php and php itself. I did this recently on my XP Pro laptop

RE: [PHP] checkboxes

2002-06-22 Thread David Freeman
I know this might be a bit easy for all you experts out there. I have multiple checkboxes and text areas in a form. In the confirmation email sent to the user I manage to get the text areas to display in the email. How would I get the results of the checkboxes to to display as

RE: [PHP] Stumped on a function

2002-06-21 Thread David Freeman
function cleandate($indate) { str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } I suspect that you actually need something like this: function cleandate($indate) { $indate = str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); }

RE: [PHP] insert date with a calendar

2002-06-20 Thread David Freeman
user input, which is not always reliable, has to be in the correct format. What I've done for things like this is to have three separate select form elements. The first for selecting a day of the month. The second for selecting a month and the third for selecting a year. I usually set the

RE: [PHP] include() question...

2002-06-20 Thread David Freeman
Okay, let's say I want to send a user to a certain webpage... usually I would use... include(website.php); but, if i want to send a user to a website along with a variable like... $temp = website.php?var=.$var; include($temp); ...this doesn't work. If you are

RE: [PHP] mysql_num_rows always returns 1?

2002-06-18 Thread David Freeman
$query = select count(*) from users where You are asking for a count() in your query. This will always give you one row returned with a count. If you really want to do this you should probably have: $query = select count(*) as usercount from users where Then you can do your tests

RE: [PHP] possible to add a record number to a query?

2002-06-13 Thread David Freeman
I would like to have a column returned in a query that tells you which record I'm looking at? Sort of like an auto_increment? IOW, the query results would look like: record first last 1 johndoe 2 joe blow 3 carol fisher The table

RE: [PHP] truncating dilema

2002-06-13 Thread David Freeman
It has just occured to me though that if I'm to list maybe 100 news items with descriptions it means alot of memory right because i have 100 items containing: date title text (could be any length) I will use substr()

RE: [PHP] confused newbie on PHP and Javascript.

2002-06-13 Thread David Freeman
I have a JavaScript function that onChange of a list box, takes the value of an option and grabs data from a MySQL table. My problem is how do I use the JavaScript var in my sql statement? Javascript is client-side, php is server-side. The only way to get something that happens in

RE: [PHP] string to array?

2002-06-13 Thread David Freeman
I have a string something like 10.2.3 I want to be able to use the . as a delimiter to reference the elements (10, 2, and 3). My thought was to create an array, using . as the delimiter. Is there a function that will create an array out of a string, using a delimiter you specify?

RE: [PHP] Extracting Variables

2002-06-13 Thread David Freeman
echo i = $ibr; for($c=1;$c=$i;$c++){ echo team_number $team_number_$cbr; echo sub1_$c = $sub1_$cbr; echo sub2_$c = $sub2_$cbr; echo sub3_$c = $sub3_$cbr; echo sub4_$c = $sub4_$cbr; echo sub5_$c = $sub5_$cbr; } } Perhaps this: Echo sub1_$c

RE: [PHP] Else/For loop

2002-06-12 Thread David Freeman
Being relatively new to php, I discovered the following after about 2 hours of debugging last night and was wondering why??? I had the following code: if ( $num_results = 0 ) { echo no records found; } else { for ($i=0; $i $num_results; $i++) {

RE: [PHP] Querying for MAX

2002-06-12 Thread David Freeman
What I’m trying to do here is not inside PHP nor MySQL books I have. I need to query the DB to look the max result in a column. That is, if I have affiliate members with ID going from 1 to 10, get the query to know that the last member added was 10 so I can add member 11 without

RE: [PHP] Extracting from an Array

2002-06-12 Thread David Freeman
I have a db field, type varchar, that is actually a 'date' string formatted as dd-mm-. I used type 'varchar' (rather than type 'date') since I had to accomplish other things with it. Now, however, I do need to extract the Year (the last four digits in the array). Ummm, are you

  1   2   3   >