RE: [PHP] view source with opera

2002-06-13 Thread Christoph Starkmann

I'm quite sure that this won't work...
The server isn't delivering the php source, so the client
will not get the source code but only the resulting code
the script generated.
So IMHO this is a hoax.

 Hi list
   I am using php on the company´s website  that i work
   and now someone told me that  you can view the php source with
 the opera browser
   he says he done it by himself .
 
   Anybody can tell me if it´s true or not ?
   or in wich conditions this can happen! how to fix this?

Let him show you...

Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




RE: [PHP] view source with opera

2002-06-13 Thread Christoph Starkmann

  I'm quite sure that this won't work...
  The server isn't delivering the php source, so the client
  will not get the source code but only the resulting code
  the script generated.
  So IMHO this is a hoax.
 
 Unless your server has phps (source view) enabled. If it has 
 then you can see
 the source of any file by using the extension .phps.

Awright! But then it would be possible with any browser...

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




RE: [PHP] Else/For loop

2002-06-12 Thread Christoph Starkmann

Hi Mark!

 Being relatively new to php, I discovered the following after 
 about 2 hours
 of debugging last night and was wondering why???
 
 I had the following code:
 
 if ( $num_results = 0 )
 {
   echo no records found;
 }
 else
 {
   for ($i=0; $i  $num_results; $i++)
   {
   display record set
   }
 }
 
 As a result, the for loop never executed, no matter how many 
 records were
 returned in the record set. I placed echo statements though 
 out to determine
 why the for loop was not being executed. I put an echo 
 statement just before
 the for to make sure the else condition was being met.
 
 Finally, I just copy/pasted (literally) the for loop to just 
 before the 'if'
 statement. Much to my surprise...the for loop now works 
 perfectly. (Except,
 of course, if there are no records returned).
 
 The duduction...for loops will not work inside else statements. The
 question...why?

I guess this would be the end of all PHP-programming ;)
Of course you can place any correct block of code inside any other
correct block of code.
But, i your case $num_results IS zero. Just place an echo statement 
inside the if block ;)

Very frequent error ;)

if ($num_results = 0) indeed is an asignment, no comparison.
Better use == if you want to compare thingies...

 I think I can work around this with some different coding, 
 but why should I
 have to? I have done this same thing in java, perl and other 
 languages...

Yes, also with == ;)
 
Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




[PHP] Name of script

2002-06-11 Thread Christoph Starkmann

Hi there!

I don't find the function or variable
returning/containing the name of the
script itself;

like:

echo Hi, my name is  . $SCRIPT_NAME;

Anyone can help?

(I did RTFM...)

Kiko

-- 
It's not a bug, it's a feature.

[.nfq]

christoph starkmann

tel.: 0821 / 56 97 94 34
fax.: 0821 / 56 97 94 38

http://www.gruppe-69.com/

ICQ: 100601600
-- 

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




[PHP] Name of file

2002-06-11 Thread Christoph Starkmann

I found the __FILE__ now, but this is not exactly what I want:
I would like to have one script generating links to itself,
only with different variables sent via GET like this:

http://www.mydomain.tld/myscript.php?request=showcontent

But __FILE__ gives me a file://-path... Do you have a smart 
idea how to avoid this? Of course I can strip simply everything
to [...]/htdocs/, but isn't there a smarter way?

Cheers,

Kiko

-- 
It's not a bug, it's a feature.

[.nfq]

christoph starkmann

tel.: 0821 / 56 97 94 34
fax.: 0821 / 56 97 94 38

http://www.gruppe-69.com/

ICQ: 100601600
-- 

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




RE: [PHP] Name of script

2002-06-11 Thread Christoph Starkmann

Hi Liam, hi René!

Great, thanx alot, this gets me rid of all thinking ;)
At least concerning this... ;)

 $PHP_SELF
 see Language Reference chapter 7 Variables

Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




RE: [PHP] Secure File Upload

2002-06-06 Thread Christoph Starkmann

