[PHP] Re: 2 decimal places

2001-09-26 Thread Geir Eivind Mork

Kurth Bemis wrote:

 i'm looking for a php function to add 2 decimal place sto a number.  if the
 number already have one decimal place then one more zero should be added to
 make it two decimal placesanyone know of a quick way to do this?

printf(%.2f,$var);
-- 
PHP Developer, home: http://www.moijk.net | work: http://www.coretrek.com
parse_str: Parses the string into variables | 
http://www.php.net/manual/en/function.parse-str.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: showing wrong php version after install

2001-09-26 Thread Geir Eivind Mork

Caleb Carvalho wrote:

 just finished installing php-4.0.6, now when writing the test.php page with
 the ?phpinfo();?

Try again after you restarted apache ;)
 
-- 
PHP Developer, home: http://www.moijk.net | work: http://www.coretrek.com
tan: Tangent | http://www.php.net/manual/en/function.tan.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: handling errors

2001-09-26 Thread Geir Eivind Mork

Joseph Bannon wrote:

 have this function below that if an image is not there for $url, it give a
 warning.
 
 $size = GetImageSize($url);

Just use 
 $size = @GetImageSize($url);
 
but to stop display of error for all functions:
error_reporting (0);

the opposite, reports EVERYTHING, even bad code (like undeclared variables 
which is quite a security issue ;)

error_reporting (E_ALL ^ E_NOTICE);

-- 
PHP Developer, home: http://www.moijk.net | work: http://www.coretrek.com
symlink: Creates a symbolic link | 
http://www.php.net/manual/en/function.symlink.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Making session last

2001-09-25 Thread Geir Eivind Mork

Martin wrote:

 The sessions-functions works really fine. But I got one Problem: How can
 I make the php-session last more then a browser-session? When the users

Now it isn't a 'session' for nothing, for your use I guess cookies and storage 
of state in database is a much better thing. 

to make a valid example just put an unique string in a cookie and store the 
user settings in the database (or file system in cause you're silly enough not 
to use a database ;) and then just fetch them when the user enters the page and 
the cookie exists. 

-- 
PHP Developer, home: http://www.moijk.net | work: http://www.coretrek.com
rawurldecode: Decode URL-encoded strings | 
http://www.php.net/manual/en/function.rawurldecode.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Image manipulation

2001-09-07 Thread Geir Eivind Mork

Adam Plocher wrote:

 First of all, is there anyway I could have my script take a full size image
 and crop out a chunk of it to be used as a thumbnail - or just simply shrink
 the image down to be used as a thumbnail?

ImageCopyResized, requires GD.

 Also, is there anyway to convert misc image types (gif, bmp, png, etc) into
 a jpeg?

between png and jpeg with gd at least.

for everything else, ImageMagick
-- 
PHP Developer, home: http://www.moijk.net | work: http://www.coretrek.com

ImageSY: Get image height | http://www.php.net/manual/en/function.imagesy.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PDFLib and php 4.0.5

2001-05-14 Thread Geir Eivind Mork

After a great deal of swear words, preassure from my boss and numberous tries I 
now cry out for help. Can anyone compile a howto on installing pdflib so tha 
tit works with php 4.0.5 ? I've tried so many times and neither me or our 
sysadmin can manage to make php understand that I really need to get pdflib and 
php working together. It's not only giving me headache, it's a real pain. 

to compile everything else into or make php use is a like running a hot knife 
through butter but this really ticks me off.

-- 
 php developer / CoreTrek AS| transvestite, n.:  Someone who likes to 
 Sandnes / Rogaland / Norway| eat, drink, and be Mary. 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: Variables in TITLE

2001-05-14 Thread Geir Eivind Mork

Tarrant Costelloe wrote:

 I have a log in script written in PHP4 which accesses a secure server. Once
 entered I want the the secure page to hold the users name (from variable) in
 the TITLE header  Something along the lines of this:
 title$name is logged in/title
 Obiously I have tried that with no luck, anyone got any ideas?

