[PHP] Easy array stuff I think for those who can I guess.

2002-12-05 Thread Raymond Lilleodegard
Hi!

I am trying to get out a value of an array that I have made from a query and
deliver the value into a variable. I have made this code. Am I totally lost?


while ($myrow = mysql_fetch_array($result));
{

 $id = $myrow['id'];

 $deltaker[] = array ($id);

}

$limit = count($deltaker);


$finn_vinner = rand(0,$limit);

$vinner_deltaker = $deltaker[$finn_vinner];

$vinner_id = current($vinner_deltaker);


$sql2 = SELECT * FROM konkuranse WHERE id = '$vinner_id';


Best regards Raymond



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Does anyone know if this is possible?

2002-11-04 Thread Raymond Lilleodegard
Hi!

I have made a website with a webshop and the orders are written down in
txtfiles and a faxserver is scanning a directory for txtfiles and sends them
as faxes.

So I am trying to write the txtfile like I should have written the order in
a table. Or you can say I am trying to make some columns in the txtfile.

Something like this:

1pizzacheese, beef, tomato,5,-
  ham, bacon etc
2burgerscheese, bacon2,-

Best regards Raymond



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Does anyone know if this is possible?

2002-11-04 Thread Raymond Lilleodegard
Ok! I think I will try a little more to get it work with php first, but it
is a good idea you have here.

Thanks! : )

Raymond

Joel Boonstra [EMAIL PROTECTED] wrote in message
news:Pine.LNX.4.44.0211041703230.11800-10;amos.gf.gospelcom.net...
 Hi Raymond,

  I have made a website with a webshop and the orders are written down in
  txtfiles and a faxserver is scanning a directory for txtfiles and sends
them
  as faxes.
 
  So I am trying to write the txtfile like I should have written the order
in
  a table. Or you can say I am trying to make some columns in the txtfile.
 
  Something like this:
 
  1pizzacheese, beef, tomato,5,-
ham, bacon etc
  2burgerscheese, bacon2,-

 I *think* if you're committed to doing this in PHP, you'll need to look
 at the sprintf() or printf() functions:

   http://www.php.net/manual/en/function.sprintf.php

 You're given some level of control over the output of your program.  I
 don't know if you can get what you describe above, though.

 If you're not adverse to looking to another language, Perl was built to
 do exactly this.  Perl Formats do what you need -- they provide a method
 for generating simple, formatted reports and charts, according to the
 camel book.   I know of no analagous capability of PHP (although I may
 very well be wrong).

 If you can't use perl for the whole thing, perhaps you could have PHP do
 all your logic, and then pass the data to a perl script to format and
 save it to a file.  Or maybe sprintf() does everything you need...

 Joel

 (more on perl formats:
 http://www.perl.com/doc/manual/html/pod/perlform.html)

 --
 [ joel boonstra | [EMAIL PROTECTED] ]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] How to get linefeed from textfields registered in mysql?

2002-10-28 Thread Raymond Lilleodegard
Hi!

I have made a guestbook to my website driven by php and mysql.

But I don't know how to get the text as it is written in the textfield
before it is sent to mysql. So is it possible to save the hits on enter in
the database?

Best regards Raymond



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How to get linefeed from textfields registered in mysql?

2002-10-28 Thread Raymond Lilleodegard
Ok, thanks a lot! Thats what I thougt.

Regards Raymond

Tom Woody [EMAIL PROTECTED] wrote in message
news:20021028122633.34f2979e.woody;nfri.com...
 While I am not exactly sure of everything you are asking I think I had
 a similar problem...

 You need to convert the \r to \n before you put it into the DB.


 On Mon, 28 Oct 2002 19:30:15 +0100
 Raymond Lilleodegard [EMAIL PROTECTED] wrote:

  Hi!
 
  I have made a guestbook to my website driven by php and mysql.
 
  But I don't know how to get the text as it is written in the textfield
  before it is sent to mysql. So is it possible to save the hits on
  enter in the database?
 
  Best regards Raymond
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


 --
 Tom Woody
 Systems Administrator
 NationWide Flood Research, Inc.
 phone: 214-631-0400 x209
   fax: 214-631-0800

 Don't throw your computer out the window,
 throw the Windows out of your computer!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Simple question I guess.

2002-07-22 Thread Raymond Lilleodegard

Hi!

I have a site with all my movies and stuff stored in a database. And I have
made a admin page where I can add, delete and update records. When I add new
records, I have made a listbox for the category (ex. action, comedy etc.) so
I dont have to write it every time I add a new record. But when I push the
update button and the data thats stored in the database is printed its
printed just in a textarea. I know its possible to list the data in a
listbox, but how do I get the right category selected for the movie I
choose?

Best regards Raymond



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Using an external program.

2002-04-21 Thread Raymond Lilleodegard

Hi all!

I am trying to interact with a simple exe program. I manage to get the
program started, but I need to send some commands to it as well. My script
looks like this:

