Re: [PHP] Apache 2 + PHP

2003-12-05 Thread Martin Hudec
Hi there,

when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed 
from Gentoo portage. It was running 10 smallscale php/mysql based 
virtualhosts without any difficulties.

On Friday 05 December 2003 15:24, Yves Arsenault wrote:
 Is this warning outdated?
 http://www.php.net/manual/en/install.apache2.php
 Do not use Apache 2.0 and PHP in a production environment neither on Unix
 nor on Windows.
 I'm running RedHat 9.

 I've got Apache 2.0.48 running and was ready to install the latest php
 4.3.x..
 Just thought I would check.
-- 
:
:. kind regards
:..  Martin Hudec
:.:
:.: =w= http://www.aeternal.net
:.: =m= +421.907.303393
:.: [EMAIL PROTECTED] [EMAIL PROTECTED]
:.:
:.: When you want something, all the universe 
:.:   conspires in helping you to achieve it.
:.:   - The Alchemist (Paulo Coelho)

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



Re: [PHP] Apache 2.*

2003-11-24 Thread Martin Hudec
Hello,

what you're looking for is called Register Globals which is turned off, 
therefore you just cannot use $variable but must use 
$HTTP_POST_VARS['variable'].

It is turned off for security reasons and can be usually find in php.ini file 
(ask your system administrator).


On Monday 24 November 2003 16:35, Renaldo De Silva wrote:
 Forgive me if you've already addressed this, I'm trying to post some
 variable to a php sript and they just arn't registering if i use the code
 below it get's the variable and it's contents

  ?

  echo Values submitted via POST method:br;
  reset ($HTTP_POST_VARS);
  while (list ($key, $val) = each ($HTTP_POST_VARS)) {
 echo $key = $valbr;
  }

  ?

 but if I call the variable directly

 ? echo $renaldo; ? it prints nothing, should I go ahead and take apache
 2.* off my box or if the fix easy.

-- 
:
:. kind regards
:..  Martin Hudec
:.:
:.: =w= http://www.aeternal.net
:.: =m= +421.907.303393
:.: [EMAIL PROTECTED] [EMAIL PROTECTED]
:.:
:.: When you want something, all the universe 
:.:   conspires in helping you to achieve it.
:.:   - The Alchemist (Paulo Coelho)

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



Re: [PHP] Apache 2.*

2003-11-24 Thread Martin Hudec
Yep I forgot to mention that it is off by default :). Hmmm nice to know that 
there is shorter name :). Thanks for info, I haven't used PHP for long time.

On Monday 24 November 2003 17:13, Chris Shiflett wrote:
 To add to this, if register_globals is disabled by default, it is likely
 that you're using a version of PHP that is recent enough to have $_POST.
 So, you can use $_POST['foo'] instead of $HTTP_POST_VARS['foo']. Not only
 is it shorter, I believe the older name is deprecated.

-- 
:
:. kind regards
:..  Martin Hudec
:.:
:.: =w= http://www.aeternal.net
:.: =m= +421.907.303393
:.: [EMAIL PROTECTED] [EMAIL PROTECTED]
:.:
:.: When you want something, all the universe 
:.:   conspires in helping you to achieve it.
:.:   - The Alchemist (Paulo Coelho)

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



Re: [PHP] Form with browse for file to upload ftp

2003-11-22 Thread Martin Hudec
Hello,

He said that you have to check under which user/group is your webserver 
running (webserver is handling the scripts)... and then set the correct 
file/directory permissions on that /blah/blah directory..

yes u have to set at least chmod but look to chown also...

On Saturday 22 November 2003 21:18, PAUL FERRIE wrote:
 eh?

 Bronislav kluka [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]

  User executing the script (www-data or nobody or some other user) has to
  vave the permission to wotk with this directory.
 
 
 
  Brona
 
   I am getting this error once i run the script
  
   Warning: move_uploaded_file(img/matrix.jpg): failed to open stream:
   Permission denied in /blah/blah
   Do i need to set the chmod of the img folder?
  
   Cheers
   Paul
  