title?=$name? is logged in/title

?
-- 
 php developer / CoreTrek AS| Tell a man there are 300 billion stars
 Sandnes / Rogaland / Norway| in the universe and he'll believe you.
 web: http://www.moijk.net/ | Tell him a bench has wet paint on it and

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Image Upload

2001-05-07 Thread Geir Eivind Mork

Kyle Mathews wrote:

 I'm looking for some code that will upload images to my server from a form
 submission.
 I'd also like it to check for a max file size of the images.
 Any help would be appreciated.

what about reading the manual? there are variables that contain the file size.

http://www.php.net/manual/en/features.file-upload.php

-- 
 php developer / CoreTrek AS| Genius, n.:  A chemist who discovers a
 Sandnes / Rogaland / Norway| laundry additive that rhymes with
 web: http://www.moijk.net/ | bright. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] best ide for windows

2001-05-06 Thread Geir Eivind Mork

On Sunday 06 May 2001 14:57, Alexander Bierbrauer wrote:
  does anyone know a good PHP developer IDE for Windows?? I'm using PHP
 Coder but it's a little bit to buggy.

slickedit is what I preffer to use, you got syntax highlighting, api help, 
function tagging so that you get info about your own functions, autocomplete 
on variable and functionnames, configurable to the limits and support almost 
any other major and minor language beside php. a bit pricy but still.
-- 
 php developer / CoreTrek AS| Above all things, reverence yourself. 
 Sandnes / Rogaland / Norway| 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how?

2001-05-04 Thread Geir Eivind Mork

On Thursday 03 May 2001 17:30, Jason Stechschulte wrote:
  On Thu, May 03, 2001 at 03:56:55PM -0700, elias wrote:

   i even tried the eval() which should work, but it didn't, scroll down to
   message with Subject: $hello
  I don't think you understand eval().  Either that or I don't.  If I
  understand correctly, eval(); requires a complete PHP statement.
  Welcome $username is not a complete PHP statement.

that is correct, eval(echo $string); can be used as a extremly silly way to 
echo though. 

  Why don't you just make myfile.txt a valid php file and then include it?
  myfile.txt.php:
  Welcome ?php echo $username;?
  Enjoy your staying at: ?php echo $site_name;?
  Mail admin. at ?php echo $admin_mail? for any questions...

Now this is as effective as to go to another room for each sip of a glass you 
make, why not just:
?
echo OUT
Welcome $usernamebr
Enjoy your staying at: $site_namebr
Mail admin at $admin_mail for any questions
OUT;
?
or at least use ?=$var? if you want to be mean to the server instead of 
wearing out the keyboard.

-- 
 php developer / CoreTrek AS| Higgledy Piggledy  Coeducational Yale
 Sandnes / Rogaland / Norway| University   Extracurricular Gave up
 web: http://www.moijk.net/ | misogyny  Heterosexual Opened its door. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] HI

2001-05-03 Thread Geir Eivind Mork

On Thursday 03 May 2001 09:55, Jorge Amaya wrote:

  I am new user of php, I have installed apache 1.3.x, php3 and mysql, but
  I have a problem, My navigator doesn't recognize the files of php3, that

why install php3, not php4 ? 

  is to say it doesn't work me php in the navigator, I have configured
  such and like says the manual in php.ini and also in the directives of

make sure the httpd.conf / apache.conf have the following datas

LoadModule php4_modulelibexec/libphp4.so  
 
or one with php3 pointing to a existing resource.

DirectoryIndex index.php index.html 

or .php3, .phtml etc

and 
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps

or for php4

AddType application/x-httpd-php .php 
AddType application/x-httpd-php-source .phps  
  
now the apache help files might be needed to fully understand what this does 
in case you wonders.

-- 
 php developer / CoreTrek AS| The skater, Barbara Ann Scott Is so
 Sandnes / Rogaland / Norway| fuckingly winsome a snot,  That when
 web: http://www.moijk.net/ | posed on her toes  She elaborately shows

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Compressing an upload

