Re: [PHP] Help with include path

2003-02-03 Thread Knut H. Hassel Nielsen
On Sun, 2 Feb 2003, César Aracena wrote:

> Hi all,
>
> I'm sorry for this re-post, but I do need help with this URGENT...
>
> I just finished loading the OS to my PC once again, installed and
> configured IIS and then installed PHP 4 but now, every page I try to open
> tells me:
>
> Failed opening required '/icaam7/lib/stdlib.php'
> (include_path='.;c:\php4\pear')
>
> even when my php.ini (under Windows folder) tells me that the include_path
> is:
>
> include_path = ".;c:\php\includes;/"
>
> and no matter how I change this line in php.ini, the include_path appears
> to be set ONLY to c:\php4\pear
>
> Any ideas on how to change that??? Is there another php.ini file around?

Have you compiled PHP to use the PATH to your php.ini, or is it using another
one?

Check to see if there's another php.ini lying around.

-- 
Knut
--
Knut H. Hassel Nielsen, [EMAIL PROTECTED]
Divisional Engineer, Office : ITS 207
IDI NTNU, Sem Saelands vei 7-9
N-7491 Trondheim, Norway
Phone (+47) 73 59 18 46 Fax (+47) 73 59 44 66

"And on the seventh day, He exited from append mode."


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




Re: [PHP] Book.

2001-12-19 Thread Knut H. Hassel Nielsen


Remember #!/usr/local/bin/php -q
 ^^^
This will quell any http-headers, and give you clean output.
(provided you wite your script right ;) )

On Thu, 20 Dec 2001, Bas van Rooijen wrote:

>
>
> No not CGI, binary (instead of apache module).
>
> - Just leave out the --with-apache part when you do configure.
>
> by default 'make install' will put the php binary in /usr/local/bin
>
> - On top of your PHP script add the following line:
> #!/usr/local/bin/php
>
> - Make sure you don't use MS-DOS (but UNIX) style text files,
> PHP doesn't care but for that first line it may be important.
>
> - PHP open/close tags  still apply
>
>
> bvr.
>
> On Wed, 19 Dec 2001 15:07:21 -0800 (PST), Mehmet Kamil ERISEN wrote:
>
> >Hi,
> >I think I'm misunderstood.  I do not want to run in cgi
> >mode.
> >Thanks,
> >Mehmet.
> >--- Mart¡n Marqu‚s <[EMAIL PROTECTED]> wrote:
> >> > information on how to run PHP from Unix, as a cron job,
> >> how
> >> > can PHP scripts be called from Shell Scripts etc...
> >>
> >> You need to compile PHP without web-server support, for
> >> cgi. In that case you
> >> will get a binary file, and you can use just like you use
> >> perl or bash for
> >> making scripts.
>
>
>
>
>

-- 
Knut
--
Knut H. Hassel Nielsen, [EMAIL PROTECTED]
Principal Engineer, Office : ITS 204
IDI NTNU, Sem Saelands vei 7-9
N-7491 Trondheim, Norway
Phone (+47) 73 59 18 46 Fax (+47) 73 59 60 35

"We all live in a yellow subroutine."


--
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 should I do this site...?

2001-12-19 Thread Knut H. Hassel Nielsen



Hi there

Have you tried putting this into your '.htaccess' for each hierarchy, so that it
will use a different 'master.inc' for each hierarchy ?

Then you could divide the master.inc into three master.incs that could include
the files they needed for each of the sections.


.htaccess

--

php_value include_path '.:/path/to/section1'

--




On Wed, 19 Dec 2001, Martin Hughes wrote:

