[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

[PHP] Clean Up the sand box time

2003-08-22 Thread John Taylor-Johnston
This is my favourite question. Can I clean up my 'if then' statements a tad? Must be a cleaner way? Still learning, still having fun :) Thanks, John $news = mysql_query($sql) or die(print "document.write(\"".mysql_error()."\");"); $found = 0; while ($mydata = mysql_fetch_object($news)) { if

Re: [PHP] Clean Up the sand box time

2003-08-23 Thread John Taylor-Johnston
Yes, but must be a better way to setup my if.then's ? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Arrays

2003-03-16 Thread John Taylor-Johnston
> ) > > > > What I want to get is the keys 'AN' and 'AU' as values. > > > > while (??){ > > echo "This key is $var[??]"; > > } > > > > This key is AN > > This key is AU > > foreach($var as $key => $value

[PHP] copy ...

2003-03-16 Thread John Taylor-Johnston
have this code. snip filter_strings("TI: ", $textarea) function filter_strings($tofilter,$line){ if(eregi('^'.$tofilter.' (.*)$',$line,$m)) { $filtered=$m[1];

Re: [PHP] copy ...

2003-03-17 Thread John Taylor-Johnston
rong feeling that POSIX regexs cannot do multiline, try using > perl-compatible, or make a loop to read the textarea content line by line > > John Taylor-Johnston wrote: > > >I need to process the contents of > > > >SU: something ... blah blah¶ > >TI: Title ... asasa

Re: [PHP] copy ...

2003-03-17 Thread John Taylor-Johnston
t to use > > eregi("TI([^¶]*)¶",$line,$m) > > so it's not greedy. > > ---John Holmes... > > - Original Message - > From: "John Taylor-Johnston" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]&g

Re: [PHP] copy ...

2003-03-17 Thread John Taylor-Johnston
examples. phpbuilder.com also > has a good article on them. > > ---John Holmes... > > - Original Message - > From: "John Taylor-Johnston" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, March 17, 2003 2:54 PM > Subject: Re: [PHP] co

[PHP] [php] nomenclature

2003-03-22 Thread John Taylor-Johnston
Hi, I'm writing an academic paper detailing how my bibliographic database works. $myinput = mysql_query($sql) or die(print "".mysql_error().""); while ($mydata = mysql_fetch_object($myinput)) { } What is the usual, normal, standard nomenclature for $myinput and $mydata? How do people "usually"

[PHP] [php] Blind?

2003-03-22 Thread John Taylor-Johnston
I'm blind or tired or both. Anyone see anything wrong with: $sql = 'SELECT * FROM '.$table.' WHERE MATCH (author,title,book,journal,volumenumber,issuenumber,placeofpublication,publisher,year,pages) AGAINST (\''.stripslashes($searchenquiry).'\' IN BOOLEAN MODE) ORDER BY id asc;'; I've tried lookin

Re: [PHP] [php] nomenclature

2003-03-22 Thread John Taylor-Johnston
Thanks jason, john. http://www.php.net/manual/en/function.mysql-fetch-object.php $row and $result Jason Wong wrote: > On Sunday 23 March 2003 13:13, John Hicks wrote: > > $result = mysql_query($sql) ; > > ^ > > while ($rec = mysql_fetch_object($results)) > > ^ > > I think $row is more c

Re: [PHP] [php] Blind?

2003-03-22 Thread John Taylor-Johnston
Yeah, but it works it you pass it into MySQl. Obligatory I think. I found my problem 10 lines up. A missing ; but singled out that line - just to confuse me. Sorry, it wasn't that after all. Thanks, John Tom Rogers wrote: > Hi, > > Sunday, March 23, 2003, 4:25:29 PM, you wrote: > JTJ> I'm blind

[PHP] Benchmark

2003-03-27 Thread John Taylor-Johnston
Hi, I'm tired, it's late, I'm trying to remember two URLs, I should have bookmarked. The first gives me the benchmark performance of Apache on the web. last I looked Apache was at 60% of all Internet servers used. There was another URL (probably the same site) that would tell me everything I wa

[PHP] Who is Tim O'Reilly?

2003-03-28 Thread John Taylor-Johnston
Who is Tim O'Reilly? In a nutshell? http://www.oreilly.com/catalog/opensources/book/tim.html http://oreilly.com/oreilly/about.html Perl guru? www.OpenSource.org founder? software publisher? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Who is Tim O'Reilly?

2003-03-28 Thread John Taylor-Johnston
Thanks Chris. While I am waiting, can someone help put him in context of the whole OpenSource culture? 10 words or less. I'm trying to finish a paper (university humanities academic type and geek-like coder). Chris Shiflett wrote: > > Who is Tim O'Reilly? > Ask him: http://oreilly.com/ask_tim/

[PHP] GNU & OpenSource

2003-03-28 Thread John Taylor-Johnston
What's the difference between www.GNU.org and www.OpenSource.org? I have been reading: http://www.oreilly.com/catalog/opensources/book/intro.html but don't get what DiBona, Ockman & Stone mean. OpenSource permits folks like RedHat to distribute a paid CD, GNU doesn't? OpenSource permits greating

[PHP] GNU & Open Source

2003-03-30 Thread John Taylor-Johnston
Where does PHP.net stand? Is it GNU or OpenSource or both? What's the difference between www.GNU.org and www.OpenSource.org? I have been reading: http://www.oreilly.com/catalog/opensources/book/intro.html but don't get what DiBona, Ockman & Stone mean. OpenSource permits folks like RedHat to distr

Re: [PHP] GNU & Open Source

2003-03-31 Thread John Taylor-Johnston
Hi, > > This is a list for questions about PHP. Look in the titlebar of your > > browser when you go to www.php.net > He was asking *where* PHP stands (regarding licenses), not *what* PHP > stands for. Maybe PHP FAQ should have something about licenses. Indeed, I did find somehting ... in the li

Re: [PHP] GNU & Open Source

2003-03-31 Thread John . Taylor . Johnston
Rasmus, I hardly call it a "school" paper. I haven't done one of them in 25 years. But if you are not the one to ask, nor is the "general" list not the place to ask, who do I email or where do I post to find out more about your statement at: http://www.php.net/license/ "GPL enforces many restri

[PHP] RedHat

2003-04-05 Thread John Taylor-Johnston
gestions where to ask, to give them a nudge :) ? -- John Taylor-Johnston - "If it's not open-source, it's Murphy's Law." Université de Sherbrooke: http://compcanlit.ca/ -- PHP General Mailing Li

Re: [PHP] RedHat

2003-04-05 Thread John Taylor-Johnston
>John I'm not sure if you've noticed, ... Larry, Pete et al., Point taken. I won't exacerbate the point, but php.net does point out the lists, and this "general" group in particular, are for "talking about PHP". "There are a number of mailing lists devoted to talking about PHP and related pro

Re: [PHP] 4 hours staring - can't see clear.

2003-06-11 Thread John Taylor-Johnston
Lars, Thanks. I am getting this error however: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in It does not like addslashes() because of the {}? What is a sensible work around? Or do I even need addslashes?? if ($found) { $sql = "INSERT INTO $dbtable (RNu

Re: [PHP] 4 hours staring - can't see clear.

2003-06-12 Thread John Taylor-Johnston
Lars, Much thanks. Life saving :) Ignatius, I like your idea. Thanks to you too. John > if (isset($var[$key]['Option'])) > { > // Flag that we got one this time round. > $found = true; > // Get the translated name from $var. > $recor

[PHP] Looking for a forum

2002-09-25 Thread John Taylor-Johnston
Hi, I'm looking for some forum script, a bit like this: http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi Can anyone post a link to something useful? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Owner

2002-09-25 Thread John Taylor-Johnston
Hi, Who is the forum's owner? I want to post questions using [EMAIL PROTECTED] and [EMAIL PROTECTED] in my from: and reply-to: I post infrequently to this list using news://news.php.net/php.general NOT [EMAIL PROTECTED] This is about the only list I post to. I've been receiving a lot of spam

Re: [PHP] Owner

2002-09-25 Thread John Taylor-Johnston
Justin, > Best advice is to post strictly to the newsgroup with a dud email address, Unfortunately, that doesn't work. I had a hotmail address, but not acceptable. Someone did not put it on the "accepted' list. Someone back there needs to accept that address to allow that poster to post when u

[PHP] check for \n

2002-11-18 Thread John Taylor-Johnston
Like I have a clue :) I want to convert some fields from TEXT to VARCHAR(255). (Going from a textarea to an input type=text) I've checked the length of each $mydata->ST, so I won't be losing data. What I am worried about is losing data if there are \n in any of the fields. How do I check to see i

Re: [PHP] MY CLIENT

2002-11-20 Thread John Taylor-Johnston
ived > your anticipated positive reply. This matter should be > treated as urgent and confidential. This is very > important. > > Best Regards, > > Barrister George Emeka. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.

[PHP] masters thesis

2002-06-05 Thread John Taylor-Johnston
Hi, Not your usual question. Sort of off-topic, but not really. I'm doing a masters thesis on the interdisciplinary study of the use of computer technology (especially MySQL, PHP & PHPMyAdmin) in the study of and research on Comparative Canadian Literature. http://compcanlit.ca/ ... Humanities

[PHP] Re: redirection

2002-06-05 Thread John Taylor-Johnston
ere any way other than > > header("Location: http://www.php.net/";); > > to redirect to another page. -- John Taylor-Johnston - ' ' ' Collège de Sherbrooke: ô¿ô ht

Re: [PHP] mail() problem

2002-06-05 Thread John Taylor-Johnston
> Yes. I had something similar. Try putting 'Reply-To: [EMAIL PROTECTED]' in > the fourth argument for mail. For some reason some systems balk without > a reply address, I'm not certain why? I questioned my ISP on that. They had something in their sendmail.exe which prevented outgoing mail (scrip

[PHP] Re: Alocating file in memory...

2002-06-05 Thread John Taylor-Johnston
e file the server doesn't need to >alocate it in memory each time. > > Thanks > > Paulo Cesar -- John Taylor-Johnston - ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesher

[PHP] Re: PHP Apache Module AND command Line

2002-06-05 Thread John Taylor-Johnston
of PHP that is > installed as a module in/for Apache? Basically, I want to have both on the > same server. Or can this even be done? > > Thank You > Steve -- John Taylor-Johnston - &

[PHP] Re: Passing variable to new page and pulling the rest of info from database

2002-06-05 Thread John Taylor-Johnston
Should find enough code for displaying graphics (and sending by smtp) in this code. You'll find some session stuff too. HTH J http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/index.html.phps http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/display_image.phps http://www.co

[PHP] Re: Finding out how a variable was registered

2002-06-05 Thread John Taylor-Johnston
a page that handles a form and I need to know whether or not a variable was created >using the GET or POST method (I don't want the user to be able to to >'foo.php?var=value' and mess with the results) > - - Joe > > [EMAIL

[PHP] text file

2002-06-05 Thread John Taylor-Johnston
I want to open a text file which has 12 lines and (1) insert a new line at line[0] (2) re-save the text file only with 12 lines (Therefore line[12] gets chopped out. I had some code to do this with Perl. open (NEW, ">$filepath\\$file"); print NEW "$something"; for ($i = 2; $i < 12; $i

[PHP] PHPMyAdmin Alternative?

2002-06-08 Thread John Taylor-Johnston
Are there alternatives to PHPMyAdmin available? www.mysql.com/ is supposed to have one, no? -- John Taylor-Johnston - - Université de Sherbrooke: -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: Date?

2002-06-08 Thread John Taylor-Johnston
Sunday, June 09, 2002 But I would use: Don't know why, but someone told me once it had something to do with versions. John Jeremy Bowen wrote: > I am having nothing but trouble with the date function. I want it to print > out a date like this: Saturday June 8, 2002 but as soon as I put spa

[PHP] Re: Javascript & PHP cookies

2002-06-08 Thread John Taylor-Johnston
Absolutely. I've done it. Cookies are cookies. What I don't like is that the cookie is not saved unitl after a submit. In Javascript, I have JS code that will assign a value and save it to a cookie and then recall the cookie value and document.write(myvalue), over and over if I want, without EV

[PHP] Re: Date?

2002-06-08 Thread John Taylor-Johnston
I added a comment to the FAQ: http://www.php.net/manual/en/function.date.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHPMyAdmin Alternative?

2002-06-08 Thread John Taylor-Johnston
This a binary? I was hoping for a web-based (PHP, Perl, ASP, etc.) alternative - like PHPMyAdmin - to analyse. "César l . aracena" wrote: > Look in http://www.mysql.com/downloads/gui-mycc.html and download the > The problem is that you can't issue multiple SQL queries, but that will > be solved

Re: [PHP] alternatives? (Was: Shot in the dark)

2002-06-20 Thread John Taylor-Johnston
Sorry Chris, It's set at June 20th here? Maybe my NNTP server? John Chris Garaffa wrote: > Hello, > any chance you could set your clock to the correct date? It says July 6, > and is really screwing up my sorting order for mail... thanks > > On Saturday, July 6, 2002, at 04:49 PM, jtjohnston.

[PHP] Cookie, how to name

2003-09-01 Thread John Taylor-Johnston
-- John Taylor-Johnston - "If it's not open-source, it's Murphy's Law." ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ -

[PHP] Cookie, how to name

2003-09-01 Thread John Taylor-Johnston
Sorry, hit sent by accident :) I have a cookie: if (!isset($_COOKIE["weather_htm"])) But I want the name of the cookie to include $StudentId like this: if (!isset($_COOKIE["weather_htm".$StudentId])) Of course, the line does not read the cookie. What is the problem with my syntax please? Joh

[PHP] cookie crumbles

2003-09-01 Thread John Taylor-Johnston
I create this cookie, using Javascript:: testals.flsh.usherb.ca FALSE / FALSE 1062433227 weather.htm9995 1 If the browser is reloaded, I want php to read the cookie and do my else statement. Even after a browser shut-down and restart, I cannot get PHP to read the cookie (first part of my if

[PHP] Am I dreaming or what :)

2003-09-03 Thread John Taylor-Johnston
I have a directory jammed-packed with images. I want to read the directory contents /www/usr/htm/images/ and display randomly any *.gif or *.jpg in said directory. Do-able? Seriously? Ideas? Places to start? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

Re: [PHP] cookie crumbles

2003-09-03 Thread John Taylor-Johnston
As it turned out, all I had to do was get rid of the period "." and things began to work better. I also had to remember to close my browser and empty the cookie jar. Thanks, J Jaap Van Ganswijk wrote: > At 2003-09-01 00:49 -0400, John Taylor-Johnston wrote: > >I create

Re: [PHP] Am I dreaming or what :)

2003-09-04 Thread John Taylor-Johnston
)); > echo "$num = $files[$num]"; > [/code] > > John Taylor-Johnston wrote: > >I have a directory jammed-packed with images. > >I want to read the directory contents /www/usr/htm/images/ > >and display randomly any *.gif or *.jpg in said director

[PHP] Display after a certain date

2003-09-04 Thread John Taylor-Johnston
Anyone have a quick fix for a part of an html page that I do not want to display until after October 1st, and not after October 31st ? J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Display after a certain date

2003-09-05 Thread John Taylor-Johnston
Jay, I should have though of that. Thanks. "Jay Blanchard" <[EMAIL PROTECTED]> wrote: >$display_start = "2003-10-01"; >$display_end = "2003-10-31"; >if((date("Y-m-d") >= $display_start) && (date("Y-m-d") <= >$display_end)){ >print($stuff); >} >?> Cesar: Is your server is set up correctly?

[PHP] $HTTP_REFERER / Hijacking

2003-09-06 Thread John Taylor-Johnston
This is kind of old-fashioned, but I created a counter that prevents hijacking. "district" is a partial of the word in the URL. If it does not exist, echoes hijacking ... snip--- if(stristr($HTTP_REFERER,"district")) { #... #echo "document.write(\"$num_rows visitors since August 23, 2003\");"

[PHP] [php] formmail.pl formmail.php

2003-09-21 Thread John Taylor-Johnston
use of formmail.pl these days would need updating to protect it from spamming. Anything available? -- John Taylor-Johnston - "If it's not open-source, it's Murphy's Law." ' ' &#x

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

2003-09-22 Thread John Taylor-Johnston
I don't know if such an animal exists? I use Windows Wordpad as a text editor. Then I use Microweb from: http://www.indigostar.com/microweb.htm You might want to download a newer copy of PHP from http://www.php.net/downloads.php This is lilkely not what you are looking for, but will do a very nice

[PHP] A _post question I guess

2003-09-29 Thread John Taylor-Johnston
I have a form. It has any number of hidden fields, named "exercise 1-100". Their names all start with "exercise" as in: ... ? any number fo these possible ... How can I create one scipt that will recognise all of them? Any number of them. My idea is a bit like formmail.pl that reads any old

Re: [PHP] A _post question I guess

2003-09-29 Thread John Taylor-Johnston
Ok, but the problem is that I will, might have other fields. I need to filter out just the exerciseN fields. Interesting though thanks, John Brad Pauly wrote: > You could just loop over the _POST array. > > foreach ($_POST as $field_name => $field_value) { > $content .= "$field_name = $f

Re: [PHP] A _post question I guess

2003-09-29 Thread John Taylor-Johnston
Brad. Perfect thanks. > Brad Pauly wrote: > foreach ($_POST as $field_name => $field_value) { > if (stristr($field_name, 'exercise')) { > $content .= "$field_name = $field_value\n"; > } > } Tom, Not sure why, but wouldn't work >Tom Rogers wrote: >if(isset($_POST['exercise'])){

[PHP] $MySQLver[0]

2003-09-30 Thread John Taylor-Johnston
$MySQLver[0] doesn't seem to echo anything. Code used to work, on another server. Problem with php version? PHP Version 4.1.2 Just updated to MySQL version MySQL 4.0.15-standard Can't find "MySQLver" in phpinfo. if($MySQLver[0] >= 4){ $sql = 'SELECT * FROM '.$table.' WHERE MATCH (KW,AUS,GEO) AGA

Re: [PHP] $MySQLver[0]

2003-09-30 Thread John Taylor-Johnston
John, Thanks! Actually, I just did a bit of reading. http://www.phpbuilder.com/mail/php-general/2001071/1540.php MySQLver was implemented in PHP 4.0.5. My fault. Sorry. Thanks for the read. John "John W. Holmes" wrote: > John Taylor-Johnston wrote: > > > $MySQLver[0

[PHP] embedding code

2003-10-02 Thread John Taylor-Johnston
Are there other ways of embedding or code into an HTML file? On one project, when I try to upolad files with embedded PHP code, they actually filter for those tags and won't permit the FTP transfer. Like reeeal paranoid. Any ideas? John

Re: [PHP] embedding code

2003-10-02 Thread John Taylor-Johnston
it before for some vb script. What do I do now? Anything in the php.ini I could turn off? John Spectre013 wrote: > Try > //php Code here > > Are there other ways of embedding or code into an HTML > file? On one project, when I try to upolad files with embedded PHP c

Re: [PHP] embedding code

2003-10-03 Thread John Taylor-Johnston
John Apache. How exactly? John "John W. Holmes" wrote: > John Taylor-Johnston wrote: > > Brian or anyone, > > > > Ok, supposing I don't want someone to be able to use

[PHP] $_SERVER['REMOTE_HOST']

2003-10-04 Thread John Taylor-Johnston
PHP is Open Source. This is the general forum. Here is my suggestion: Create $_SERVER['REMOTE_HOST'] as a variable. $gethost = gethostbyaddr($_SERVER['REMOTE_ADDR']); is getting old. Anyone agree? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub

Re: [PHP] embedding code

2003-10-04 Thread John Taylor-Johnston
How do you do that? > Wouldn't it be a WHOLE lot smarter to just disable/enable PHP for > specific sites/folders, etc? What web server are you using? Anyone? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] embedding code

2003-10-04 Thread John Taylor-Johnston
How do you do that? > Wouldn't it be a WHOLE lot smarter to just disable/enable PHP for > specific sites/folders, etc? What web server are you using? Anyone? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Am I asking too much?

2003-10-09 Thread John Taylor-Johnston
$sql1 works, but $sql2 doesn't. Am I asking too much? :=) $sql2 echoes ok. If I copy it and run it in phpmyadmin, it works, but this way as php code, it flunks out when I add: DELETE FROM '.$db.'.'.$table.' WHERE id='.$id.' LIMIT 1; Ideas? John snip - $sql1 = 'inser

<    1   2   3   4   5   6   >