2001-05-02 Thread Geir Eivind Mork

On Thursday 26 April 2001 00:37, Michael Conley wrote:
  I am going to have a page that will be used for visitors to upload a file
 to my web server.  I already use gzcompress to compress some of the pages

Just state that all files should be compressed cause you can't do anything 
with the files before they are on your server and then it's too late :)


Content-Type: text/plain; charset=us-ascii; name=Attachment: 1
Content-Transfer-Encoding: 7bit
Content-Description: 

stop that

-- 
 php developer / CoreTrek AS| As near as I can tell, you're not any
 Sandnes / Rogaland / Norway| crazier than the average asshole on the 
 web: http://www.moijk.net/ | street.   -- R.P. McMurphy, One Flew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php suck

2001-04-30 Thread Geir Eivind Mork

On Sunday 29 April 2001 12:54, idban secandri wrote:
  i found this when surfing this morning
  http://www.phpsucks.net/


The site www.phpsucks.net is running Apache/1.3.17-twelveHTTP (Unix) 
PHP/4.0.4pl1 on Linux.

is it just me or is it a mirror of the old php site with the text 'Hyped text 
Bloatcessor' ? 

but there are a aspsucks.com, cfsucks.com (if that ever points to cold 
fusion), perlsucks.com (which is a pro-php site), lifesucks.com, 
wifesucks.com, isucks.com, sucks.com and god knows what sucks and sucks not  
dot-com.

so I wouldn't exacly be offended if anyone though anything sucked dot com 
cause everyone thinks it sucks no matter how good it is :) 
 
-- 
 php developer / CoreTrek AS| Besides, I think [Slackware] sounds
 Sandnes / Rogaland / Norway| better than 'Microsoft,' don't you? (By
 web: http://www.moijk.net/ | Patrick Volkerding) 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with the HTTP_REFERER

2001-04-27 Thread Geir Eivind Mork

On Thursday 26 April 2001 13:33, Rosen wrote:
  main.php:
  A HREF=test.php target= _blankClick here/A

You need a good deal of beating if you do your markup like that. there are 
something called a standard and that standard would make that line look like 
this:

a href=test.php 

but anyway, make your own referer by using session variables or hardcode it.

-- 
 php developer / CoreTrek AS| The three questions of greatest concern 
 Sandnes / Rogaland / Norway| are -- 1. Is it attractive? 2. Is it
 web: http://www.moijk.net/ | amusing?  3. Does it know its place?  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Why is it dangerous to have register_globals on?

2001-04-24 Thread Geir Eivind Mork

On Monday 23 April 2001 11:56, Greig, Euan wrote:
  I have read in several places that is dangerous to have register_globals
 on, but I have not understood the (short) explanations given. Can anyone
 enlighten me?

keep it a rule to either unset any variable that you use or set them with a 
default value. how awfully nice register_globals is, I've started to be more 
aware and use of HTTP_POST_VARS and HTTP_GET_VARS in case someone get a wild 
idea to abuse some of my products. they might get some dangerous stuff, I 
can't imagine their fantasy so I just let them have as little chance as 
possible :)

-- 
 php developer / CoreTrek AS| TV is chewing gum for the eyes.   --
 Sandnes / Rogaland / Norway| Frank Lloyd Wright 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Fatal Errors and Error Handling

2001-04-24 Thread Geir Eivind Mork

   http://www.php.net/manual/en/features.error-handling.php
   have you taken a deeper look into this?
  Well, I have tried...

And what kind of problem did you encounter? 

  My problem is that not displaying anything in case of an error is a
  completely unacceptable solution. I *MUST* return a valid XML message in
  a predefined format. If not, I am violating the standard we are

but that, as far as I've understand your case, isn't a problem. 

-- 
 php developer / CoreTrek AS| Recent investments will yield a slight
 Sandnes / Rogaland / Norway| profit. 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Connecting to a MS Access database