Hi Jim!

 ok, here are a few questions for you to clarify things.

 A)  Do you want to place a limit on the size of a single file being
 uploaded?
Yes. In fact, i would like to prevent having users upload too 
big files. There are two reasons:
First, I don't want my server space to be consumed by files too big.
Second, I want to be able to prevent my (limited) traffic to
be exhausted. Simple reason: I pay for anything above let's say
10 GB of traffic. So what PHP offers to me AFAIK enables me to
protect my space, but not my traffic. That's where my question
comes from.

 B)  Do you want to place a restriction that says after n'th 
 number of files that have been uploaded equal 'X' ammount 
 of space on the  server disable file uploads? (this is what 
 it sounds like you are asking, to me anyways)

Nope. This would be quite easy, I guess. But that's not the
problem, it's about traffic.
 
 Answer these two questions and it will help me alot

Hope this did ;) Can you help me now? ;)

Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




RE: [PHP] Secure File Upload

2002-06-06 Thread Christoph Starkmann

Hi Dan!

  A)  Do you want to place a limit on the size of a single file being
  uploaded?
 [...]
  Second, I want to be able to prevent my (limited) traffic to
  be exhausted. Simple reason: I pay for anything above let's say
  10 GB of traffic. So what PHP offers to me AFAIK enables me to
  protect my space, but not my traffic.
 You are absolutly correct. Welcome to the client/server 
 relationship. Your
 PHP is *entirely* server side, meaning that (in a HTTP[S] PUT 
 or POST) the
 entire file is sent to PHP before it can work out if its too 
 big or not.

I know this, not this new to CGI... ;) The only thing I thought/hoped
was that maybe there's a way to recieve the file size information before
upping the entire file. Like with email or news, where I can download
headers
seperated from the message body... But as far as I can see, this is not
possible. Sad but true ;)

So I have to trust my visitors ;)

Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




RE: [PHP] Secure File Upload

2002-06-06 Thread Christoph Starkmann

Hi again, Dan!

 But you still have to rely on your visitors as they could simply use
 another web browser should they wish to DoS your site. 
 Security measures
 such as logging in before allowing a file upload can come in 
 useful here.

I think I have to agree at this point. I was just hoping I 
was simply missing some point, but then a login wil have to do.

Thanks for all your help...

Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
-- 

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




[PHP] Secure File Upload

2002-06-04 Thread Christoph Starkmann

Hi There!

When uploading a file with PHP, AFAIK I can only control what will be stored
on the server. So if someone sends me 100 MB, these will be deleted
immediately. But, unfortunately, the traffic is produced nevertheless. Is
there any way to check the file size before uploading the file or any other
way to keep the traffic under a certain limit? Last think I would like to
have is a script that disables all uploads after a certain traffic has been
produced, I would like to be able to really PREVENT uploads, let's say
bigger than 10 MB?!

Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




[PHP] Variables in PHP: public vs. private

2002-05-17 Thread Christoph Starkmann

Hi there!

I'm just starting to get in touch with
oo programming in PHP. Now I've got a
quite simple question, I guess...

In an example in the PHP-help, I found
a class definition with accessor functions
like 

dummy-get_some_variable();

But AFAIK (and see ;)), variables in PHP 
in fact are never private, but always 
public, at least within the current script.

So what would be the sense in having
this kind of functions? Readability?
Just a fake?

Or can I declare variables as private?
(this would be the best in my eyes, indeed)

Thanx alot,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
-- 

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




[PHP] [] versus -

2002-05-14 Thread Christoph Starkmann

Hi there.

I hope this is not a too stupid question.

When -as I used to- using $HTTP_POST_VARS, I can write the following:

echo $HTTP_POST_VARS-somevar;

which will, of course, echo the value stored in somevar sent via POST,
same as if I wrote

echo $HTTP_GET_VARS-somevar;

So far, so goot. But this doesn't seem to work with $_REQUEST.
Here it looks like I had to use $_REQUEST[somevar].