> Heya,
>
> OK - I have a site I've been working on on and off for a while. It started
> as a static page, then I changed it so it uses php. This was great - until I
> started putting content in the design. I now have about 300 *.inc files for
> the site, and updating them is a joke!
>
> The site is designed in a heirachical way:
>
> Top
>   Section 1
> id 1
> id 2
> id 3
> id 4
>   Section 2
> id 1
> id 2
> id 3
>   Section 3
> id 1
> id 2
> id 3
> id 4
> etc...
>
> I'm using 1 file for the code - index.php?sect=XX&id=XX and the nav menus
> are dynamically generated and populated on the page along with the content
> which is filled by an inc file in directory: root/php/"sectname"/"id".inc
> where "sectname" is the name of a section defined in an array in index.php
> (eg, section 6 is "synthesizers"). The images and headings on the page are
> also dynamically generated (images have a number eg "2.jpg" for the heading
> of section 2 etc.)
>
> In sections 6 though, ids 2-6 are based on one template, so i have 5 files:
> 2.inc, 3.inc, ... 6.inc all exactle the same, just containing  require_once('php/synthesizers/template.inc') ?>
> This seems somewhat stupid.
>
> Oer X-Mas & New Year, I want to entirely recodethe site so it is more "user
> friendly" for me to maintain. I am slowly getting better and better at php
> so it should be good.
>
> Does ANYONE have any pointers as to how to start and do this thing. Any
> ideas for how my site should be layed out (directory-wise etc - is it easier
> to have 1 directory per section and hold everything in it - images included,
> or is it best to have a separate img/ directory??).
>
> many thanks all - Seasons greets!!
>
> Martin
>
>
>
>

-- 
Knut
--
Knut H. Hassel Nielsen, [EMAIL PROTECTED]
Principal Engineer, Office : ITS 204
IDI NTNU, Sem Saelands vei 7-9
N-7491 Trondheim, Norway
Phone (+47) 73 59 18 46 Fax (+47) 73 59 60 35

"If debugging is the process of removing bugs, then programming
 must be the process of putting them in. -Dykstra"


-- 
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: Random

2001-12-19 Thread Knut H. Hassel Nielsen

On 19 Dec 2001, David wrote:

>  should be because rand() can\'t generate such a large number for u.
>
> use $max_random_number = getrandmax(); to check
>
> http://sg.php.net/manual/en/function.getrandmax.php

Hmmm... My webserver gives me no problems witht this at all.
(Sun E250 with Solaris 8, Apache 1.3.20 and PHP4.6)


This :



Gives me a 6-digit integer every time



-- 
Knut
--
Knut H. Hassel Nielsen, [EMAIL PROTECTED]
Principal Engineer, Office : ITS 204
IDI NTNU, Sem Saelands vei 7-9
N-7491 Trondheim, Norway
Phone (+47) 73 59 18 46 Fax (+47) 73 59 60 35

"Programmers don't die, they just GOSUB without RETURN."


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

2001-12-19 Thread Knut H. Hassel Nielsen

On Thu, 20 Dec 2001, Necro wrote:

> Lo all,
>
> Can anyone please explain why this doesn't work...
>
> $floor = 10;
>   $ceiling = 99;
>   srand((double)microtime()*100);
>   $random = rand($floor, $ceiling);
>
> I get the error...
> Warning: rand(): Invalid range: 10..99 in
> d:\htdocs\ezone\web\signup2.php on line 49
>
> Thankyou
>
> Andrew

Hi there.

I see you  use windows, but when I looked up 'microtime' in
the manual it says the following :

---
microtime

microtime -- Return current UNIX timestamp with microseconds

Description

string microtime(void);

Returns the string "msec sec" where sec is the current time measured in the
number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and
msec is the microseconds part. This function is only available on operating
systems that support the gettimeofday() system call.

See also time().
---

So you'll probably have to use something else for your rand (or change OS ;) )

Good luck, and a merry Christmas to you.

-- 
Knut
--
Knut H. Hassel Nielsen, [EMAIL PROTECTED]
Principal Engineer, Office : ITS 204
IDI NTNU, Sem Saelands vei 7-9
N-7491 Trondheim, Norway
Phone (+47) 73 59 18 46 Fax (+47) 73 59 60 35

"Programmers don't die, they just GOSUB without RETURN."


-- 
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] IP address enconding

2001-04-19 Thread Knut H. Hassel Nielsen

On Thu, 19 Apr 2001, elias wrote:

> Hello.
>
> How can i get the IP address of the user who's browsing my current script?
> how can i do it via JavaScript and PHP please.

$REMOTE_ADDR should do the trick (use 'phpinfo()' to see for yourself)