-- 
:
:. kind regards
:..  Martin Hudec
:.:
:.: =w= http://www.aeternal.net
:.: =m= +421.907.303393
:.: [EMAIL PROTECTED] [EMAIL PROTECTED]
:.:
:.: When you want something, all the universe 
:.:   conspires in helping you to achieve it.
:.:   - The Alchemist (Paulo Coelho)

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



[PHP] cannot execute?

2003-09-25 Thread Martin Hudec
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

can anyone tell me why following script does not resize image? It calls 
ImageMagick function mogrify to resize image. Webserver user does have access 
to shell, script and image are owned by webserver user.

?
$file = DSCI0005.JPG;
exec(mogrify -resize 164x131! $file);
?

Thank you

- -- 
kind regards
- --
Martin Hudec
- --
 :@:  [EMAIL PROTECTED]
 :w:  http://www.corwin.sk
 :m:  +421.907.303.393
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/cu2b1VPr1EE7sj4RAjiRAKCKgQDRmp6b7SjW3VnT5lMlBr2YFQCgkL2h
FypoB1eyT/Xux1vs9u415ro=
=OrXs
-END PGP SIGNATURE-

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



Re: [PHP] cannot execute?

2003-09-25 Thread Martin Hudec
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

User does have all required permissions.
Yeah the path was missing.

Thank you very much :).

On Thursday 25 September 2003 15:25, Javier Tacon wrote:
 The path mogrify is in PATH for webserver user? Try exec(/path/to/mogrify
 ...

 Also, the webserver user have write (not only read) the file ?


- -- 
kind regards
- --
Martin Hudec
- --
 :@:  [EMAIL PROTECTED]
 :w:  http://www.corwin.sk
 :m:  +421.907.303.393
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/cu9m1VPr1EE7sj4RAq0KAKCEObIC49iqOIeYwK7CpnRO3TC43gCeMOJv
lgcgpFWYX5kgl6vhWa2sxj0=
=9K+p
-END PGP SIGNATURE-

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



Re: [PHP] cannot execute?

2003-09-25 Thread Martin Hudec
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Anyway I can't understand why php does not return any message in this:


$mess = blablabla;

if (exec(mogrify blbalba))
{
 $hlaska .= xixixixix;
}

echo $hlaska;


- -- 
kind regards
- --
Martin Hudec
- --
 :@:  [EMAIL PROTECTED]
 :w:  http://www.corwin.sk
 :m:  +421.907.303.393
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/cvDF1VPr1EE7sj4RAvHYAJ9n0c0OsivY7JPXyQlwnawKsIbMsgCePOU6
7h52E1LqpAoZy4fxerOR1W0=
=rZ68
-END PGP SIGNATURE-

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



Re: [PHP] about writing permissions

2003-07-08 Thread Martin Hudec
Hello,

On Tuesday July 8 2003 15:42, George Papatheodorou wrote:
 I noticed that in all versions before php5 (I haven't seen this one
 yet), a script cannot open a file for writing mode is the file's
 owner is different from php's owner.  

if user2 other than owner is trying to write to file which does not have 
permission to write for group in which user2 is, or write for others, 
then write will fail

like in

rw-r--r-- user group file.txt
only user has permission to write

or in

rw-rw-r-- user group file.txt
only user and users attached to group have permission to write...

 Eg when php's owner is apache
 and test.php's owner is user1, user1's script cannot write in
 test.php but it can write to test2.php which is owned by apache. 

All scripts on webserver run with owner/uid of apache (like nobody, 
apache or such), therefore you have to set correct permissions to 
files

if test.php is set to rw-r--r-- user1 group then only user1 is allowed 
to write to it

test2.php is set to rw-r--r-- apache group... so apache can write there

 there any solution to this problem? (except making apache own all
 files). Sorry if my question is kinda newbish or stupid and sorry for
 my poor english too. Thank you in advance.

solution is to set all files to be writable by group (rw-rw-r--) by 
chmod 664 and add apache owner/uid to group which is listed as 
ownergroup of that file (change group id of apache in its configuration 
file to group).

like

rw-rw-r--  user group test.php


I hope I have explained it a bit to you.

-- 
Martin Hudec

 :@:  [EMAIL PROTECTED]
 :w:  http://www.corwin.sk
 :m:  +421.907.303.393

  In google non est, ergo non est.
  - unknown IRC operator


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



Re: [PHP] Disable pic copy/save?

2003-01-23 Thread Martin Hudec
H it might be done by checking which mouse button is pressed using 
javascript :) but i think this works only in Iexplore ;)...i used such code 
on my webpageit shows only copyright etcanyway user does not need to 
rightclik and save if he knows where is his browser cache located.