It's not that this would not be possible. But on the one hand I
think the arrow-notation is nicer and easier to read, on the other
hand I would be quite interested in the WHYNOT behind this ;)

Can you give me a hint? Or at least some place where I could start reading
and would find an explanation, not only you have to use...?

Thanxx
Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
http://www.gruppe-69.com/
mailto:[EMAIL PROTECTED]
-- 

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




RE: [PHP] PHP file Opening Problem

2002-05-13 Thread Christoph Starkmann

 Whenever I try to open any PHP page
 on my browser i.e. IE then it displays
 Windows message box for saving the file on the disk
 or opening the code in any editor.
 I mean PHP file is not executed successfully and 
 I am unable to figure out the problem.

Do you have a webserver installed with PHP on your local system and
a running and registered (httpd.conf if APACHE) PHP-system?

In your case, the browser gets a PHP-file and, of course, doesn't 
know what to do with it. Normally, if you access a PHP file via HTTP,
the webserver executes the script and returns the result as a HTML-doc
to your browser which renders the file.

Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
-- 

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




RE: [PHP] PRIMARY KEY vs. INDEX

2002-05-03 Thread Christoph Starkmann


 Yes, but that's what the php-db list is for.

I am sorry... Gonna get this list.

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




[PHP] PRIMARY KEY vs. INDEX

2002-05-02 Thread Christoph Starkmann

Hi there!

I guess I got a very easy question for the pros here...
I've been searching the documentaion of mySQL, but didn't
find the answer (even though I'm sure it's out there 
somewhere :))...

Is a primary key in mySQL automatically indexed? And is a
unique field indexed automatically ?(I don't think and 
don't hope so, but one never knows)

Thanx,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




RE: [PHP] xml/xslt capability?

2002-04-29 Thread Christoph Starkmann

Only one letter difference between PGP and PHP yet makes no sense... ;)


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 
 iD8DBQE8zWnJHpvrrTa6L5oRAv5DAJ9Fp8vq7+PPqIiM1Mnqf5sGZlhD5wCfWqan
 TWH60NiXJh5ESsHP0QNLsUY=
 =dJq7
 -END PGP SIGNATURE-

Kiko

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




[PHP] registering an array to a session?

2002-04-24 Thread Christoph Starkmann

Hi all!

Is it possible to register an array to a session with PHP 4?

If yes, how can it be done?

Cheers,

Kiko
-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




RE: [PHP] deleting lines in a textfield

2002-04-22 Thread Christoph Starkmann

AFAIK, there are no lines in a textfield; Text is simply displayed 
as needed to fit in the area of the textfield.

As soon as you can do anything with it in PHP, it is no longer in
a textfield but simply one string; This string you may search with
regular expressions or using PHP string functions.

If there were (are?) several lines, just crop everything from the
first newline to (not including) the second one.

HTH,

Kiko


 -Original Message-
 From: Kris Vose [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 22, 2002 5:45 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] deleting lines in a textfield
 
 
 How would you go about deleting a specific line in a 
 textfield via PHP?  For example, I want to delete line 2 only 
 and save the changes.  How would I go about doing this using 
 fopen and fwrite?
 š
 Kris
 

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




RE: [PHP] viewing get/post variables

2002-04-16 Thread Christoph Starkmann

Hi Martín!

 I can't remmeber how to configure php.ini so that if I get the URL
 http://localhost/index.php?var1=10
 an echo $var1 will return 10
 What I mean, is that _GET[var1] exists, but I want $var1 to 
 be available.

If $var1 is not available directly, your safe_mode seems to be 
turned on.
One way would be to turn safe_mode off again: change the line

safe_mode=On
to
safe_mode=Off

in your php.ini.

The safer way would be to prepare $var1, for example like this:

$var1 = $HTTP_GET_VARS[var1];

Now you can use $var1.

HTH,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
-- 

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




RE: [PHP] Includes