?php

$var = exec('fax.exe');

$var = shell_exec('cmd S');

$var = shell_exec('cmd fax_test.txt');

$var = shell_exec('cmd 6759');

?

And do I need to run the exec() function everytime I would like the program
to do some work for me? Is there a way to access the program later somehow,
without opening a new program?

Thankfull for all help and hints! : )

Best regards

Raymond Lilleødegård



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] How to convert a website to a txtfile....?

2002-04-06 Thread Raymond Lilleodegard

Hi!

I have this website with a webshop that customers can order some products.
And when the products are listed up in the cart on the screen, would I like
to get the output
into a new txtfile and save it on the server. Then it is possible to get it
faxed, and that is the goal.

Anyone who has done this before?

Thanks for all help!

Best regards

Raymond Lilleodegard



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: must I use var

2002-02-17 Thread Raymond Lilleodegard

Hi Peter!

The var $somevariable means that the variable is defined. You only need to
use var in classes. So if you only write ordinary scrpits, you dont need to
use it.

Regards Raymond

Peter J. Schoenster [EMAIL PROTECTED] wrote in message
3C6FC20B.3856.610F245@localhost">news:3C6FC20B.3856.610F245@localhost...
 HI,

 I was reading the docs and I see this:

  /* This is how it should be done. */
  class Cart
  {
  var $todays_date;
  var $name;
  var $owner;
  var $items;
 
  function Cart()
  {
  $this-todays_date = date(Y-m-d);
  $this-name = $GLOBALS['firstname'];
  /* etc. . . */
  }

 I don't see the point in doing

 var $todays_date;

 and

 $this-todays_date = date(Y-m-d);

 The latter works without the need for the var. Why should i use
 var?

 Thanks,

 Peter
 http://www.readbrazil.com/
 Answering Your Questions About Brazil



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Sitenavigation

2002-02-09 Thread Raymond Lilleodegard

Hi!

Is i possible to make a function that makes a prev and a next link on the
page if it returns, say over 20 rows or hits in a query? Could anyone give
me a hint if they know how to?

Best regrds Raymond



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Is this possible?

2002-02-06 Thread Raymond Lilleodegard

Hi!

I have this tricky case, at lest for me : )

I'm trying to get some data out of two tables and listing the data in a
product/price site. But. :

I have one table with productinfo and one with prices.
And it is several columns with the same id in the pricetable, because every
product have several sizes.

So... how do I get only one row from the product table and two rows from
the price table in one line in a page?
Is it possible?



Best regards

Raymond



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] dynamic variables in sq?l

2002-01-25 Thread Raymond Lilleodegard

Hi all!

I have this form with some choices:

form
Enter how many cars you want:input type=text name=number 
select size=1 name=car
option selectedford/option
optionbmw/option
optionmercedes/option
/select

And then I am trying to get the price out of a table in my database with
this code:


$sql = mysql_query(SELECT '$car' FROM varetabell where carid='$carid' );
$myrow= mysql_fetch_array($sql);
$x = $myrow[$car];

$price = $x * $number;


Shouldn't this work?  Or am I missing something here?



Best regards Raymond





-- 
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: dynamic variables in sq?l

2002-01-25 Thread Raymond Lilleodegard

Than you very much for all help!
I see that my database design is a little dumb, so I'll just make another
one.

Best regards Raymond

Raymond Lilleodegard [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all!

 I have this form with some choices:

 form
 Enter how many cars you want:input type=text name=number 
 select size=1 name=car
 option selectedford/option
 optionbmw/option
 optionmercedes/option
 /select

 And then I am trying to get the price out of a table in my database with
 this code:


 $sql = mysql_query(SELECT '$car' FROM varetabell where carid='$carid' );
 $myrow= mysql_fetch_array($sql);
 $x = $myrow[$car];

 $price = $x * $number;


 Shouldn't this work?  Or am I missing something here?



 Best regards Raymond







-- 
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] Sending fax with php, is it possible?

2001-11-29 Thread Raymond Lilleodegard

Hi all!

I have a little problem here : )

A customer wants a order made by a forminput sent to fax. Is it possible
with php? Or do I have to do it some other way?


Best regards Raymond



-- 
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] Sending fax with php, is it possible?

2001-11-29 Thread Raymond Lilleodegard

Thanks, that sounds great! I have to admit that i am pretty new with this
php language.

But to get this work, I have to use a faxprogram? and then send the
forminput to this program? That redirect the data to a fax?
I'll see what kind of program I can get.



Jani Mikkonen [EMAIL PROTECTED] wrote in message
001901c178f2$70f1d440$0264a8c0@delenn">news:001901c178f2$70f1d440$0264a8c0@delenn...
  A customer wants a order made by a forminput sent to fax. Is it possible
  with php? Or do I have to do it some other way?

 Hey, php is a programming language, it does what ever you want (up to
 certain restrictions ofcourse)

 But for pointers, try installing hylafax (if you run *nix that is)  and
 either, use its commandline tools or write the spooler to interact