Martin


On Thursday 23 January 2003 10:57 am, Jason Wong wrote:
 On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote:
  Hi!
 
  A client wants to test market two versions of an advertising but wants to
  disable the users' ability to copy/save the ads (right click, copy/save).
 
  How can this be done in PHP?

 It can't be done, period. You need to get the data to the browser for it to
 be displayed. Once it's on the user's browser a determined user will be
 able to save whatever it is that's being displayed.


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




[PHP] output of calling grep lr

2003-01-09 Thread Martin Hudec
Hello all,

i am executing grep command from php to get listing of files
containing searched phrase
i am getting output like this:

a/x.txt a/y.txt b/z.txt

I am unable to find any way to replace spaces for \n character using
ereg_replace(), I tried to replace / instead and it replaced it in
last filepath...so i am wondering..am I getting output in one line?
Or what?

I was also considering PassThru() but it is not suitable for my needs,
because it generates binary data.

Can anyone help me please?

I have RedHat as webserver, so linux environment :)
source is here:

?
$search=text   //what are we looking for
$where=dir //which directory of site we are searching in

$com=grep -lr .$search. .$where.*; //setting up command

$output=system($com); //executing command
echo ereg_replace( , \n, $output);
?


-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri.

by Douglas Adams


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




[PHP] searching for string inside document

2003-01-09 Thread Martin Hudec
Hello,

i have document in html and i want to get out string between title
tags to put it into another variable..

i am wondering if i could use eregi() herebut how? I cant figure
out any possible way... same with strchr() and strstr()

can anyone help me please?

-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri.

by Douglas Adams


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




Re[2]: [PHP] Img src

2003-01-08 Thread Martin Hudec
Hello Sean,

or try to use this:
print img src=\.$row[foto].\ width=\104\ height=\137\;
or just
print img src=\.$row[foto].\ width=104 height='37\;

looks like u have error here:
print img src=\ . $row[foto] .  width='104' height='137'\;
  ^ ^^
^ - use \ before 
^^- no need to use both \ and  remove those two characters

or try this

your php
?
img src=? echo $row[foto];? width=104 height=137
?
your php


-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri.

by Douglas Adams

Wednesday, January 8, 2003, 8:55:08 PM, you wrote:

SB Ezequiel Sapoznik wrote:
 I am having a parse error in the following sentence:
 
   print img src=\ . $row[foto] .  width='104' height='137'\;
 

SB it would help if you posted the actual error message !

SB but try this ...

SB print 'img src=' . $row[foto] . ' width=104 height=137';

SB or

SB print img src=\ . $row[foto] . \ width='104' height='137'\;

SB -- 

SB Sean


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




Re[2]: [PHP] Img src CORRECTION

2003-01-08 Thread Martin Hudec
Hello Sean,

oh i must correct myself ;)) .

or try to use this:
print img src=\.$row[foto].\ width=\104\ height=\137\;
or just
print img src=\.$row[foto].\ width=104 height=137;

looks like u have error here:
print img src=\ . $row[foto] .  width='104' height='137'\;
  ^ ^^
^ - use \ before 
^^- no need to use both \ and  remove those two characters

or try this

your php
?
img src=? echo $row[foto];? width=104 height=137
?
your php

-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri.

by Douglas Adams