2002-04-05 Thread Christoph Starkmann

Hi Sebastian!

 Lately I have noticed many scripts that all consist of one 
 file even though
 they create the appearance of many pages. For example, you would open
 setup.php and a form would appear. Then after you complete 
 the form a new
 page appears with the results of your form, however the URL is still
 setup.php. So basically you can make complicated forms span 
 only one file
 instead of having separate file to gather, display and save 
 the data, how is
 this done?

You can handle the HTML-output from within any functions. What I am doing
normally is the following.

I got one page, let's say main.php

When calling this page I pass it a variable that tells main.php
which function to execute (printForm, submitForm, changeDB etc.)

This is done by a simple switch-cascade.

Now I'm organizing my functions properly in different include-files,
let's say displayFuncs.php, dbFuncs.php etc..

And IMHO anything is much more clean and relaxed like this ;)
On the other hand, if you connect to a db etc. you only have to
write the code for the db_connect only one time (I include this, too).

Was this what you wanted to know?

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




RE: [PHP] Includes

2002-04-05 Thread Christoph Starkmann

 Well, I think I should give a better explanation. I have been 
 seeing a lot
 of scripts that appear to be on multiple pages. For example:
 You  open file.php, and you are greeted with a form asking 
 your name. You
 give in your name and then submit the form. After you submit 
 the form you
 would normally get a new page saying your name has been 
 stored or something
 like that. This time, that also happens BUT you do not go to 
 a new separate
 file. The URL in your browser is still on file.php, however 
 the form that
 was there before is GONE and you see a totally new page. I am 
 asking how
 something like this can be done. If it will help I can attach 
 a file that
 does this.

Yes, and exactly this is what I told you ;)

I've got one page, let's say main.php.
This page is looking for a var, let's say called $curAction;
$curAction is not present the script knows that you're new to
this site and calls a function called displayWelcome (wherever
this function is defined ;)).


?php

$curAction = $HTTP_POST_VARS[curAction];

switch ($curAction)
{
case displayForm1:
{
displayForm1();
break;
}
case displayForm2:
{
displayForm2();
break;
}
case logoff:
{
displayGoodbye();
logout();
break;
}

// And so on...
}

function displayForm1()
{
?form!-- html goes here --/form?php
}

// ...and so forth
?

So this switch casecade handles what content is to be displayed,
which looks as if you where getting different pages...

Better now?

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




FW: [PHP] PHP FAQ (again)

2002-04-03 Thread Christoph Starkmann


Hi Ray!

 I am in total agreement with Justin on this one.  Many of the 
 posters use
 need help,  newbie needs help , etc.  We need to have 
 some form of FAQ
 with detailed instructions on how to post so that I do not 
 have to ask;

There are so many ressources on the web on how to pose questions
in mailing lists.
Do you think some extra documentation would help here?
I am afraid many of these posters wouldn't read this FAQ,
neither...

 I now some mailing lists will not even reply if you do not 
 follow specific
 criteria when you post...

That's up to everyone himself... BTW, there are many docs
on the web, too, on how to quote (avoid full quotes...)

Like someone (Rasmus?) wrote, there is a quite smart PHP
documentation to cover most of the basic questions, and
a lot of help here...

Again, do you think someone who isn't checking ouzt
the online doc would be reading the FAQ?

Regards,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
-

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




[PHP] Checking if a link is valid

2002-04-02 Thread Christoph Starkmann

Hi there!

This is a general networking problem, I guess...

$fp = fsockopen ($tempUrl, $tempPort, $errno, $errstr, 30);
// variables are fine, it works in most cases...

if ($fp)
{
fputs ($fp, GET / HTTP/1.0\r\n\r\n);
$code = fgets($fp,1024);
$code = str_replace(HTTP/1.1 , , $code);
$code = (int)$code;
echo $code;
fclose($fp);
echo  nbsp;a href=\ . $url . \ . $tempName . /abr;
}