> And if i got an IP address such 192.168.0.2
> i believe it will be returned as a stringIs there is a function to
> encode it to an Integer and the decode it back to a string? or i have to
> code it myself?
>
> -elias

It is a string, so you couldn't make an integer out of it anymore than making
any other string into an integer. The '.' isn't a legal digit.

You'll have to split it up into different blocks (use split)

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] Running php as a CGI

2001-04-17 Thread Knut H. Hassel Nielsen

On Tue, 17 Apr 2001, Boget, Chris wrote:

> We compiled PHP to be used as a CGI and it's
> working great.  However, whenever we run a
> php script, the following message gets outputted
> at the start of the output:
>
> "X-Powered-By: PHP/4.0.3pl1
> Content-type: text/html"
>
> Is there any way we can suppress that message?
> I looked all over the docs and missed that info if
> it's there.  If the details on how to suppress this
> is in the documentation, a link would be most
> appreciated (or a link to anywhere else that might
> have this info).  Otherwise, any insight would
> be greatly appreciated!
>
> Chris
>

Yup!

Just run it with the flag '-q' to QUELL HTML-headers.

Example :

 #! /path/to/php -q
 

Or just run them with 'php -q script_name'

Good luck

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] L? Roman function

2001-04-10 Thread Knut H. Hassel Nielsen


Hi there. I picked up this function several years ago. See if this can help you
see what the roman value for an arabic number is.


//Calculates the Roman numerals for the given Arabic number.
// Returns '' on error.
function to_roman($num) {
  // There is no '0' or negative numbers in Roman numerals.
  // Also, anything not in [0-9] is bad input.
  if (!ereg('^[0-9]+$', $num) || ((int)$num == 0)) {
return('');
  }
  // Do some setup
  $num = (int)$num;
  $letter[10] = array('X', 'C', 'M');
  $letter[5] = array('V', 'L', 'D');
  $letter[1] = array('I', 'X', 'C');
  $roman = '';
  // Numbers > 1000 are a special case.
  // (No letters > 'M')
  $digit = (int)($num / 1000);
  $num -= ($digit * 1000);
  while ($digit > 0) {
$roman .= 'M';
$digit--;
  }
  // Do the work
  for ($i=2; $i>=0; $i--) {
$power = pow(10, $i);
$digit = (int)($num / $power);
$num -= ($digit * $power);
if (($digit == 9) || ($digit == 4)) {
  $roman .= $letter[1][$i] . $letter[$digit+1][$i];
} else {
  if ($digit >= 5) {
$roman .= $letter[5][$i];
$digit -= 5;
  }
  while ($digit > 0) {
$roman .= $letter[1][$i];
$digit--;
  }
}
  }
  // If we didn't use up $num, something broke.
  if ($num > 0){
return('');
  }
  return($roman);
}


On Tue, 10 Apr 2001, bill wrote:

> I think L is 50.
>
> bill
>
> Kurth Bemis wrote:
>
> > what does the roman numeral L mean?
> >
> > can someone point me to a page that has all of the roman numerals and their
> > English equivlents?
> >
> > i forgot?
> >
> > ~kurth
> >
> > --
> > 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]
>
>
>

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] getting commandline ?

2001-04-09 Thread Knut H. Hassel Nielsen
supported
> | >> platform."
> | >>
> | >>
> | >>
> | >> --
> | >> 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]
> | >
> | >
> | >
> /***
> **
> | > *\
> | > *Joe Stump - PHP/SQL/HTML Developer
> *
> | > * http://www.care2.com - http://www.miester.org -
> http://gtk.php-coder.net   *
> | > * "Better to double your money on mediocrity than lose it all on a
> dream."   *
> | >
> \***
> **
> | > */
> |
> |
> | --
> | 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]
> |
>
>
>
>

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] Asking for input from shell?

2001-04-09 Thread Knut H. Hassel Nielsen



Try this instead :

#! /local/bin/php -q


On Mon, 9 Apr 2001, enthalpy wrote:

> when using this more then once in a script i get errors
> even though the file pointers are different.
>
> echo "Artist: ";
> $artist = fopen("php://stdin", "r");
> echo fgets($artist, 64);
> fclose($artist);
> echo "\n";
>
> echo "Album: ";
> $album = fopen("php://stdin", "r");
> echo fgets($album, 64);
> fclose($album);
> echo "\n";
>
> ---
> Errors:
>
> Warning:  fopen("php://stdin","r") - Bad file descriptor in 
>./addvinyl.php on line 11
> 
> Warning:  Supplied argument is not a valid File-Handle resource in 
>./addvinyl.php on line 12
> 
> Warning:  Supplied argument is not a valid File-Handle resource in 
>./addvinyl.php on line 13
>
>
>
>
> <-CoreComm-Internet-Services---http://core.com->
> (Jon Marshall CoreComm Services Chicago)
> ([EMAIL PROTECTED] Systems Engineer II)
> ([EMAIL PROTECTED]   Network Operations)
> <-Enthalpy.org-http://enthalpy.org->
> ([EMAIL PROTECTED] The World of Nothing)
> <-->
>
> On Mon, 9 Apr 2001, Jason Brooke wrote:
>
> > $fp = fopen("php://stdin", "r");
> > echo fgets($fp, 64);
> > fclose($fp);
> >
> > - Original Message -
> > From: "enthalpy" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, April 09, 2001 1:10 PM
> > Subject: [PHP] Asking for input from shell?
> >
> >
> > >
> > > anyone have sample code of how you can have a php script (cgi)
> > > ask for input from the shell?
> > >
> > > <-CoreComm-Internet-Services---http://core.com->
> > > (Jon Marshall CoreComm Services Chicago)
> > > ([EMAIL PROTECTED] Systems Engineer II)
> > > ([EMAIL PROTECTED]   Network Operations)
> > > <-Enthalpy.org-http://enthalpy.org->
> > > ([EMAIL PROTECTED] The World of Nothing)
> > > <-->
> > >
> > >
> > > --
> > > 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]
> >
> >
>
>
>

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] Direct output to printer

2001-04-05 Thread Knut H. Hassel Nielsen

On Thu, 5 Apr 2001, Plutarck wrote:

> Ah, the joys of strlen().
>
> That's your first question, but now for the second.
>
> Sending data directly to the printer is basically a client side function,
> and as PHP is totally server side it just can't do it. Not technologically
> possible.
>
> There are some "printer direct" type programs around, and you can certainly
> figure out a way to make PHP work with those, but that's about all you can
> do.


Well... If you can get 'lpr' to except requests from 'nobody' you might just
have a solution ( AND a problem ;) ) ('nobody' is here pointing to the user set
up to run your webserver-processes. 'lpr' is a standard print under unix)

But as Plutarck just said : It's client-side stuff, and all dependant on what
you use and if that client can do it.

I know that Netscape doesn't accept this kind of requests.


-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] Apache latest + PHP latest + GD latest + Freetype latest+ Jpeg latest

2001-04-05 Thread Knut H. Hassel Nielsen

On Thu, 5 Apr 2001, Plutarck wrote:

> This may not be your problem at all, but I remember reading something to the
> effect of if your recompiling PHP, you need to delete configure.cache...or
> it was somefile with the .cache extension.
>
> With all those lines with "(cache)" in them, thought that might be relevant.
>
> If not I hope you find the answer.
>
> You might want to try compiling it with either an older version of GD, or of
> PHP, just so you can drill down which part of the setup is giving you the
> errors.


Shouldn't it be enough to do a 'make clean' or 'make distclean' before you
reconfigure ?


-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


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

2001-04-05 Thread Knut H. Hassel Nielsen

On Thu, 5 Apr 2001, Plutarck wrote:

> I was wondering what the hell language that was...still trying to figure it
> out. LOL
>
> I know it's not spanish, english, german, italian, french, or portugese. I'm
> betting on either norwegian or dutch.


Norwegian!!! What an insult to us Norwegians.
We don't spam in this country. We only kill whales and wolfs ;)

> I'll have it figured out in a few minutes...I hope, lol. And I might even
> figure out what it says too :)

It's Dutch.

Damn!! Babelfish hasn't got a dutch-option.

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] Building an array from a URL

2001-04-04 Thread Knut H. Hassel Nielsen