Wednesday, January 8, 2003, 8:55:08 PM, you wrote:

SB Ezequiel Sapoznik wrote:
 I am having a parse error in the following sentence:
 
   print img src=\ . $row[foto] .  width='104' height='137'\;
 

SB it would help if you posted the actual error message !

SB but try this ...

SB print 'img src=' . $row[foto] . ' width=104 height=137';

SB or

SB print img src=\ . $row[foto] . \ width='104' height='137'\;

SB -- 

SB Sean


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




Re: [PHP] strange problem (user poll)

2003-01-08 Thread Martin Hudec
Hello Paul,

well problem is this: you don't have defined variable $actionmaybe
you are not posting it correctly from form...what is on first 12
lines?

try to add $action=value; on line 12...just define any suitable
value...

-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri.

by Douglas Adams

Wednesday, January 8, 2003, 11:43:12 PM, you wrote:

PF Can anyone see a problem in this?  When i run the script i am getting this
PF error Notice: Undefined variable: action in
PF C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13

PF ?
PF // addpoll.php
PF // Case Study 1: User Poll - Foundation PHP for Flash

PF // If the form has been submitted...
PF (line 13) if ($action == add) {
PF // Include config file
PF include('common.php');

PF // Connect to database
PF $link = dbConnect();

PF // Get date for new poll
PF $posted = time();

PF // Build query to insert new poll
PF $query = INSERT INTO polls (question, option1, option2, option3,
PF posted)
PF   VALUES('$question', '$option1', '$option2', '$option3',
PF $posted);

PF // Execute query
PF $result = @mysql_query($query);

PF // If query failed...
PF if (!$result) {
PF // Display error
PF print font color=\#ff\Could not insert poll/fontbr\n;
PF } else {
PF print font color=\#ff\Poll added/fontbr\n;
PF }

PF mysql_close($link);
PF }
?
PF please anyone


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




[PHP] sessions

2002-12-05 Thread Martin Hudec
Hello,

I have following problem:

i have one script (index.php) which displays information (menu items)
based on result from function check_valid_user(). This function checks
if there is session_is_registered(valid_user).

second script is for login.it saves into session
session_register(valid_user).then it reloads parent window
(index.php), which will then again check validity of user...but it
does not work.

does anyone know why?

register globals are on.

-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri.

by Douglas Adams


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




[PHP] code for my question about sessions ;) sorry

2002-12-05 Thread Martin Hudec
Hello ,

okay here's the code...sorry forgot to post it
everything works in login.phpsession is registered...but in index,
it seems that session is empty...

login.php:
?
session_start();
include (forum_fns.php);
login($username);
echo script language=\JavaScript\;
//reloads index.php (login.php is popup from index.php
echo window.opener.location.reload();;
echo setTimeout('window.close()',1000);
echo /script;
?


index.php:
?
session_start();
include (forum_fns.php);
if (check_valid_user())
 {
  $login_status = true;
 }
 else
 {
  $login_status = false;
 }
if ($login_status == false)
 {
  echo LOGGED IN;
 }
 else
 {
  echo NOT LOGGED IN;
 }

?


forum_fns.php:
?
//will just set $username
//we are talking only about session all other works
$username = Corwin;

function login($username)
 {
  global $valid_user;
  $valid_user = $username;
  session_register(valid_user);
 }

function check_valid_user()
 {
  if (session_is_registered(valid_user))
   {
echo \$valid_user registeredbr;
return true;
   }
   else
   {
echo \$valid_user not registered!!br;
return false;
   }
 }
?



-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri.

by Douglas Adams


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




[PHP] character ' in switch

2002-11-21 Thread Martin Hudec
Hello all,

I would like to know how can I put ' character to case in switch...

Situation:

from flash i am getting url: index.php?action=what's new

i need to pass this thing to switch like:

switch ($action) {
   case about:
   code
   break;

   case what's new: -- i want this...
   code
   break;

   default:
   break;
}

but PHP can't use 'i am thinking about making urlencode() to put
that character to %XX value

any advices?