directly
 with hylafax server (it uses protocol that resembles ftp (infact, its ftp
 server but its own implementation)).

 Btw, it would be interesting to write php classes to access hylafax
server.
 I promise to help out in desing and writing allthou i dont have modemline
to
 test anything.






-- 
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: A tricky one?

2001-11-20 Thread Raymond Lilleodegard

Thanks for answering.

But this only works if the customer orders one of each. Do you know how to
do it if, lets say the customer order 2 hamburgers and nothing else?


Raymond


Raymond LilleøDegåRd [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!

 I'm trying to make this form working with a mail() script.
 I made this form. Then the customer could write how many pizzas or
 hamburgers as he want.
 But how do I solve this without too much headache? Havent slept for days
 because of this problem : )


 input type=text name=pizza
 input type=text name=chips
 input type=text name=hamburger


  script 
 ?php
 /* recipients */
 $to  = [EMAIL PROTECTED] ;

 /* subject */
 $subject = Order;

 /* message */
 $message = I would like to order $?;

 /* To send HTML mail, you can set the Content-type header. */

 /* additional headers */
 $headers = From: Someone [EMAIL PROTECTED]\r\n;


 /* and now mail it */
 mail($to, $subject, $message, $headers);


 Best regards

 Raymond





-- 
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: A tricky one?

2001-11-20 Thread Raymond Lilleodegard

It works after modifying it a little. BUT... :) It lists all the variables
even if they aren't given any value. Is it possible to only get the defined
ones?

Regards Raymond


Matthew Luchak [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

how about...


?
$message=;
$header=From: $email;
$to=[EMAIL PROTECTED];
$subject=burger me;

while(list($var, $val) = each($HTTP_POST_VARS))
{
if(($var !=email)($var !=SUBMIT)(isset($var)){$message
.=$val $var were ordered \n;}
}

MAIL(
$to,
$subject,
$message,
$header
);
?

Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]


-Original Message-
From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 1:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: A tricky one?


Thanks for answering.

But this only works if the customer orders one of each. Do you know how
to
do it if, lets say the customer order 2 hamburgers and nothing else?


Raymond


Raymond LilleøDegåRd [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!

 I'm trying to make this form working with a mail() script.
 I made this form. Then the customer could write how many pizzas or
 hamburgers as he want.
 But how do I solve this without too much headache? Havent slept for
days
 because of this problem : )


 input type=text name=pizza
 input type=text name=chips
 input type=text name=hamburger


  script 
 ?php
 /* recipients */
 $to  = [EMAIL PROTECTED] ;

 /* subject */
 $subject = Order;

 /* message */
 $message = I would like to order $?;

 /* To send HTML mail, you can set the Content-type header. */

 /* additional headers */
 $headers = From: Someone [EMAIL PROTECTED]\r\n;


 /* and now mail it */
 mail($to, $subject, $message, $headers);


 Best regards

 Raymond





--
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 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: A tricky one?

2001-11-20 Thread Raymond Lilleodegard

Thank you very much guys! You really helped out with this one. I will sleep
a lot better to night : )

Regards Raymond

Matthew Luchak [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

try ($val!=) instead of (isset($var)

Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]


-Original Message-
From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 3:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: A tricky one?


It works after modifying it a little. BUT... :) It lists all the
variables
even if they aren't given any value. Is it possible to only get the
defined
ones?

Regards Raymond


Matthew Luchak [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

how about...


?
$message=;
$header=From: $email;
$to=[EMAIL PROTECTED];
$subject=burger me;

while(list($var, $val) = each($HTTP_POST_VARS))
{
if(($var !=email)($var !=SUBMIT)(isset($var)){$message
.=$val $var were ordered \n;}
}

MAIL(
$to,
$subject,
$message,
$header
);
?

Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]


-Original Message-----
From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 1:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: A tricky one?


Thanks for answering.

But this only works if the customer orders one of each. Do you know how
to
do it if, lets say the customer order 2 hamburgers and nothing else?


Raymond


Raymond LilleøDegåRd [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!

 I'm trying to make this form working with a mail() script.
 I made this form. Then the customer could write how many pizzas or
 hamburgers as he want.
 But how do I solve this without too much headache? Havent slept for
days
 because of this problem : )


 input type=text name=pizza
 input type=text name=chips
 input type=text name=hamburger


  script 
 ?php
 /* recipients */
 $to  = [EMAIL PROTECTED] ;

 /* subject */
 $subject = Order;

 /* message */
 $message = I would like to order $?;

 /* To send HTML mail, you can set the Content-type header. */

 /* additional headers */
 $headers = From: Someone [EMAIL PROTECTED]\r\n;


 /* and now mail it */
 mail($to, $subject, $message, $headers);


 Best regards

 Raymond





--
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 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 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]