Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
> REFERRER isn't always set, so that may be the problem. > > Try just a simple HTML page that has a link to a PHP page that echo's > out $_SERVER['HTTP_REFERRER']. > > Does that work? No. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
>What do you get with this... >echo ( "\n" ); >print_r ( $_SERVER ); >echo ( "\n" ); >From a blank HTML page, I get: Array ( [DOCUMENT_ROOT] => /var/www/html2 [HTTP_ACCEPT] => image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */* [HTTP_ACCEPT_CHARSET] => iso-8859-1,*,ut

Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
>echo ( "\n" ); >print_r ( $_SERVER ); >echo ( "\n" ); On the redirect from http://compcanlit.ca/, I get: Array ( [DOCUMENT_ROOT] => /var/www/html2 [HTTP_ACCEPT] => image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */* [HTTP_ACCEPT_CHARSET] => iso-8859-1,*,utf-8 [H

Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
ere. One thing I did notice is that the redirect comes thru on a > different port. If this is consistant, you may be able to use this. > > John Taylor-Johnston wrote: > >>echo ( "\n" ); > >>print_r ( $_SERVER ); > >>echo ( "\n" ); > >

Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
a link from another page, it was set. I'll look at it a bit > longer to see if there is anything out there to tell it was redirected, > but it's not looking good. > > John Taylor-Johnston wrote: > >>[SERVER_PORT] => 80 > > > > > > Server port d

[PHP] Duh uuh ?

2003-02-15 Thread John Taylor-Johnston
How do I call this? http://www.phpclasses.org/browse.html/file/2202.html calendar; //gives me nothing. Prints html header and that's it. It's a class and obviously I don't know what I'm doing :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/uns

[PHP] Good grief

2003-02-18 Thread John Taylor-Johnston
Yawn of frustration. $dbtable = "ccl.ccl_main"; list($db,$table) = explode(".",$dbtable); echo $dbtable.''.$list[$db].''.$list[$table].''; echo $dbtable."".$list[$db]."".$list[$table].""; I stumped :) $list[$db]shows nothing $list[$table] shows nothing Ok, newbie time :( What's wrong? -

Re: [PHP] Good grief

2003-02-18 Thread John Taylor-Johnston
Rasmus, >You probably want just $db and $table Yes I do. I need to learn a little more about declaring arrays & its syntax. I figured I was declaring an array called "list". Then ... :) Copied & tinkered from: http://www.php.net/manual/en/function.explode.php Thanks!

Re: [PHP] Good grief

2003-02-18 Thread John Taylor-Johnston
Rasmus, If I were going to remanufacture http://www.php.net/manual/en/function.explode.php I would add/edit: $data = "foo:*:1023:1000::/home/foo:/bin/sh"; list($user,$pass,$uid,$gid,$gecos,$home,$shell) = explode(":",$data); echo $user."".$pass."".$uid."".$gecos."".$home."".$shell; Thanks agai

[PHP] Re: file not opening in internet explorer

2003-02-18 Thread John Taylor-Johnston
check.php and even am able to read the written contents. > > but when i enter http://192.168.0.1/bdoi_change/sundar.html > in my internet explorer address bar, it says the page cannot > be displayed. > the file permissio

[PHP] Re: file not opening in internet explorer

2003-02-19 Thread John Taylor-Johnston
Ok, someone help him out. Maybe, just maybe the file belongs to someone else than you. I had that happen to me once too. CuteFTP can show you that. Is this possible people? What happened when you checked the permissions? 644? Then CHMOD it 644 again yourself to see if it makes a difference. ht

[PHP] Re: file not opening in internet explorer

2003-02-19 Thread John Taylor-Johnston
>dear john, > >i made the CHMOD myself to 644. >but the file is still not opening. >do u have any more ideas? Sorry no. Tapped out. But I'm not a pro coder myself. Someone will answer. Someone is awake and coding. Come on guys. Give the lady a break. >and i am not 'he'.i am 'she'. I stand corre

Re: [PHP] file not opening in internet explorer

2003-02-19 Thread John Taylor-Johnston
> > the file permissions are "rw-r-r" > Stupid question -- are you running a webserver? Charming isn't he? > /* > The fact that 47 PEOPLE are yelling and sweat is cascading down my > SPINAL COLUMN is fairly enjoyable!! > */ Indeed. Help the "colleague" out Jason, or get off the channel. -- PH

[PHP] Can I do this? header("Content-type: text/rtf");

2003-02-20 Thread John Taylor-Johnston
Hey, I'm using PHP & MySQL to generate a RTF document. I use this header: header("Content-type: text/rtf"); Of course, the header scares the poor browser. The browser bawks and says, unknown file type, and instructs the browser to save the file. It tries to save a file called "export_to_rtf_te

[PHP] Re: new to php, need help..

2003-02-20 Thread John Taylor-Johnston
Just a hunch: "" Try using " Do you have a URL to show us what your page does and doesn't do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: is there php debuggers or IDE under Linux?

2003-02-20 Thread John Taylor-Johnston
I didn't know a debugger was available? Then again, I'm no expert. However, as an aside note, rename your file to *.PHPS This will display your code in a readable, color-coded fashion, allowing you to decipher possible problems yourself. Newbie advice, but helps some. -- PHP General Mailing Li

Re: [PHP] Can I do this? header("Content-type: text/rtf");

2003-02-20 Thread John Taylor-Johnston
Works great. Thanks, John > >I'm using PHP & MySQL to generate a RTF document. I use this header: > >header("Content-type: text/rtf"); > header("Content-Disposition: attachment; filename

[PHP] University researcher's question

2003-02-23 Thread John Taylor-Johnston
[i] How or why do researchers adapt technology to their research projects? Should they adapt their projects to technology? Indeed, how often does the research assistant end up reinventing the wheel? [/i] I know most of you are E-Commerce oriented, but I would appreciate your feedback. I use PHP

[PHP] Re: Permission Denied

2003-02-23 Thread John Taylor-Johnston
lly CHMOD them all to 777 with no problems. I don't see why I'm getting > all this! Please help ASAP! Thanks in advance! -- John Taylor-Johnston - "If it's not open-source, it's Murphy's L

[PHP] Re: Question about replacing \r\n with

2003-02-23 Thread John Taylor-Johnston
\015\012)|(\015)|(\012)/","", $txt); > > I can substitute other characters and dec equivalents and the > substations just won't work for \r\n [or just \r or just \n] or "\015" > or "\15". > > And, I've t