2001-04-23 Thread Geir Eivind Mork

On Sunday 22 April 2001 22:02, Steve Maroney wrote:
  This brings up a question that I always wondered.
  Does Access have server functionality? Where do you configure these
  settings ?

If you go over the menuchoice - file, shake your mouse, bite in the cord, 
slam your head in the monitor fifteen times and then trow a bucket of water 
over your computer a new option called 'server' comes up. if not, repeat the 
steps.

Or install a database server. when using ex. asp towards an accessbase it's 
odbc that deals with the communication. it's slow, it's a bottleneck.. but it 
works :) 


-- 
 php developer / CoreTrek AS| Thus spake the master programmer: 
 Sandnes / Rogaland / Norway| After three days without programming,
 web: http://www.moijk.net/ | life becomes meaningless.   -- Geoffrey

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Linux Suggestion

2001-04-23 Thread Geir Eivind Mork

On Sunday 22 April 2001 23:51, Padraic Tynan wrote:
  You know, that's a tad rude, just suggestion an OS switch like that. :þ
  I mean, my http server isn't the only thing I run -- this is my personal
 use computer. 

I run linux and freebsd on my personal and work computer(s). but that's my 
personal choice, It does everything I want so why not :) (beside the 
neighborhood have stopped calling me for help now since I just replies that I 
haven't touched windows in ages so I can't help them with their tidious 
problems ;) 

seriosly, ever considered putting up a old computer for test-purposes? like a 
pentium 200? goes for nothing on the second hand marked.

 Windows XP Beta contains the sum total of what Windows has
 been up to now, so I don't think the OS has very much to do with it.

total sum? you mean, all bugs and security flaws gathering in one box? 
Reminds me of the insurance company that charge double if you run windows on 
the servers cause it's more prone to fail :)

 entirely experimental and recommended only for experienced users, Linux
 itself (every flavor) is still experimental, and you have to know beyond a
 shadow of a doubt what you're doing to use it. Not to mention, every time
 I've tried to set it up (RH6, Mandrake 7.1), nearly immediately following
 the installation, it's messed up, without my editing any part of it.

Try FreeBSD, it's not linux but it beats the crap out of most linux distros 
in ease to install. ofcourse redhat 7, openlinux and such is real easy but 
freebsd installs never fails unless your harddrive has the surface of the 
moon.
-- 
 php developer / CoreTrek AS| Jones' Motto:  Friends come and go, but 
 Sandnes / Rogaland / Norway| enemies accumulate. 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] What's wrong with this code?

2001-04-23 Thread Geir Eivind Mork

On Monday 23 April 2001 08:59, Alexander Wagner wrote:
  Tyler Longren wrote:

   $file = fopen(includes/about.inc, r);
   $data = fread($file, 2400);

$file = includes/about.inc;
if ($fp = fopen($file,r)) {
$data = fread($fp,filesize($file));
fclose($fp);
}

ought to work.

-- 
 php developer / CoreTrek AS| Beware of a tall dark man with a spoon
 Sandnes / Rogaland / Norway| up his nose. 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] if... then... else with HTML

2001-04-23 Thread Geir Eivind Mork

On Monday 23 April 2001 14:41, Martin Thoma wrote:
if ($word != flat) {

echo OUT
lot of crap with 's and stories about your mom
OUT;

} else { 

echo OUT
do the same
OUT;

}

remember not to have anything before or after OUT (or whatever other text you 
use instead of OUT) or you get prase errors.

Or the html/php switiching way, a fraction slower after my tests :)

?if ($world != flat) {?
html
?}  else {?
html
?]?

-- 
 php developer / CoreTrek AS| I judge a religion as being good or bad 
 Sandnes / Rogaland / Norway| based on whether its adherents become
 web: http://www.moijk.net/ | better people as a result of practicing 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Newbie Question

2001-04-23 Thread Geir Eivind Mork