-- 
Best regards,
 Martin  mailto:[EMAIL PROTECTED]


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




[PHP] php mail confirmation

2002-11-14 Thread Martin Hudec
Hello all,

I would like to ask how can I make registration confirmation by
email...user will receive mail confirming his registration immediately
after he registers in application.is it possible to make mail()
function filled with data from registration (email)?

-- 
Best regards,
 Martin  mailto:corwin;corwin.sk


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




[PHP] php and electronic pay system

2002-11-06 Thread Martin Hudec
Hello,

does anyone have experience with implementation of electronic pay
system for website based on PHP? Can you give me directions about
this?

-- 
Best regards,
 Martin Hudec  mailto:corwin;corwin.sk


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




Re: [PHP] Re: .inc files doubles up

2002-10-29 Thread Martin Hudec
Hello Tine,

it looks okay to me butlooks like you have met two conditions at
time ($sted == ) and ($telefon == 0)why dont u make something
like this?

if (empty($sted) || empty($telefon)) {
 include header
   if (empty($sted)){
   echo STED NOT FILLED...
   }
   if (empty($telefon)){
   echo .TELEFON NOT FILLED...
   }
 include footer
}

that checks value of both variables...checks if they are empty
that || means or...so if $sted or $telefon are empty it will display
your code.first it will implement include header then he will
display what is not filled based on if...and finaly it will include
footer

hope it helps

T if ($sted == ){
T   include(head.inc);
T  echo(Du fylte ikke ut span class=\formfelt\sted/span.br
T blockquoteraquo; a href=\m_skap.html\ class=\linkdot\Tilbake til
T skjemaet/a/blockquote);
T   include(foot.inc);
T  $Envoi = 0;
T }
T else {
T  $MailBody .= Sted : $sted\n;
T }
T if ($telefon == 0){
T   include(head.inc);
T  echo(Du fylte ikke ut span class=\formfelt\telefonnummeret/span
T ditt.br blockquoteraquo; a href=\m_skap.html\
class=\linkdot\Tilbake til skjemaet/a/blockquote);
T   include(foot.inc);
T  $Envoi = 0;
T }
T else {
T  $MailBody .= Telefon : $telefon\n;
T }
T if ($epost == ){
T   include(head.inc);
T  echo(Du fylte ikke ut span class=\formfelt\e-postaddressen/span
T din.br blockquoteraquo; a href=\m_skap.html\
class=\linkdot\Tilbake til skjemaet/a/blockquote);
T   include(foot.inc);
T  $Envoi = 0;
T }
T else {
T  $MailBody .= E-post : $epost\n;

T }
T if ($kommentarer == ){
T   include(head.inc);
T  echo(Du fylte ikke ut span class=\formfelt\kommentarer/span.br
T blockquoteraquo; a href=\m_skap.html\ class=\linkdot\Tilbake til
T skjemaet/a/blockquote);
T   include(foot.inc);
T  $Envoi = 0;
T }
T else {
T  $MailBody .= Kommentarer : $kommentarer\n;

T }



-- 
Best regards,
 Martinmailto:corwin;corwin.sk


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




Re: [PHP] Displaying one of three functions.

2002-10-28 Thread Martin Hudec
Hello Steve,

I hope I understand your questions...so first we will check value of
country (if it is other than finland)...then if the first if
requirement is not met we will continue to second part (checking
express)...and so on

if {$country!=finland){
   display_shipping(calculate_nonfinland_cost($country));
   break;
}
elsif ($country==finland  $express==no) {
   display_shipping(calculate_shipping_cost($weight));
   break;
}
else ($country==finland  $express==yes) {
   display_shipping(calculate_express_cost($express));
   break;
}

hope it helps...


-- 
Best regards,
 Martinmailto:corwin;corwin.sk

Monday, October 28, 2002, 2:20:39 PM, you wrote:

SJ//de-bug
SJ//echo test  $country  $express;

well shouldn't here be  or and?


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




Re[2]: [PHP] Displaying one of three functions.