[PHP] Re: sending results by email

2003-02-23 Thread John Taylor-Johnston
http://www.php.net/manual/en/function.mail.php Note my changes in your HTML! mail("[EMAIL PROTECTED]", "Subject: sending results by email", "MyText: \n$MyText \ncheckbox2: $checkbox2"); HTH? John > > > > > >

Re: [PHP] Help with Multiple Checkboxes

2003-02-23 Thread John Taylor-Johnston
> Does id even exist? HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Why use persistent connections? || Data driven site

2003-02-23 Thread John Taylor-Johnston
I stopped using pconnect. Don't see the sense in it. Why take the chance? http://www.php.net/manual/en/function.mysql-pconnect.php Warning Using persistent connections can require a bit of tuning of your Apache and MySQL configurations to ensure that you do not exceed the number of connections al

Re: [PHP] Help with Multiple Checkboxes

2003-02-23 Thread John Taylor-Johnston
Style sheet stuff?

Re: [PHP] University researcher's question

2003-02-23 Thread John Taylor-Johnston
own progress, which will be a > big relief for the administration people. So it is university related but > not really research related. -- John Taylor-Johnston - "If it's not open-source, it's M

[PHP] include

2003-02-23 Thread John Taylor-Johnston
t variable can I muster up to do this? -- John Taylor-Johnston - "If it's not open-source, it's Murphy's Law." ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbr

Re: [PHP] include