I just have my code that does an fsockopen on a
webpage. This works just fine, and in most cases
I can extract the error code (404,200 etc.).
But now I experienced the following strange behaviour:
When trying this on a domain that is automatically
redirected by the provider, I just get a 404.
If I adress this site with my browser, I get
redirected and everything works fine.

The url in this case is http://www.gruppe-69.de/
't is redirected by my provider directly to
http://www.gruppe-69.com
but my linkchecker thinks it would be dead
(404)

Any idea how I can check this, too?

Thanx and cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




RE: [PHP] ping

2002-03-27 Thread Christoph Starkmann

Hi CHris!

 has anyone written a script to check if a host is alive - 
 like a ping script ?

Something like this?

BTW, any hints to weak or wrong code are welcome, I'm not
this experienced with PHP ;)

Cheers, Kiko
P.S.: There are some formatting strings and some variables
stored in constants.php and a simple error function in
functions.php, but that's all, I guess anyone can change
this... ;)



html
headtitle.o0o.linktest.o0o./title/head
body bgcolor=#99
?php
require(constants.php);
require(functions.php);

echo $f_h1 . Check your Links .$f_h1e;

if (isset($HTTP_GET_VARS[url]))
{
$url  = $HTTP_GET_VARS[url];
$tempName = $url;
$tempDesc = ;
$tempPort = 80;

$tempUrl = str_replace(http://;, , $url);
$tempUrl = str_replace(/, , $tempUrl);

$fp = fsockopen ($tempUrl, $tempPort, $errno, $errstr, 30);

if (!$fp)
{
echo br . $f1 . Link fehlerhaft:  . $url . $f1_e .
br\n;
}
else
{
fputs ($fp, GET / HTTP/1.0\r\n\r\n);
$code = fgets($fp,1024);
$code = str_replace(HTTP/1.1 , , $code);
$code = (int)$code;
if ($code == 200) echo $f1 . Link okay ($code)br .
$f1_e;
else
{
while ($code = fgets($fp, 2048))
{
echo $f1 .  . $code . br . $f1_e;
}
}
fclose($fp);
}
echo a href=\ . $url . \ . $f_link . $tempName . $f_linke .
/abr;
}
?
form action=linktest.php method=get
table cellspacing=0 cellpadding=0 border=0 width=50%
tr
td
input type=text name=url
/td
td
input type=submit
/td
/tr
/table
/form
/body
/html


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




[PHP] fsockopen

2002-03-26 Thread Christoph Starkmann

Hi!

I'm trying to check the validity of given hyperlinks...
I thought this code should work (Apache 1.3.9, Win98)

$tempUrl = ereg_replace(http://;, , $url);

$fp = fsockopen ($tempUrl, $tempPort, $errno, $errstr, 30);

if (!$fp)
{
echo brerror opening $url: \$errstr=$errstr, \$errno=$errnobr\n;
}
else
{
fputs ($fp, GET / HTTP/1.0\r\n\r\n);
echo brs . fgets($fp,1024);
fclose($fp);
}

For each and every url,

$fp = false;
$errstr = ;
$errno = 0;

Where is my mistake? I guess I'm simply getting sth wrong...

Any hint would be great.

Cheers,
Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




RE: [PHP] fsockopen

2002-03-26 Thread Christoph Starkmann

Hi!

 Is $tempPort set ?

Yes... 80 as default...

  $tempUrl = ereg_replace(http://;, , $url);
 
  $fp = fsockopen ($tempUrl, $tempPort, $errno, $errstr, 30);
 
  if (!$fp)
  {
  echo brerror opening $url: \$errstr=$errstr, 
 \$errno=$errnobr\n;
  }
  else
  {
  fputs ($fp, GET / HTTP/1.0\r\n\r\n);
  echo brs . fgets($fp,1024);
  fclose($fp);
  }

Cheers...
Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




RE: [PHP] fsockopen

2002-03-26 Thread Christoph Starkmann

Oohh so sorry... Now it works.
I simply forgot to crop the tailing /
from the URL. Call me stupid for now...

Thanx alot ;)

Cheers,

Kiko

-
Fool me once. Shame on you. Fool me twice. Shame on me.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




[PHP] checking if a link is still alive

2002-03-21 Thread Christoph Starkmann

Hi there!

I would like to implement a feature to a website
I'm working at right now but don't know where to
start (searching), so maybe one of you can give me
a hint.

The Links page is dynamically created out of a
database. Now what I want is to have a function 
that checks (each time) if all links are still
alive and to display only valid links.

Is there any posibility to check if there is
actually a website behind a link or just, let's
say a 404?

Would be a nice feature, together with an email
notification to the webmaster, I think...

Any hints are appreciated.

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




[PHP] RE: checking if a link is still alive

2002-03-21 Thread Christoph Starkmann

Outsch, sorry, I just found what I wanted...

 Is there any posibility to check if there is
 actually a website behind a link or just, let's
 say a 404?

http://www.hotscripts.com/PHP/Scripts_and_Programs/Link_Checking/

Have a nice day ;)

Kiko
-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




RE: [PHP] multiple variables

2002-03-15 Thread Christoph Starkmann

Hi!

 if(user($arbitraryVariable)==(1 or 2 or 3 or 4))
 What would be the proper syntax for this?

Here:

if((user($arbitraryVariable) = 1) and ($arbitraryVariable = 4) and
($arbitraryVariable == round($arbitraryVariable)))

In other cases, you'd have to write

if((user($arbitraryVariable)==1) or (user($arbitraryVariable)==2) or (...))

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




[PHP] ereg

2002-02-11 Thread Christoph Starkmann

Hi there! Is there any mean to tell PHP to use ereg etc. greedy?

Thanx,

Kiko

-
It's not a bug, it's a feature.

[.nfq]

christoph starkmann

tel.: 0821 / 56 97 94 34
fax.: 0821 / 56 97 94 38

http://www.fh-augsburg.de/~kiko

ICQ: 100601600
-

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




[PHP] Maximum execution time of 30 seconds exceeded

2001-12-06 Thread Christoph Starkmann

Hi everybody!

I wrote a script just to do some local replacement stuff here on my own
machine.
Is there any way to change the maximum execution time of PHP which seems to
be 
restricted to 30 seconds

Would be great if you could give me a hint on how to change this...

Thanx alot,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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

2001-11-29 Thread Christoph Starkmann

BTW...

Can anybody tell me where the words

foo and bar

come from?

Thanx,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

-- 
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] Global storage of objects.