2002-10-28 Thread Martin Hudec
Hello Steve,

oh my fault...i apologize...this should worki shouldn't use break
;)

if {$country!=finland){
   display_shipping(calculate_nonfinland_cost($country));
}
elsif ($country==finland  $express==no) {
   display_shipping(calculate_shipping_cost($weight));
}
elseif ($country==finland  $express==yes) {
   display_shipping(calculate_express_cost($express));
}

or (from my point of view is this better)

if {$country!=finland) :
   display_shipping(calculate_nonfinland_cost($country));
elsif ($country==finland  $express==no) :
   display_shipping(calculate_shipping_cost($weight));
elseif ($country==finland  $express==yes) :
   display_shipping(calculate_express_cost($express));
endif;

again i apologize...

-- 
Best regards,
 Martinmailto:corwin;corwin.sk


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




Re: [PHP] IP addresses

2002-10-28 Thread Martin Hudec
Hello Bret,

use $REMOTE_ADDR like this:
?
echo $REMOTE_ADDR;
?

-- 
Best regards,
 Martinmailto:corwin;corwin.sk

Monday, October 28, 2002, 3:46:04 PM, you wrote:

BLC Hi all,
BLC I've been away for a while but I'm back and have a question about IP addresses.
BLC How do I retrieve / capture a users IP? I need to have it to process electronic 
payments.

BLC Thanks.
BLC Bret


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




Re[4]: [PHP] Displaying one of three functions.

2002-10-28 Thread Martin Hudec
Hello @ Edwin,

of course you can but let me say something

if .. else is used when u
need to execute one thing in case that requirement in if is met and
second thing if it is not met...

in case of if...elsif : command behind elsif is executed when
requirement in if is not metyou can add as many elsif as you
want...also u can end whole thing with else which is executed in case
when no previous requirements are met...

hope I wrote it goodsorry im too tired to think about english
grammar and such things ;)))

-- 
Best regards,
 Martinmailto:corwin;corwin.sk

Monday, October 28, 2002, 4:18:45 PM, you wrote:

E Hello,

E Martin Hudec [EMAIL PROTECTED] wrote:
 or (from my point of view is this better)
 
 if {$country!=finland) :
display_shipping(calculate_nonfinland_cost($country));
 elsif ($country==finland  $express==no) :
display_shipping(calculate_shipping_cost($weight));
 elseif ($country==finland  $express==yes) :
display_shipping(calculate_express_cost($express));
 endif;
 

E How about something like this?

E if ($country!=finland){
Edisplay_shipping(calculate_nonfinland_cost($country));
E }else{  // if it's not finland it should be something else, no?
E   if ($express==no){
E display_shipping(calculate_shipping_cost($weight));
E   }else{ // if it's not no it should be yes, no?
E display_shipping(calculate_express_cost($express));
E   }
E }

E Just an idea...

E - E


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




Re: [PHP] Failing to Make MySQL Query on Submit

2002-10-28 Thread Martin Hudec
Hello user,

ill take a look only into this

udi   // UPDATE THE DATABASE
udi   $sql = UPDATE fantasytoo SET o1 = \$o1\,w1 = \$w1\,c1 = 
udi \$c1\,o2 = \$o2\,w2 = \$w2\,c2 = \$c2\,en = \$en\,wc = 
udi \$wc\,ot = \$ot\ WHERE realname = \$realname\ ;
udi }

well here u use first $sql..i cant see no mysql_querylike this
one..:
$result = mysql_query($sql) or die Cannot update database...;