On Monday 23 April 2001 17:34, Taylor, Stewart wrote:
  You've got some typo's
  if (my_type != 0){  -- if ($my_type != 0) {

if ($my_type)

if it's a check if it's true, not-equal-ing it to string 0 is a ugly way to 
do it.  just my two cents.
-- 
 php developer / CoreTrek AS| Forest fires cause Smokey Bears. 
 Sandnes / Rogaland / Norway| 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Fatal Errors and Error Handling

2001-04-23 Thread Geir Eivind Mork

On Monday 23 April 2001 17:29, Svein Roar Nilsen wrote:

  And I see no reason why we should not be allowed to handle most of the
 fatal errors we get on our own. Especially annoying is the xslt_process()
 function that returns something like brbFatal error/b:  XML parser
 error 7: mismatched tag in b/var/www/[...]. As far as I can see, this

http://www.php.net/manual/en/features.error-handling.php

have you taken a deeper look into this? 

beside, use @ in front of the command to pipe away the current error or stop 
on-screen display of errors in general. 

-- 
 php developer / CoreTrek AS| Only God can make random selections. 
 Sandnes / Rogaland / Norway| 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Buttons and such...

2001-04-22 Thread Geir Eivind Mork

On Saturday 21 April 2001 20:15, Jason Caldwell wrote:
  I know this is off-topic -- please forgive me.  But I figure someone here
  would know.
  I'm looking for some really nice *professional* looking (submit, logon,
 buy, help, etc) buttons for my website... I've done all kinds of

try do it with css:
.button {
  font-size: 10px;
  font-family: Verdana, Arial, Helvetica, Sans-serif;
  color: #ff;
  font-weight: bold;
  background-color: #77;
  border-color: #99;
}

and just input class="button" type="submit" value="text"

and the world is for your feets :)

 searches on MSN and Yahoo -- found a ton of sites that offer all kinds of
 .gifs and .jpegs -- but I must say 99% of them are garbage.

or hire somebody :)

-- 
 php developer / CoreTrek AS| I think I'll KILL myself by leaping out 
 Sandnes / Rogaland / Norway| of this 14th STORY WINDOW while reading 
 web: http://www.moijk.net/ | ERICA JONG'S poetry!! 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] I'm a moron. So?

2001-04-22 Thread Geir Eivind Mork

On Saturday 21 April 2001 04:42, [EMAIL PROTECTED] wrote:
  Alrighty.  I'm baack!  Anyways, I seem to be having stupid little
  problems, al of which are driving me insane.  I'll feel really
  stupid when you tell me the problem.  A friend told me something about
  "seeding" for random() but I didn't find anything on that.

try this and learn from it :)

? 
if (empty($name)) {
?
HTML
HEAD
TITLEHorse Race v.1/TITLE
/HEAD
BODY
Welcome to horse racing v.1.  This is a simple PHP game where you can
train, race and win money for your animals.  Eventually I'll make it a
whole barn with feeding and horses, and costs, age, breeding.  So on.
But for now, this is just a simple game.brbr

Enter six names of horses.
FORM ACTION="?=$PHP_SELF?" METHOD="post"
? for ($i=1;$i=6;$i++) { // I hate to repeat text ;)
echo "Name$i : INPUT TYPE=\"text\" NAME=\"name[]\" 
size=\"24\"BR\n";
?
input type="submit" name="submitNms" value="race them!"
/FORM
CENTERGood luck!/CENTER
/BODY
/HTML
?
} else {
srand((double)microtime()*100); // prepare the random sequence.
$randomHorse = round(rand(1,6));  // makes a random horse
$randomStrides = rand(1, 10);// whatever strides are
echo $name[$randomHorse] ." won the race by $randomStrides ! 
Congratulations."; // the var name is the array from the form.. 
}
?

-- 
 php developer / CoreTrek AS| Remembering is for those who have
 Sandnes / Rogaland / Norway| forgotten.   -- Chinese proverb 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Which is better coding style...

2001-04-20 Thread Geir Eivind Mork

On Thursday 19 April 2001 21:48, Steve Lawson wrote:
  Personally, I hate trailing {'s

Personally, I hate having the {'s on the next line. I always trail them in 
others code when they have them on the next line :) 

and there are thousand of ways that the people here displays textblocks. some 
concats between text and vars like maniacs making it look nasty. I 's out 
larger blocks. never need to switch between html and php mode in the code. I 
feel that makes it more clean. but this is as individual as preference for 
blondes, brunettes and redheads :)

-- 
 php developer / CoreTrek AS| Peace cannot be kept by force; it can
 Sandnes / Rogaland / Norway| only be achieved by understanding.   -- 
 web: http://www.moijk.net/ | Albert Einstein 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Newbie Help!! Please Look!

2001-04-19 Thread Geir Eivind Mork

On Thursday 19 April 2001 05:18, Tony Daniels wrote:
  I need to know if there is a program out there that I can use to edit
  the PHP files.  I use CuteFTP to download the files from my server as I

www.homesite.com
www.ultraedit.com
www.slickedit.com

I assume this have uploadfeatures, atleast the two last ones have. they are 
ranged from the cheapest / useable to the $300 slickedit which just rocks :) 
(and the one I use ofcourse) 