Did you try to see if $HTTP_GET_VARS can help you ?

Its an array of every variable posted by GET (the way you described)

Else :

Split the different key/values with the delimiter '&' and thereafter split the
elements in the array by '='

But first split the string into page and variables :

list( $page, $str ) = 
split("?","superRSS.phtml?150=1150&superRSS166=1166&superRSS168=1168&superRSS175=1188");

function make_arr_from_str( $str ) {
  $exp_arr = Explode( "&", $str );
  $new_arr = Array();
  for ( $i = 0 ; $i < count( $exp_arr ) ; $i++ ) {
list( $key, $val ) = split( "=", $exp_arr[ $i ] );
$new_arr["$key"] = $val;
  }
  return $new_arr;
}

$array = make_arr_from_str( $str );
var_dump($array);



On Wed, 4 Apr 2001, Mike Gifford wrote:

> Hello,
>
> I'm trying to build an array out of data submitted from a URL.
>
> Essentially, I want to pull certain records out of a database which have been
> selected on another form.
>
> The URL presently looks like this:
>   superRSS.phtml?150=1150&superRSS166=1166&superRSS168=1168&superRSS175=1188
>
> I'd like to take these independent variables and merge them into a single array:
>   $array_superRSS = implode (":", $superRSS[]);
>
> So I can then pipe these values directly into another function:
>
> while ($array_superRSS) {
>   display_superRSS($array_superRSS[]);
> }
>
> Obviously I'm missing a step or two here, but would really appreciate someone
> filling in some of the gaps.
>
> Thanks!
>
> Mike
>

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


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

2001-04-04 Thread Knut H. Hassel Nielsen

On Wed, 4 Apr 2001, phpa wrote:

> Hey there,
>
> anybody know where a list of mime type names can be found?  I can generate and Excel 
>doc - but I dont know the mime names of others such as Word etc etc.
>
> example code:
>
> Thanks
>
>
>
>
> 
> header( "Content-type: application/vnd.ms-excel" );
>
>
> ?>
>
> 123 123 123
> 10  10  10
>

Isn't there a MIME.TYPES kind of file underneath your conf-region in your apache
distribution ??

That should do it

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] Monthly Drawing Winner!

2001-04-04 Thread Knut H. Hassel Nielsen



Hehehehe ;)

How much is that on each of us ?
And were do we collect this ?


On Wed, 4 Apr 2001 [EMAIL PROTECTED] wrote:

>
> Dear PHP Group [EMAIL PROTECTED],
>
> Congratulations! You just won US$10.00!!
>
> We just gave away US$25,000.00!!  And you PHP Group [EMAIL PROTECTED] are
> among the lucky 2500 people randomly selected to receive a FREE US$10.00 Trial
> Account at TheCasino.com - the Internet's Premier Online Casino!
> ....

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] login without database

2001-04-02 Thread Knut H. Hassel Nielsen

On Fri, 30 Mar 2001, Jon Rosenberg wrote:

> you could use flat files, another words store the user information in a text
> file like below:
> username|pass|email
> bob|fgffsdg|[EMAIL PROTECTED]
> foo|bar|[EMAIL PROTECTED]
>
>
> and then just read and write the file with PHP.
>
> Jon

Be sure to crypt the password you're saving in the file. Then you crypt the
passwords coming in to the script with the same salt (se function crypt in the
manual). Then compare the two and see if they differ from each other.

Good luck

-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


--
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] Arrays : Key in Array, True/False

2001-03-30 Thread Knut H. Hassel Nielsen


Hi there

I have a script with a function that builds a more comprehensive kind
of array for parsing arguments given a script in PHP (this is a
backup-script I'm currently working on).

My problem is in "THE PARSING OF ARGS PART" when I'm asking the array
if the key exists in the array it returns 0. The key exists, I know
because of the output from the function ( var_dump($array) ), but the
function 'in_array()' only returns true if I ask for a value.

Does anyone know if I can use anything else to give me the possibility
to also ask for the keys, or do I have to write a 'in_array()'-kind of
function myself ??

#! /local/bin/php -q


-- 
Knut
--
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :   91 59 86 06


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