udi if ($realname) {
udi // query the database
udi $sql = select * from fantasytoo where realname = \$realname\ and 
udi email = \$email\;
udi $result = mysql_query($sql);
udi while ($myrow = mysql_fetch_array($result)) {
udi printf($result);

here is another $sqlafter execution of first UPDATE thing you set
$sql to UPDATE bla bla.then here u set it to SELECT * from bla
bla...i recommend using for each sql string in one script various
variables like $sql1 = UPDATE bla bla; and $sql2 = SELECT bla bla;
for better reading

-- 
Best regards,
 Martinmailto:corwin;corwin.sk

Monday, October 28, 2002, 5:09:22 PM, you wrote:

udi I'm having a problem getting my PHP script to talk to my database.  I'm 
udi attempting to use UPDATE with a PHP form to change records already in 
udi the database.  I'm able to pull the record with no problem and the 
udi script is sending the confirmation e-mail without a problem on submit 
udi but for some reason the MySQL query isn't being made.  I've even tried 
udi dummy queries just to see if the connection was being made, but it's 
udi not.  I'd appreciate any help.  Following is the code:

udi ?php
udi   // CONNECT TO DATABASE
udi $db = mysql_connect(localhost, webmstr);
udi mysql_select_db(test,$db);
udi if ($submit) {
udi   // SEND INFO IN EMAIL
udi   mail($email, Picks, Your entry has been changed.\nFirst Set 
udi Opener: $o1 \nFirst Set Wildcard: $w1 \nFirst Set Closer: $c1 \nSecond 
udi Set Opener: $o2 \nSecond Set Wildcard: $w2 \nSecond Set Closer: $c2 
udi \nEncore: $en \nAcoustic Song: $ac \nWildcard: $wc \nOne Time Played: 
udi $ot \nFirst Time Played: $nw \n\nGood Luck!\nhttp://www.otherones.net;, 
udi From: [EMAIL PROTECTED]);
udi   // UPDATE THE DATABASE
udi   $sql = UPDATE fantasytoo SET o1 = \$o1\,w1 = \$w1\,c1 = 
udi \$c1\,o2 = \$o2\,w2 = \$w2\,c2 = \$c2\,en = \$en\,wc = 
udi \$wc\,ot = \$ot\ WHERE realname = \$realname\ ;
udi }
udi if ($realname) {
udi // query the database
udi $sql = select * from fantasytoo where realname = \$realname\ and 
udi email = \$email\;
udi $result = mysql_query($sql);
udi while ($myrow = mysql_fetch_array($result)) {
udi printf($result);
?
udi form method=post action=edit.php?realname=?php echo 
$myrow[realname]?email=?php echo $myrow[email]?
udi table width=400 border=0 cellspacing=0 cellpadding=0 
align=center
udi tr td valign=middle
udidiv align=centerfont face=Comic Sans MS, Arial, sans-serif 
size=3
udi  Fantasy TOO - Fall 2002 Signups/font br
udi  font color=white./font/div
udi /td
udi /tr
udi /table
uditable border=0 width=600 cellspacing=0 cellpadding=0 
align=center
udi  tr input type=hidden name=realname value=?php echo 
$myrow[realname]?
udi input type=hidden name=email value=?php echo $myrow[email]?

uditd width=150font color=#FF face=Arial 
size=2strong Name: /strong/font/td
uditd width=450font face=Arial size=2?php echo 
$myrow[realname]?/font/td
udi  /tr
udi  tr
uditd width=150font color=#FF face=Arial 
size=2strongE-mail
udi  Address: /strong/font/td
uditd width=450font face=Arial size=2?php echo 
$myrow[email]?/font/td
udi  /tr
udi  tr
uditd width=150font color=#FF face=Arial 
size=2strong1st
udi  Set Opener (8): /strong/font/td
uditd width=450strongfont face=Arial size=2
udi  select name=o1option selected?php echo 
$myrow[o1]?/option
udi?php include ('c.php3');
?
udi  /select
udi  font size=1[a href=javascript:pop('this_o1.html')What's 
udi This?/a]/font/font/strong/td
udi  /tr
udi  tr
uditd width=150font color=#FF face=Arial 
size=2strong 1st
udi  Set Wildcard (4): /strong/font/td
uditd width=450strongfont face=Arial size=2
udi  select name=w1option selected?php echo 
$myrow[w1]?/option
udi?php include ('c.php3');
?
udi  /select
udi  font size=1[a href=javascript:pop('this_w1.html')What's 
udi This?/a]/font/font/strong/td
udi  /tr
udi  tr
uditd width=150font color=#FF face=Arial 
size=2strong 1st
udi  Set Closer (6): /strong/font/td
uditd width=450strongfont face=Arial size=2
udi  select name=c1option selected?php echo 
$myrow[c1]?/option
udi?php include ('c.php3');
?
udi  /select
udi  font size=1[a href=javascript:pop('this_c1.html')What's 
udi This?/a]/font/font/strong/td
udi  /tr
udi  tr
uditd width=150font color=#FF face=Arial 
size=2strong 2nd
udi  Set 

Re: [PHP] for??????

2002-10-28 Thread Martin Hudec
Hello Bsantos,

BP Now, I've created a funtion which controls how many fields (cols) may be
BP seen by user. Some like this:

BP function select_query ($fields, $table) {
BP $result = (SELECT $fileds FROM $table);
BP }

maybe mistype in SELECT fileds should be fieldsalso try using
select_query() without that space between...i suppose you will
have something like select_query(email,name,userlist)

BP Well, I hould like to control how many fields my query will use.

for example you will want first ten fields...then add
to query LIMIT 0,10 (it will start from first field, and it will
select ten fields)

BP For example: if I call select_query('id,username,email', 'users');

BP I want to know that there was selected 3 cols. so I can later do some like
BP this:

well three cols are not difficult...just from what position u want to
have them (see LIMIT above)...

BP for ($j=0;$j$number_of_selected_cols_minus_one;$j++) {
BP echotd$list[$j]/td;

BP ... and that's it. By the way!! Is this late statement correct?!?!

to this for statement...why are you doing minus one?...for example if
you have 10 selected cols...it will do that echo ten times for each
$jnot nine as in your original statement...you will have one $j
extra...

okay hope it helps for now

-- 
Best regards,
 Martinmailto:corwin;corwin.sk


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




Re[2]: [PHP] for??????

2002-10-28 Thread Martin Hudec
Hello John,

  ohim really tired then...should go home ;)))than that
  $fields should do the work$fields=id,name,email; for
  example.:))) and to count how many fields are u using...i
  think array should do the trickyou can count it then how
  many fields it hasbut...maybe i am writing stupid things..i
  really need to go home ;))) okay...