2003-02-23 Thread John Taylor-Johnston
Which variable should I use? _SERVER["HTTP_HOST"] _SERVER["SERVER_NAME"] HTTP_HOST Server_NAME Host -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] include

2003-02-23 Thread John Taylor-Johnston
Jason, $_SERVER is outdated now isn't it? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Which function?

2003-02-23 Thread John Taylor-Johnston
Instead of doing this: Which function am I looking for to see if $HTTP_HOST contains "compcanlit"? This is not what I am looking for: http://www.php.net/manual/en/function.similar-text.php John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsu

[PHP] explode(" ", $pizza)

2003-02-24 Thread John Taylor-Johnston
Off topic :) ? Anyone know how to explode using javascript? $pieces = explode(" ", $pizza); John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mysqldump

2003-02-26 Thread John Taylor-Johnston
Anyone do MySQLDump using PHP ? http://www.mysql.com/doc/en/mysqldump.html My code is: mysqldump -u ** -p ** -A > /home/mybackups/dump_all.sql I would like to pull it off using PHP, remotely. $date = date ("Ymd"); $to_path = "/home/MyBackups/$date/dump_all.sql"; mysqldump -u ** -p

[PHP] Re: mysqldump

2003-02-26 Thread John Taylor-Johnston
Thanks! > exec("mysqldump -c -q database -u user -ppassword", $sql); Why is there no space between the -p and password? >-ppassword Am I wrong? Thanks, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: One more string question

2003-02-26 Thread John Taylor-Johnston
Stripslashes I think. Gregory Chagnon wrote: > When I submit a form with a text area containing the test "//server/share" > and try to echo the variable it echos "server//share". Is there any way > to prevent the extra /'s? Thanks

[PHP] exec & mysqldump

2003-02-26 Thread John Taylor-Johnston
This works: exec("mysqldump -u -p -A > test.sql"); This doesn't. exec("mysqldump -u -p -A > $filename"); :) $filename"); echo "dump completed on $filename "; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] exec & mysqldump

2003-02-26 Thread John Taylor-Johnston
Scratch that. Had a CHMOD problem. Sorry. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP & MySQL "Move"

2003-02-28 Thread John Taylor-Johnston
Assuming MySQL can do this, I need to generate some code that would MOVE a record from one table to another. Not just a MySQL code problem? Pseudo code: base.table select base1.table where id=25 insert result base2.table delete base1.table where id=25 Can I even do this in MySQL? If so, what wi

[PHP] Re: PHP & MySQL "Move"

2003-02-28 Thread John Taylor-Johnston
I was wondering about this, but decided to ask first first: INSERT INTO ccl.ccl_main VALUES (select * from greid.ccl where id=28); delete * from greid.ccl where id=28; Both tables would have to have the same structure ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

[PHP] Re: PHP & MySQL "Move"

2003-03-03 Thread John Taylor-Johnston
Found this for anyone interested. http://www.mysql.com/doc/en/INSERT_SELECT.html John Taylor-Johnston wrote: > I was wondering about this, but decided to ask first first: > > INSERT INTO ccl.ccl_main VALUES (select * from greid.ccl where id=28); > delete * from greid.ccl where id=

[PHP] \n

2003-03-04 Thread John Taylor-Johnston
Nothing fancy. Can't get it to echo ¶ mary had a little lamb if ($testtextarea) { $inputresult = str_replace(\n, '¶'.\n, $testtextarea); echo "$inputresult"; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Tried: [PHP] \n

2003-03-04 Thread John Taylor-Johnston
I have also tried: $inputresult = str_replace('\n', '¶\n', $testtextarea); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] \n