-- 
 php developer / CoreTrek AS| "Jesus may love you, but I think you're 
 Sandnes / Rogaland / Norway| garbage wrapped in skin." -- Michael
 web: http://www.moijk.net/ | O'Donohugh 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] need help

2001-04-18 Thread Geir Eivind Mork

On Wednesday 18 April 2001 08:38, chris herring wrote:
  this is really buggin me... i've got this free-for-all that i want to
 make, and everything seems logical, but

I did a quick rewrite here. it adds links as people enters them :)
?
  echo END
form method="POST" action="$PHP_SELF" name="linkadd"
  table border="0" cellspacing="2" cellpadding="0"
  tr
tdUrl: /td
tdinput type="text" name="url" size="20" value="http://"/td
  /trtr
tdName: /td
tdinput type="text" name="text" size="20"/td
  /trtr
td colspan="2"input type="submit" name="submit" value="Generate 
New Link"/td
  /tr
  /table
/form
END;

if (isset($url)  isset($text)) {
  if ($fp = fopen("./file.txt", "a")) {
  fwrite($fp, "a href=\"$url\"$text/abr\n", "w");
  fclose($fp);
  }
}
?


  echo "form method=\"POST\" action=\"$PHP_SELF\" name=\"linkadd\"";
  echo "input type=\"text\" name=\"url\" size=\"20\"
 value=\"http://\"br"; echo "input type=\"text\" name=\"text\"
 size=\"20\"br";
  echo "input type=\"submit\" name=\"submit\" value=\"Generate New
 Link\""; echo "/form";



  if (isset($url)  isset($text)) {
  $fp = fopen("./file.txt", "w");
  fwrite("$fp", "a href=\"$url\"$text/abr", "w");
  fclose($fp);
  }

  ... that isn't writing anything to the file. any help would be
 appreciated. thx in advance

-- 
 php developer / CoreTrek AS| Real Programs don't use shared text. 
 Sandnes / Rogaland / Norway| Otherwise, how can they use functions
 web: http://www.moijk.net/ | for scratch space after they are

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP + IRC

2001-04-05 Thread Geir Eivind Mork

On 04 Apr 2001 16:53:28 -0400, John Donagher wrote:
 
 There is an irc (ircg) extension now, although it is undocumented in the
 manual.
 

Who do one have to bribe/kill/beat to get the info about that when one
hasn't time/knowledge enough to snoop around in the sources? 

-- 
 php developer / CoreTrek AS| It's possible that I'm just an idiot,
 Sandnes / Rogaland / Norway| and don't recognize a sleepy slavemaster
 web: http://www.moijk.net/ | when I see one.  -- Larry

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP + IRC

2001-04-05 Thread Geir Eivind Mork