-- 
Best regards,
 Martinmailto:corwin;corwin.sk

Monday, October 28, 2002, 6:45:15 PM, you wrote:

JWH He's talking columns, not rows. LIMIT is for rows.

JWH John

 -Original Message-
 From: Martin Hudec [mailto:corwin;corwin.sk]
 Sent: Monday, October 28, 2002 12:38 PM
 To: Bsantos PHP
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] for??
 
 Hello Bsantos,
 
 BP Now, I've created a funtion which controls how many fields (cols)
JWH may
 be
 BP seen by user. Some like this:
 
 BP function select_query ($fields, $table) {
 BP $result = (SELECT $fileds FROM $table);
 BP }
 
 maybe mistype in SELECT fileds should be fieldsalso try using
 select_query() without that space between...i suppose you will
 have something like select_query(email,name,userlist)
 
 BP Well, I hould like to control how many fields my query will use.
 
 for example you will want first ten fields...then add
 to query LIMIT 0,10 (it will start from first field, and it will
 select ten fields)
 
 BP For example: if I call select_query('id,username,email', 'users');
 
 BP I want to know that there was selected 3 cols. so I can later do
JWH some
 like
 BP this:
 
 well three cols are not difficult...just from what position u want to
 have them (see LIMIT above)...
 
 BP for ($j=0;$j$number_of_selected_cols_minus_one;$j++) {
 BP echotd$list[$j]/td;
 
 BP ... and that's it. By the way!! Is this late statement correct?!?!
 
 to this for statement...why are you doing minus one?...for example if
 you have 10 selected cols...it will do that echo ten times for each
 $jnot nine as in your original statement...you will have one $j
 extra...
 
 okay hope it helps for now
 
 --
 Best regards,
  Martinmailto:corwin;corwin.sk
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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