2003-03-04 Thread John Taylor-Johnston
Jon, Anyone, Paragraph sign actually. I'm filterting some data for MySQL. I need a field delimiter. I don't want to use \n. Contents of each field are on a signel line of text. I have come up with this, unless someone can suggest better: if ($testtextarea) { $inputresult = str_replace("\r", "",

[PHP] StrPos/stristr

2003-03-04 Thread John Taylor-Johnston
http://www.php.net/manual/en/function.stristr.php http://www.php.net/manual/en/function.strpos.php Input from a I want to scan endless lines of $something. If the First Three characters of any line begin with "au:" (case insensitive) I want to filter out that line, and let $au = that line of tex

[PHP] Re: filesave

2003-03-04 Thread John Taylor-Johnston
","")or die("Could > not connect"); > print "Connected successfully"; > mysql_select_db("bdoi_change")or die("could not select > database"); > > $query = "select * from entry where login='$login&

[PHP] crontab

2003-03-04 Thread John Taylor-Johnston
Can I run a php script in crontab? Do I echo or print? Anyone doing it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] crontab

2003-03-04 Thread John Taylor-Johnston
Cal, Liam, Jimmy, Thanks. If this is a serious security hazard, could you show me some code that is more secure? I am the "root". Mind you I've never worked with crontab before. I want to run /var/www/backup_mysql.php I suppose I should start by putting it somewhere not publicly accessible? Tha

[PHP] syntax error

2003-03-04 Thread John Taylor-Johnston
Sigh :) It all works so much better if I use: if(eregi('^au: (.*)$',$line,$m)) { But I want to use a function. But nothing is returned. So what did I do wrong now? --snip echo filter_strings("au:"); function filter_strings($tofilter){ echo $tofilter.""; #if(eregi('^$

Re: [PHP] syntax error

2003-03-04 Thread John Taylor-Johnston
Thanks Keven. Didn't see that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] fopen

2003-03-05 Thread John Taylor-Johnston
#http://www.php.net/manual/en/function.fopen.php $contents = fopen ("/home/pathto/file.txt", "r"); if ($contents){echo"$contents";} else{echo "no contents there";} Questions: What is the use of "@fopen"? Does anyone see a better way? -- PHP General Mailing List (http://www.php.net/) To unsubs

Re: [PHP] PHP vs. CGI

2003-03-05 Thread John Taylor-Johnston
Three advantages I like: 1- no more cgiwrap. 2- thus I can work in any directory and am not bound to cgi-bin 3- Sheer ease of coding. A lot easier to learn, it's open-source and newsgroups are more helpful. Perl groups are less helpful, programmer centred and not newbie-friendly. Just my 2¢ --

[PHP] Re: PHP vs. CGI

2003-03-05 Thread John Taylor-Johnston
If you switch over, will you be able to port your database? > Does PHP use less system resources than CGI on a server? > I have a bulletin board which is incredibly active, but there is a PHP > sister to it. Again, when coding for a BB, I appreciate not being bound to work in /cgi-bin/ especial

[PHP] Re: fopen

2003-03-05 Thread John Taylor-Johnston
Mat>To get data out of the file that you Mat>have opened, you will need to read() it n. Mat>http://www.php.net/manual/en/function.fread.php Ok, how about this? What about error checking if the file contains something as I include below? Is that enough? $contents";} else{echo "no contents there";

[PHP] error checking with fread

2003-03-05 Thread John Taylor-Johnston
http://www.php.net/manual/en/function.fread.php What about error checking if the file contains something as I include below? Is that enough? Is this the right way? $contents";} else{echo "no contents there";} ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://w

[PHP]

2003-03-05 Thread John Taylor-Johnston
Instead of using fread, I want to upload a *.txt file using: and display it in a textarea. Where do I go now? Specifically, how do I get $contents? Thanks, John $contents";} else{echo "no contents there";} ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://ww

[PHP] fread or not?

2003-03-05 Thread John Taylor-Johnston
I need to upoload a local text file into memory using: The script below will only work if I am using my localhost. Any ideas? John \n"; if (!$filename) { echo "!\$filename \n"; }else{ #$filename = "/usr/local/something.txt"; #echo "\$filename $filename\n"; $handle = fopen ($filename, "r");

[PHP] I'm lost: text file upload

2003-03-05 Thread John Taylor-Johnston
Jason, I've already been looking at: http://www.php.net/manual/en/function.move-uploaded-file.php http://www.php.net/manual/en/features.file-upload.common-pitfalls.php http://www.php.net/manual/en/features.file-upload.php Indeed: http://ca.google.yahoo.com/bin/query_ca?p=php.net+upload+file and ht

[PHP] Re: How PHP recover value from another frame?

2003-03-05 Thread John Taylor-Johnston
You are going to need to start a session. http://www.php.net/manual/en/ref.session.php http://www.php.net/manual/en/function.session-start.php The idea was to see if $variable was in the session. If it was, use the session variable. I was passing a lot of variables through before this, until I

Re: [PHP] I'm lost: text file upload

2003-03-05 Thread John Taylor-Johnston
Where in the manual? > > I'm looking for a couple of lines of code so I can upload the contents of a > > *.txt into a buffer > You can't upload to a 'buffer', it has to be a file. Example in manual on how to > upload a file. Here? http://www.php.net/manual/en/features.file-upload.php ?? > BUT i

[PHP] $HTTP_POST_FILES

2003-03-06 Thread John Taylor-Johnston
Nifty. To share my finding ... Thanks, John Upload File C:\WINDOWS\Bureau\microweb\ERIC.TXT Read this file: Upload Results Your file contained: \n"; echo "$fileContents\n"; echo "\n"; #echo ($fileContents); ?> file_uploads = 1 upload_max_filesize = 2M upload_tm

[PHP] _FILES

2003-03-06 Thread John Taylor-Johnston
$HTTP_POST_FILES as opposed to $_FILES is older syntax? $HTTP_POST_FILES is still compliant? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] include or function

2003-03-06 Thread John Taylor-Johnston
I have an *.inc with html, a rather long list of . I want to clean this up some. I'm going to declare $FieldName and $ToBeSelected before I call include("options.inc"). I also want to select one of the in advance. The problem is ... this is beginning to look like a function, which I will decla

[PHP] MYSQL :(

2003-03-06 Thread John Taylor-Johnston
Ok, I'm off topic. I'm trying to build some php code but can't get my SQL right. http://www.mysql.com/doc/en/INSERT_SELECT.html insert into ccl.ccl_maintest (id,RNum,YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,SR,PL,PR,JR,VNum,INum,DT,PG,LG,SF,OL,KW,AUS,GEO,AN,RB,CO,RR) select id,RNum,YR,AU,ST,SD,SC,BT,BD,B

Re: [PHP] MYSQL :(

2003-03-06 Thread John Taylor-Johnston
ur field list? > insert into ccl.ccl_maintest (id,RNum,YR,AU,ST > ^^^ > Here :) > > > > J -- John Taylor-Johnston - "If it's

[PHP] Array - Newbie question

2003-03-08 Thread John Taylor-Johnston
New at this, somewhat: http://www.php.net/manual/en/ref.array.php $EricCodesArray = array ( "CO" => "Description", "Input Name", "Select Name", "Option Name", "Option Selected", "AN" => "ERIC Number", "EricAN", "SelAN", "AN", "AN «Annotation»", "TI" => "Title", "EricTI", "SelTI", "BT"

Re: [PHP] Array - Newbie question

2003-03-08 Thread John Taylor-Johnston
echo $EricCodesArray[2][2]; No. > would this work ? > $EricCodesArray[2][2] ? > #http://www.php.net/manual/en/ref.array.php > $EricCodesArray = array ( > "CO" => "Description", "Input Name", "Select Name", "Option Name", > "Option Selected", > "AN" => "ERIC Number", "EricAN", "SelAN", "

[PHP] Array - Newbie question

2003-03-08 Thread John Taylor-Johnston
>>echo $EricCodesArray[2][2]; No. Sorry. Empty set. I would also like to express it something like: select EricCodesArray where TI displays [2] I want to pass TI into a function and build some html for that record. Pseudo code: echo (TI[0] ); $EricCodesArray = array ( "CO" => "Description", "

[PHP] More array syntax

2003-03-08 Thread John Taylor-Johnston
I have an array $var (see structure below), which contains AN, AU, TI, PY ... etc. (28 in total - no teasing.) How can access these keys so I can do this: foreach key in $var until $var.length { if(!$something){$something = filter_strings("something: ",$line);} } So I can avoid doing this 28 tim

[PHP] stripslashes()

2003-03-08 Thread John Taylor-Johnston
I need to stripslashes() practically every $value as I pass data from one submit to another. L\'apprentissage d\'une langue ... Instead of doing it to every $value, someone showed me once something I could add something to the beginning of my script. It was some type of code on a post_var that

[PHP] MySQL or PHP question?

2003-03-09 Thread John Taylor-Johnston
I don't know whether this is a MySQL or PHP quesiton. $SQL = "SELECT * FROM table ORDER BY id asc LIMIT $autoindex -5 ,5;"; I would like to get the autoindex value of my table and use it in my SQL. Can I get the autoindex? :) How? -- PHP General Mailing List (http://www.php.net/) To unsubscri

[PHP] auto_increment $value

2003-03-09 Thread John Taylor-Johnston
Anyone know how to get the auto_increment $value out of a mysql table. I'm thinking it is in mysql_fetch_array but don't see how to get it. > $SQL = "SELECT * FROM table ORDER BY id asc LIMIT $autoindex -5 ,5;"; > > I would like to get the autoindex value of my table and use it in my SQL. Can I

Re: [PHP] auto_increment $value

2003-03-09 Thread John Taylor-Johnston
$news = mysql_query("SHOW TABLE STATUS FROM ".$db2." LIKE '$table2'"); while ($table_status = mysql_fetch_array($news)) { $autoindex = $table_status['Auto_increment']; } Got it. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/un

Re: [PHP] auto_increment $value

2003-03-09 Thread John Taylor-Johnston
I'll have a look at that too. Thanks! What do you make of this: My browser is all snuffed up! It dodnint wwork aniwore! http://ccl.flsh.usherbrooke.ca/tools/ Choose Greid. Works ok. Choose JDaxell and the stops working after 184. Even with: Too much HTML or too much in one . I'll have to ge

Re: [PHP] auto_increment $value

2003-03-10 Thread John Taylor-Johnston
Necessary, or at least cleaner, if there are less than 5 records in your database. > Why don't you just use "select * from table order by id DESC limit 0,5"? > > I don't see any necessary to get the auto_increment value. > > Anyone know how to get the auto_increment $value out of a mysql table.

Re: [PHP] auto_increment $value

2003-03-10 Thread John Taylor-Johnston
Sounds better. Thanks Jimmy Brake wrote: > hmm > > > i could be misunderstanding but > > select max(your_autoincrment_column) from your_table -- John Taylor-Johnston - "If it's not op

[PHP] Header order

2003-03-14 Thread John Taylor-Johnston
For the record, am I declaring these in the correct order? Thanks, John http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Header order

2003-03-16 Thread John Taylor-Johnston
You do have to declare the headers first !!?? John Taylor-Johnston wrote: > For the record, am I declaring these in the correct order? > Thanks, > John > > > header("Content-type: text/notabene"); > header("Content-Disposition: attachment; filename=".$d

[PHP] Re: Header order

2003-03-16 Thread John Taylor-Johnston
You do have to declare the headers first !!?? John Taylor-Johnston wrote: > For the record, am I declaring these in the correct order? > Thanks, > John > > > header("Content-type: text/notabene"); > header("Content-Disposition: attachment; filename=".$d

[PHP] Arrays

2003-03-16 Thread John Taylor-Johnston
I thought I understood this example: http://www.php.net/manual/en/ref.array.php array( 'first' => 'Caleb', 'last' => 'Maclennan' ) ); echo "My first name is {$var['name']['first']}!"; ?> I can do that. But, my array looks more like: $var = array (

[PHP] How to loop?

2003-08-12 Thread John Taylor-Johnston
I understand the principle of mail. What I want to do is use a as a mailing list, something like this. How do I loop it? [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] hi everyone, how are you? http://www.php.net/manual/en/function.mail.php ?> John -- PHP General Mailing List (htt

[PHP] How to Select

2003-08-14 Thread John Taylor-Johnston
Ok, this is a basic MySQL question, but I don't know how to code it in PHP. I want to check in StudentId. If it exists, ... Anyone good humoured who would help me fill in the blank. Like I should know this, but haven't even thought of coding SQL in a while :) $myconnection = mysql_connect($serve

Re: [PHP] If you ever had a Vic20

2003-08-14 Thread John Taylor-Johnston
Ok ... so I can do it this way (below), but there must be a more intelligent way? This is like something I did with my Vic20, 19 years ago. (If you ever had a Vic20 ... :) you might sympathise) while ($mydata = mysql_fetch_object($news)) { if ($mydata->StudentId = $StudentId) {$found =1}else{$fo

Re: [PHP] If you ever had a Vic20

2003-08-15 Thread John Taylor-Johnston
OK, I tried this, but am getting this error: Warning: Wrong parameter count for mysql_num_rows() in /.../testals.php on line 189 189> if (mysql_num_rows() == 1) What's up? John $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query("select Stu

Re: [PHP] If you ever had a Vic20

2003-08-15 Thread John Taylor-Johnston
> I had a Vic20 sitting next to a Lisa... :) The debate in them days was whether a timex-simplex would outlast. Commodore sold a lot but never went anywhere past high school labs. I knew a guy with a PC who laughed at every else. Funny how things turned out. -- PHP General Mailing List (http

Re: [PHP] If you ever had a Vic20

2003-08-15 Thread John Taylor-Johnston
:) Tried that: Warning: Supplied argument is not a valid MySQL result resource in /.../testals.php on line 189 189> if (mysql_num_rows($news) == 1) John > Matt> mysql_num_rows($news) $server = "localhost"; $user = ""; $pass = ""; $db = "redwards"; $table = "testals"; $myconnection = m

[PHP] mysql_num_rows

2003-08-15 Thread John Taylor-Johnston
My question got buried on the bottom of the thread. Sorry for the repeat. I'm getting this message: Warning: Supplied argument is not a valid MySQL result resource in /.../testals.php on line 189 189> if (mysql_num_rows($news) == 1) Ideas? $server = "localhost"; $user = ""; $pass = "

[PHP] Have I over done this?

2003-08-16 Thread John Taylor-Johnston
Have I over done this? Can I clean up this code any? I have two states 1) Admin mode 2) Normal mode in Normal mode, I have two states: a) student is not in the database a) student is in the database and has likely reloaded the browser. I'm trying to avoid multiple entries with the same $Student

[PHP] [php] explode that :) !

2003-08-16 Thread John Taylor-Johnston
$P1OC1Q1 = "1¶some text or some comment"; echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo $score[0]."\n"; Do I have to go through all that to get score[0] ? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] [php] explode that :) !