2001-11-29 Thread Christoph Starkmann

Hi Stefan!
 I would like to know if there is a way to store objects 
 globally from a
 php-page, so that the object can be used from another page.

Why not writing these objects to a *.php document which you can
include wherever you need it?

HTH,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

-- 
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] mkdir()

2001-11-28 Thread Christoph Starkmann

Hi there!

I got the following problem:

I want to mirror a complete directory tree. Now I traverse
the original tree, do changes to some of the files and want to
write the resulting files to a parallel directory.

Lets say $INPUT_PATH is the source path and $OUTPUT_PATH is
where I want to put the copies.
$file is the path o the current file.

Now I tried to do the following:

//...snip...

$outfileName = ereg_replace($INPUT_PATH, $OUTPUT_PATH, $file); 
$OUTFILE = fopen($outfileName, w) || die (Oooops, couldn't open $file);

// ... more blahblah...

fclose($OUTFILE);

But now I got an error:

Warning: fopen(path/directory/template.html,w) - No such file or
directory in filename.php on line 231

Okay, I hoped PHP would create the directory, too, along with creating 
the file Iwant to write to when it doesn't exist.

When I try to create the directory manually using

mkdir(path/directory, 0777) || die (Yet another ugly death...);

I get yet another ugly error:

Warning: MkDir failed (No such file or directory) in filename.php on line 29

Why is this? Of course there is no such file or directory... If there was, I
wouldn't have to create one ;)

Any ideas? Hints?

Every tidy bit of wisom is appreciated...

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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

2001-11-23 Thread Christoph Starkmann

As far as I can say, a simple ereg-command is always greedy, isn't it?
Can you tell me how to switch greedy off?

I want to find everything between the start- and end-php-tags:

$phpIncludes = array();
ereg(\?php.*\?\, $html, $phpIncludes);

where $html contains the entire page, containing one php-script-section
at the very top and one at the very botton, and maybe some inbetween.

Now the above ereg always returns me the entire site in $phpIncludes[0];

All help is appreciated, thanx a lot,

cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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

2001-11-23 Thread Christoph Starkmann

Hi there!

I had to create a large number of HTML-files with large parts
within that are identical (the navigation).
To avoid redundant writing during the creation of the files,
I used PHP-Includes to include this navigation from one file.

Now I have to get static HTML-pages from these php-enriched files.

I am thinking about using regexp to filter the php-tags and include
the corresponding HTML-Sniplets.

Or I guess I could open a connection to the server and read these
files as if I was a client (browser) and stzore the resulting HTML-pages.

Any idea what would be easier (I got very few time...)

Any hints?

Cheers, 

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

-- 
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] stupid little problem