On 05 Apr 2001 03:32:10 -0400, Jack Dempsey wrote:
 vent
 It'd be nice to have someone to do our dirtywork for us, but this list
 isn't (IMHO) about finding people who DO have the time/knowledge to
 "snoop around in the sources" for us...

Where is the sense of humor? :) 
I just asked if anyone had a functionset / any documentation for that
particular feature. I ought to have included a smiley but I didn't think
anyone would be offended by my message. it was ment as a joke. 

So to anyone that got offended, knock on my door and I'll give you a
cold beer to cool down the temper with :)

-- 
 php developer / CoreTrek AS| Please take note: 
 Sandnes / Rogaland / Norway| 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP + IRC

2001-04-05 Thread Geir Eivind Mork

On 05 Apr 2001 03:32:10 -0400, Jack Dempsey wrote:
 vent
 It'd be nice to have someone to do our dirtywork for us, but this list
 isn't (IMHO) about finding people who DO have the time/knowledge to
 "snoop around in the sources" for us...

Where is the sense of humor? :) 
I just asked if anyone had a functionset / any documentation for that
particular feature. I ought to have included a smiley but I didn't think
anyone would be offended by my message. it was ment as a joke. 

So to anyone that got offended, knock on my door and I'll give you a
cold beer to cool down the temper with :)

-- 
 php developer / CoreTrek AS| Please take note: 
 Sandnes / Rogaland / Norway| 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] any other way ?

2001-04-05 Thread Geir Eivind Mork

On 04 Apr 2001 17:25:14 +0100, TV Karthick Kumar wrote:
 Instead I would like to get rid of one comma in between the email
 address and just display and sepearte it with only comma, instead of two
 commas and it should work for all the combinations that's possible.
 
 What are the possible ways to do that ?. Even I am trying out here.
 My Code:

try:

?
unset($vars['send_email']);
$email = array("home_email1","home_email2","work_email1","work_email2");
foreach ($email as $em) {
if (strlen($svars[$em])) {
if (strlen($vars['send_email'])) $vars['send_email'] .= ", ";
$vars['send_email'] .= $svars[$em];
}
}
?

 



-- 
 php developer / CoreTrek AS| Clarke's Conclusion:  Never let your
 Sandnes / Rogaland / Norway| sense of morals interfere with doing the
 web: http://www.moijk.net/ | right thing. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Select case equivelent

2001-04-05 Thread Geir Eivind Mork

On 05 Apr 2001 11:53:21 +0200, Christian Reiniger wrote:

switch ($foo) {
case "bar1":

$foobar="fooey";
break;

etc...
default:

$foobar = "NoBar";

}


  I have a list of conditions I want to test against.
  In ASP, I would do:
  How do I do the equivelent in PHP?
 Try reading the manual.

-- 
 php developer / CoreTrek AS| Old programmers never die, they just hit
 Sandnes / Rogaland / Norway| account block limit. 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] read headers.

2001-04-04 Thread Geir Eivind Mork

Is there any 'easy' way I can get the html headers receved when making a
http connect? 


-- 
 php developer / CoreTrek AS| Moody bitch with attitude, seeks nice,
 Sandnes / Rogaland / Norway| good-looking guy to dump on. 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] read headers.

2001-04-04 Thread Geir Eivind Mork

On 04 Apr 2001 03:15:25 -0500, Plutarck wrote:
 As in when you pull up a site in your browser, or when you use a script to
 make an http connection to another site?

I want to make a connection to a foreign webserver and fetch the headers
as well as the content. I was wondering of a 'painless' way instead of
messing around on a lower level.

 If you are using your browser on a windows box you can use a program called
 Proxomitron. Just use it's log window to see all the HTTP connection fun.

I haven't access to a windows computer. beside, that wouldn't help me
anyway.

-- 
 php developer / CoreTrek AS| Be careful when a loop exits to the same
 Sandnes / Rogaland / Norway| place from side and bottom. 
 web: http://www.moijk.net/ | 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]