2003-08-16 Thread John Taylor-Johnston
Kind of hoping to do shorten it like this: echo "Your score is: ".$score[0]=split($P1OC1Q1,"¶")."\n"; No such hopes? > Looks like a really simple piece of code except for the cryptic variable names. > > >$P1OC1Q1 = "1¶some text or some comment"; > >echo "Your score is: "; $score=split($P1OC1Q1,"

Re: [PHP] [php] explode that :) !

2003-08-16 Thread John Taylor-Johnston
> Why not: > echo "Your score is: > ".split($P1OC1Q1,"¶")."\n"; Ok, but what happens when $P1OC1Q1 = "". It errors out. $P1OC1Q1 = "";#left blank $P1OC1Q2 = "1¶bunch of text"; $P1OC1Q3 = "1¶bunch of text"; $P1OC1Q4 = "1¶bunch of text"; $P1OC1Q5 = "1¶bunch of text"; $P1OC1Q6 = "1¶bunch of text";

Re: [PHP] [php] explode that :) !

2003-08-16 Thread John Taylor-Johnston
some comment"; echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo $score[0]."\n"; My problem becomes more difficult when $P1OC1Q1 = ""; Split errors out. SævË Ölêöyp wrote: > Why not: > > echo "Your score is: > ".split($P1OC1Q1,