2001-11-16 Thread Christoph Starkmann

Hi!

 a$ = test;
 b$ = test2;
 data$ .= a$ . . b$   ;
 echo data$;
 
 it outputs:
 test test2
 instead of:
 test   test2  
 
 I really need that spaces..
 any help?

HTML is normalizing all text; So any number of spaces, tabs newlines etc.
become one space  ;

If you want a certain number of spaces, you could use the nbsp;-entity:

$a = test;
$b = test2;
$data = $a . nbsp;nbsp;nbsp;nbsp; . $b . nbsp;nbsp;nbsp;nbsp;;

echo $data;

Greets,

Kiko

-
It's not a bug, it's a feature.

[.nfq]

christoph starkmann

tel.: 0821 / 56 97 94 34
fax.: 0821 / 56 97 94 38

http://www.fh-augsburg.de/~kiko

ICQ: 100601600
-

-- 
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] Url Length Limitations?

2001-11-12 Thread Christoph Starkmann

Hi!

 Is there any limitation for length of url like this
 accept.php?set=qwerty...

Depends on the OS/Server, but you'll have to consider one to exist...

 What is the maximum $set length i can pass to script as a parameter?

Why don't you use POST? With POST, there is not limitation...

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

-- 
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] = 0 and = 0

2001-10-25 Thread Christoph Starkmann

Hi John!

   The integer 0 is equal to False, but not Null.
 
  Not quite true.  0 evaluates to false.  They are not equal. 
  Try this:
 [...]
  So be careful and try to think of 0 and false as distinct 
 and separate
  entities and you will avoid coding mistakes like this.
 
 Is this seen as a strength or a weakness of PHP.?

According to my experience I'd say both, depending on the context...
If you have to determin its type before using a variable and then, when
changing it, have to do an explicit typecast, programming gets cleaner
and in many cases more safe.
On the other hand, if let's say false == 0 and true == 1, you can do
nice things like arithmetic operations using booleans:

$x = $y * (-1 * (abs($z) == $z));

Get the idea?
 
 In C(++), direct comparisons to true/false are discouraged.
 In other words, instead of this:
 bool x;
 if(x==true) ...
 if(x==false) ...
 
 itt's always considered better to do this:
 if(x) ...
 if(!x) ...
 
 But PHP seems to require a direct comparison with false
 in certain situations. Are there any cases where you need
 to do a direct comparison with true?

AFAIK it's only a matter of speed. Unary operators consume less
time than binary ones... Correct me if I'm wrong.
 
 Are you coming to Ottawa in the future?

This I don't know... ;)

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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