[PHP] substr ?

2003-08-16 Thread John Taylor-Johnston
How can I find out if $mystring includes the character "¶"? Thought substr would do it? J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] substr ?

2003-08-16 Thread John Taylor-Johnston
Sorry, scrap that: if (substr_count($mystring,"¶") >0) John Taylor-Johnston wrote: > How can I find out if $mystring includes the character "¶"? > Thought substr would do it? > J -- John Taylor-Johnston --

[PHP] How do they do that?

2003-08-17 Thread John Taylor-Johnston
I was wondering. http://www.php.net/date gives me/redirects to: http://www.php.net/manual/en/function.date.php How do they do that? What $_post[??] is that? Or is it a sevrer (Apache, I suppose?) thing? -- John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

[PHP] Not fair: REMOTE_HOST

2003-08-19 Thread John Taylor-Johnston
Aw gee, $_SERVER['REMOTE_HOST'] (only REMOTE_ADDR) does not exist in PHP? Bummer. Why is that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] timestamp

2003-08-21 Thread John Taylor-Johnston
Not teasing, I know I could do this with some ready made script, but I want to make my own. I'm making a counter. CREATE TABLE `counter` ( `IPAddress` VARCHAR NOT NULL , `RemoteHost` VARCHAR NOT NULL , `TimeStamp` TIMESTAMP NOT NULL, `Date` VARCHAR NOT NULL ) Question 1, how do I creat

Re: [PHP] OT-Re: worm on th list

2003-08-21 Thread John Taylor-Johnston
Get your mail sysadmins to install spamassassin, which I believe is OpenSourced PHP, and the filter your {SPAM} directly into the garbaaage. if everyone did this, and therefore stopped opening dangerous mail, maybe we could slow some of this down. :) Oh well, just my 2¢ > On Wed, Aug 20, 2003

[PHP] count rows

2003-08-22 Thread John Taylor-Johnston
Help me out here. I want to get a numeral on the number of records in a table. What is the function? http://www.php.net/manual-lookup.php?pattern=fetch%2Brows&lang=en http://www.php.net/manual-lookup.php?pattern=fetch%2Brecords&lang=en ? :) John -- PHP General Mailing List (http://www.php.net/

Re: [PHP] timestamp

2003-08-22 Thread John Taylor-Johnston
This is what I'm using so far. But I need to put in a time stamp to calculate if the visitor is new. I want to use the IP so if the ip saved in MySQL is older than 60 minutes, it will write a new record, if not, don't: $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myco

Re: [PHP] timestamp

2003-08-22 Thread John Taylor-Johnston
Anyone? Please :) John Taylor-Johnston wrote: > This is what I'm using so far. But I need to put in a time stamp to calculate if the > visitor is new. I want to use the IP so if the ip saved in MySQL is older than 60 > minutes, it will write a new record, if not, don't

Re: [PHP] timestamp

2003-08-22 Thread John Taylor-Johnston
I'm creating a counter. I want a timestamp where I can calculate if a time stamp is older than one hour, if so do X, if not do Y. >Gabriel Guzman wrote: >http://us4.php.net/time >and >http://www.mysql.com/doc/en/DATETIME.html I have looked at both, especially http://www.mysql.com/doc/en/DATETIM

Re: [PHP] timestamp

2003-08-22 Thread John Taylor-Johnston
Indeed easier than I thought?! :) timestamp(14) is ok :) Thanks John! John -- http://compcanlit.ca/ Quoting "CPT John W. Holmes" <[EMAIL PROTECTED]>: > SELECT * FROM Table WHERE timestamp_column < NOW() - INTERVAL 60 MINUTE > will give you all rows that have a timestamp column that's over 60 minu

<    1   2   3   4   5   6   7   8   9   >