[PHP] blogger with ODBC support?

2002-10-26 Thread jaxon
hi,

does anyone know of a blogger with ODBC support?

cheers,
jaxon


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




[PHP] auction scripts?

2002-09-01 Thread jaxon

hi,

can anyone relay experience or recommend a php-based ebay-style auction 
script?

tkx,
jaxon


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




[PHP] postnuke / geekware?

2002-07-18 Thread jaxon

hi,

anyone have an opinion on postnuke versus geekware for a php-based CMS?

cheers,
jaxon


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




[PHP] PHP Functions Essential Reference??

2002-07-16 Thread jaxon



does anyone have a copy of the electronic version (free, i believe?) of 
the book "PHP Functions Essential Reference" ?
the website http://www.php-er.com has been down and i am trying to 
locate it...

cheers,
jaxon


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




[PHP] web-based frontend to Majordomo archives?

2002-07-16 Thread jaxon

hi,

does anyone know of a yahoo-groups style web-based front end to 
Majorodomo using PHP?

cheers,
jaxon


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




[PHP] i know it's been asked before... but virtual dedicated?

2002-03-19 Thread Jaxon

hi,

i know this is one of the nearly weekly questions, but i couldn't find an
appropriate answer on marc.theaimsgroup.com.

anyone have good experiences with a commercial-level ISP offering:
- shell
- virtual dedicated hosting enviroment including freedom to compile my own
PHP, etc??
- good dns to allow funky domain redirection

cheers,
jaxon




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




RE: [PHP] A good PHP Shop

2002-03-07 Thread Jaxon

www.fishcart.org :)

i've been trying to decide which one to use to tackle a big mall project,
but don't know enough about 'carts to make an intelligent assessment yet.

cheers,
jaxon

> -Original Message-
> From: Bradley Goldsmith [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 07, 2002 5:06 PM
> To: '[EMAIL PROTECTED]'; Bradley Goldsmith; 'Peter Haywood';
> [EMAIL PROTECTED]
> Subject: RE: [PHP] A good PHP Shop
>
>
> Dunno, Havn't looked at it. What's the Url?
>
> -bcg
>
>
>
> -Original Message-
> From: Jaxon [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 8 March 2002 8:49 AM
> To: Bradley Goldsmith; 'Peter Haywood'; [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: RE: [PHP] A good PHP Shop
>
>
> hi
>
> how does it compare to fishcart?
>
> cheers,
> jaxon
>
> > -Original Message-
> > From: Bradley Goldsmith [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, March 07, 2002 4:40 PM
> > To: 'Peter Haywood'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] A good PHP Shop
> >
> >
> > Check out phpshop.org.
> >
> > It's base implimentation is a little dry (but extremely functional).
> >
> > You can view a heavily modified version in the wild at my shop:
> > www.artsupplies.com.au
> >
> >
> > All the best,
> > Brad
> >
> >
> > -Original Message-
> > From: Peter Haywood [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, 7 March 2002 2:31 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: [PHP] A good PHP Shop
> >
> >
> > Hello,,
> >
> > I am looking at setting up PHP driven shop.
> >
> > Can anyone recommend one?  Or which ones to stay away from?  And why?
> >
> > I am reviewing phpShop at the moment, and it looks pretty
> nicely featured.
> >
> > Thanks,
> >
> > Pete
> >
> >
> >
> >
> > --
> > 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
> >
> >
> >
>
>
>



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




RE: [PHP] A good PHP Shop

2002-03-07 Thread Jaxon

hi

how does it compare to fishcart?

cheers,
jaxon

> -Original Message-
> From: Bradley Goldsmith [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 07, 2002 4:40 PM
> To: 'Peter Haywood'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] A good PHP Shop
>
>
> Check out phpshop.org.
>
> It's base implimentation is a little dry (but extremely functional).
>
> You can view a heavily modified version in the wild at my shop:
> www.artsupplies.com.au
>
>
> All the best,
> Brad
>
>
> -Original Message-
> From: Peter Haywood [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 7 March 2002 2:31 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] A good PHP Shop
>
>
> Hello,,
>
> I am looking at setting up PHP driven shop.
>
> Can anyone recommend one?  Or which ones to stay away from?  And why?
>
> I am reviewing phpShop at the moment, and it looks pretty nicely featured.
>
> Thanks,
>
> Pete
>
>
>
>
> --
> 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
>
>
>



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




RE: [PHP] really weird problem

2002-02-14 Thread Jaxon

Lars,

Thanks, you were right that IE was dumping things.
I think there must have been some wacky line breaks or somesuch.
Re-typing the file by hand produced success.

cheers,
jaxon
 


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




[PHP] really weird problem

2002-02-14 Thread Jaxon

hi folks, can someone shed some light here?

i've got a file called index.php with the following contents:

";
if (is_null($page_name)) $page_name="about";
echo "debug: page name = $page_name";

$nav_array = array ("about => About",
"reservations => Reservations",
"directions => Directions",
"contact => Contact"
);

$nav="lnav.inc.php";
$footer="foot.inc.php";
$pic = "$page_name" . "jpg";
$text= "$page_name" . ".txt";
?>

when i call the page, i get no visible output - this is the resulting page
source:






so where the heck are the html tags coming from???
the other weird thing is that a file with just  works
fine!

any ideas?

cheers,
jaxon



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




RE: [PHP] curious - any phpshop/core users?

2002-01-31 Thread Jaxon

Aric,

I too have built a modular system, with my own template system, etc.,
although it's pretty basic.
I've worked on alone it enough to know that I'd prefer to benefit from a
community project :) but I've not found one that really works either.

For my next programming project I want to implement a Mall site that also
has community portal type resources.
I've played with PHPNuke, Phorum, and a couple other packages, but they
don't seem very integrate-able, as you mention.

If I cannot find a modular frameworks system I'll probably take PHPShop or
FishCart and hack them into my system, but I'm spending time now to explore
alternatives.

I appreciate your feedback, and can vouch that you are by no means alone in
searching for such a system.

Some modular systems that are on my list to check out are EzPublish
(www.ez.no) and BinaryCloud (www.binarycloud.org) but I've yet to find one
that contains both modular site framework bits, a robust shopping cart,
slash-style blogger, and good authentication.

I'll keep digging; letcha know if I find something worth checking out.

Cheers,
Jaxon

> -Original Message-
> From: Aric Caley [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 31, 2002 6:02 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] curious - any phpshop/core users?
>
>
> I've used PHPShop (the existing version, not the new
> core/commerce thing) to
> do one site.
>
> It's relatively easy to set up.  I've had to do some modifications to it
> (namely, to make it use Payflow link, which works via HTTP requests; and
> adding dropdown menus on products to select color & airtime rates -- its a
> pager site).  It doesnt use templates exactly.. lots of HTML
> mixed with PHP.
>
> It definately could use some work.  I havent really checked out the new
> version, since the commerce module is not released yet.
>
> I too am interested in modular systems.  I'd like to see some sort of
> modular system that makes it easy to integrate together other
> systems which
> are not modular (or are modular but dont have the modules I want).  For
> instance, I am using PHPSlash, YapBB (forums) and PHPShop but there's  no
> easy way to make them all work together seamlessly, each one has its own
> authentication and session handling, its own database, etc.
>
> It would be nice to have a modular API that a completely stand alone
> application (like any of three I mentioned) could adhere to, that wouldnt
> limit the application in any demanding way, but would allow the
> application
> to also be a module working with any other compliant app.
>
> For instance, forums applications -- most that I've seen are stand alone
> systems.  That's fine, but what if I want a forum as a module inside of
> something like PHPSlash or PHPNuke?  I could take a forums
> package, probably
> do some pretty extensive mods to it like merging its database
> with my chosen
> "parent" app, replace its authentication and user system, etc,
> and make it a
> module.  I've seen requests for such things, "how about a module for
> PHPNuke?".  Then what?  What if you decide you really wanted it
> to work with
> PHPSlash instead?  Start all over!
>
> Everybody has their own idea of how a modular system should be structured,
> generaly tailored for the application they want to use it in.
> Other people
> might not want to write their apps using that system because they
> dont want
> to be tied to it, or dont want all the other baggage of the application
> coming along for the ride when they just want the modularity part.
>
> phpshop core looks interesting but its not quite what I'm thinking of, I
> think.
>
> I am currently working on such a system that would make it easy to adapt
> existing applications to be modules with a minimum of modification.  Its
> more of an API and a "shell" or "glue" rather than a complete application.
>
> I dont know if I am truly getting across my idea, but I thought I'd try to
> throw it out there for consideration.
>
> "Jaxon" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > thanks, but i'm looking for feedback on modular systems and
> shopping cart
> > engines, not an IDE.
> > vi works fine for me, at least for now :)
> >
> > cheers,
> > jaxon
> >
> > > -Original Message-
> > > From: Rick Emery [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, January 30, 2002 12:58 PM
> > > To: '[EMAIL PROTECTED]'; PHP
> > > Subject: RE: [PHP] curious - any phpshop/core users?
> > >
> >

RE: [PHP] curious - any phpshop/core users?

2002-01-30 Thread Jaxon

thanks, but i'm looking for feedback on modular systems and shopping cart
engines, not an IDE.
vi works fine for me, at least for now :)

cheers,
jaxon

> -Original Message-
> From: Rick Emery [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 30, 2002 12:58 PM
> To: '[EMAIL PROTECTED]'; PHP
> Subject: RE: [PHP] curious - any phpshop/core users?
>
>
> I use PHP Coder.  It's an excellent IDE and it's free..
>
> -Original Message-
> From: Jaxon [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 30, 2002 11:46 AM
> To: PHP
> Subject: [PHP] curious - any phpshop/core users?
>
>
> hi,
>
> has anyone used PHPShop and Core (www.phpshop.org) ??
> i'm thinking about using it for a project and wanted to know if it's
> actually any good :)
>
> cheers,
> jaxon
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>



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




[PHP] curious - any phpshop/core users?

2002-01-30 Thread Jaxon

hi,

has anyone used PHPShop and Core (www.phpshop.org) ??
i'm thinking about using it for a project and wanted to know if it's
actually any good :)

cheers,
jaxon



-- 
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] shopping cart reviews?

2002-01-15 Thread Jaxon

hi,

can anyone point me at a set of reviews for various php-based shopping
carts?

cheers,
jaxon



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

2001-12-11 Thread Jaxon

how about a python?
oh wait...


> -Original Message-
> From: Hugh Danaher [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 11, 2001 3:34 PM
> To: Dan McCullough
> Cc: Php-General
> Subject: Re: [PHP] Logo proposal
>
>
> How about a porpoise.  They're fast, intelligent, and as Lewis Carol said,
> "you shouldn't go anywhere without a porpoise."
> - Original Message -
> From: Dan McCullough <[EMAIL PROTECTED]>
> To: PHP General List <[EMAIL PROTECTED]>
> Sent: Tuesday, December 11, 2001 11:38 AM
> Subject: RE: [PHP] Logo proposal
>
>
> > But for the use of visualization you might want to pick
> something friendly
> and fast, so they think
> > of PHP in that way, instead of strange and slow.
> > --- Andrew Chase <[EMAIL PROTECTED]> wrote:
> > > Maybe an animal beginning with "P" would be a good Mnemonic
> device (and
> good
> > > for alliteration; think "The PHP Panda" or "The PHP
> Platypus".)  Hmm, I
> > > guess Panda and Platypus aren't particularly "powerful"
> animals, though.
> :/
> > >
> > > Other animals beginning with "P":
> > >
> > > Pelican
> > > Panther (cheesy)
> > > Polliwog
> > > Protozoa
> > >
> > > Of course, the Penguin is already spoken for. :)
> > >
> > > Personally, I don't have a problem with the current PHP logo... From a
> > > marketing standpoint, I don't know; has MySQL become a more attractive
> > > prospect to the pointy haired bosses of the world since they
> streamlined
> > > their logo and added a Dolphin?  It would be interesting to know.
> > >
> > > If PHP was going to adopt a mascot, I kinda like the idea of the
> Platypus.
> > > If you want to force a metaphor, think of PHP as an
> interesting language
> > > that fits between traditional scripting languages and the
> HTTP server -
> sort
> > > of like the Platypus is an interesting critter that fits somewhere
> between
> > > mammal and.. whatever else. :)
> > >
> > > -Andy
> > >
> > >
> > > > -Original Message-
> > > > From: Tim Ward [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, December 11, 2001 2:02 AM
> > > > To: PHP; Valentin V. Petruchek
> > > > Subject: RE: [PHP] Logo proposal
> > > >
> > > >
> > > > Chinchillas are fluffy, and I don't think anyone is using them for
> their
> > > > logo.
> > > >
> > > > --
> > > > From:  Valentin V. Petruchek [SMTP:[EMAIL PROTECTED]]
> > > > Sent:  10 December 2001 16:58
> > > > To:  PHP
> > > > Subject:  [PHP] Logo proposal
> > > >
> > > > Hello world of php-programmers!
> > > >
> > > > It seemes to me PHP is very powerful tool and very popular among
> > > > web-programmers, too. As for me I use php for solving web tasks for
> > > > 2 years
> > > > and I'm very satisfied with it.
> > > >
> > > > It seemes to me current PHP logo (can be found by
> > > > http://www.php.net/gifs/logo.gif) doesn't suite to PHP. It's common
> > > > logo
> > > > without any idea except using title in it.
> > > >
> > > > I propose to create and develop new PHP logo corresponding to its
> > > > power.
> > > >
> > > > My propose is WoodPecker (e.g. like Woody).
> > > >
> > > > Other propositions?
> > > >
> > > > Respectfully, Zliy Pes http://www.zliypes.com.ua
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > 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]
> > >
> >
> >
> > =
> > dan mccullough
> > 
> > "Theres no such thing as a problem unless the servers are on fire!"
> >
> >
> > __
> > Do You Yahoo!?
> > Check out Yahoo! Shopping and Yahoo! Auctions for all of
> > your unique holiday gifts! Buy at http://shopping.yahoo.com
> > or bid at http://auctions.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>



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




[PHP] ODBC version of PHPMyAdmin?

2001-10-05 Thread Jaxon

Hi,

Has anyone seen an ODBC version of PHPMyAdmin, or something similar; I want
to use it with more than just MySQL (e.g. Postgres and SQLServer)

Cheers,
Jaxon



-- 
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: passing args to function?

2001-09-10 Thread Jaxon

ah! thanks Moody.
silly jaxon, kicks are for trids.

cheers,
j

> -Original Message-
> From: Moody [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 10, 2001 1:01 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: passing args to function?
> 
> 
> > I'm having a bit of a hard time passing in a constant to a user-defined
> > function.
> >
> > the calling page - index.php:
> > 
> >  > include define_foo.php;
> > function_foo(bar);
>   ^
> should be:
>foo("bar");
> 
> [snip]
> 
> >  > function foo($value)
> > {
> > global $value, $page_id, $usr, $pass, $database, $host;
>^
> No need to declare $value as global . Already passed as arg
> 
> [snip]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

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




[PHP] passing args to function?

2001-09-10 Thread Jaxon

Hi,

I'm having a bit of a hard time passing in a constant to a user-defined
function.

the calling page - index.php:




define_foo.php:
$titleblock";

if (is_null($result)) break;

//iterate through array, outputting info based on value type
if ($value != "bar")
{
while (list ($text, $link) = mysql_fetch_row ($result))
{
echo "$text";
}
}
elseif ($value ="eek")
{
while (list ($text, $link) = mysql_fetch_row ($result))
{
echo "$text";
}
}
}
?>

any pointers much appreciated!!!

cheers,
jaxon


-- 
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] parse error AFTER end of included file??

2001-08-28 Thread Jaxon

doh!  

thanks for spotting that Kirk!

cheers,
j


> -Original Message-
> From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 11:49 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] parse error AFTER end of included file??
> 
> 
> You need to close off this bit of code with a brace '}':
> 
> if (!isset($page_id))
> {
> 
> Kirk
> 
> > -Original Message-
> > From: Jaxon [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 28, 2001 9:34 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] parse error AFTER end of included file??
> > 
> > 
> > Hi,
> > 
> > Can anyone tell me why I have a parse error here?
> > 
> > I'm including this file, which is 16 lines, but the error 
> > being thrown by
> > the including page reports a parse error in this file on line 17 ???:
> >  > if (!isset($page_type))
> > {
> > $page_type = "foo";
> > }
> > 
> > if (!isset($page_id))
> > {
> > $sql="select page_id from table where fieldname = $value";
> > $link_id = mysql_connect($host, $usr, $pass) or die 
> > (mysql_error());
> > mysql_select_db($database, $link_id); //select 
> > database catalog
> > $result = mysql_query ($sql, $link_id) or die (mysql_error());
> > //return result set to php
> > if (!$result) echo "wait - no result set!";
> > 
> > $page_id = mysql_result($result, 0, fieldname);
> > ?>
> > 
> > cheers,
> > jaxon
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

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




[PHP] parse error AFTER end of included file??

2001-08-28 Thread Jaxon

Hi,

Can anyone tell me why I have a parse error here?

I'm including this file, which is 16 lines, but the error being thrown by
the including page reports a parse error in this file on line 17 ???:


cheers,
jaxon


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




RE: [PHP] fatal input in flex scanner

2001-08-27 Thread Jaxon

New version, but it's CGI :(
It's causing all sorts of problems.

Thanks for the help, but I've killed this method in favor of including a
file that includes the files :)

best,
jaxon

> -Original Message-
> From: Robert V. Zwink [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 27, 2001 2:08 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] fatal input in flex scanner
>
>
> This line seems a little odd:
> $files_to_include[count($files_to_include)] = $file;
>
> I would change it to:
> $files_to_include[] = $file;
>
> Could be a bit of a bug.  I am able to run your script on my
> server, so the
> error could also be coming from one of the files you are trying
> to include.
> Are you running an old version of php?
>
> Robert V. Zwink
> http://www.zwink.net/daid.php
>
> -Original Message-
> From: Jaxon [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 24, 2001 11:29 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] fatal input in flex scanner
>
>
> okay... I have a function that includes multiple files in a directory - it
> was working but I changed something and I'm now getting a "Fatal error:
> input in flex scanner failed"
>
> can anyone see where I messed up?
>
> cheers,
> jaxon
> ---
> function group_include($directory)
> {
> $handle=opendir("$directory");
> while ($file = readdir($handle))
> { //load files in $directory into array
> if  ($file != ".." && $file != ".")
> {
> $files_to_include[count($files_to_include)] = $file;
> }
> }
>
> //clean up and sort
> closedir($handle);
> if (is_array($files_to_include))
> {
> while (list ($key, $val) = each ($files_to_include))
> {
> include "$directory/$val";
> }
> }
> }
>
> //include common and page specific modules
>
> $common_include_dir="modules/common";
> $page_include_dir="modules/page";
>
> group_include($common_include_dir);
> group_include($page_include_dir);
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




RE: [PHP] Error while passing parameters as path

2001-08-27 Thread Jaxon

I've also been having problems with trying to pass parameters in the path,
using PHP as a CGI.  I would hate to go into production with this site with
page.php?query=value&query2=value2 type of URL's, but I've not been able to
find a way to get page.php/value/value2 to work (throws Premature end of
script headers).

If anyone has ANY suggestions about how to get this working with the CGI
version, it would be most appreciated! :)

cheers,
jaxon

> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 26, 2001 9:07 AM
> To: Anas Mughal
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Error while passing parameters as path
>
>
> > Actually, I need to run as CGI because I have customized
> extensiont to PHP
> > that my hosting company will not imbed in their PHP-Apache module. I am
> > totally fine with that.
>
> Why don't you just dl() your extension into the module version?
>
> > Bottom line is that I need to run PHP as CGI.
> >
> > Is there a way for this work in that mode?
>
> I dunno.  Has been so long since I have used the CGI version for direct
> web stuff.  Play with it and figure it out.
>
> -Rasmus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




[PHP] fatal input in flex scanner

2001-08-24 Thread Jaxon

okay... I have a function that includes multiple files in a directory - it
was working but I changed something and I'm now getting a "Fatal error:
input in flex scanner failed"

can anyone see where I messed up?

cheers,
jaxon
---
function group_include($directory)
{
$handle=opendir("$directory");
while ($file = readdir($handle))
{ //load files in $directory into array
if  ($file != ".." && $file != ".")
{
$files_to_include[count($files_to_include)] = $file;
}
}

//clean up and sort
closedir($handle);
if (is_array($files_to_include))
{
while (list ($key, $val) = each ($files_to_include))
{
include "$directory/$val";
}
}
}

//include common and page specific modules

$common_include_dir="modules/common";
$page_include_dir="modules/page";

group_include($common_include_dir);
group_include($page_include_dir);


-- 
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] parse_url and cgi?

2001-08-23 Thread Jaxon

can someone answer the question - does parse_url in fact NOT work when using
PHP as a cgi?
i'm unable to make it work, and getting different answers from my isp, etc.

cheers,
jaxon


-- 
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: help, weird include problem with functions

2001-08-10 Thread Jaxon

Renze,

I found that it works if I pass only a variable or a path in, not both.

e.g.opendir("/path/to/foo") works
opendir("$variable") where variable contains "path/to/foo" also works
opendir("$somevar/some/path") does NOT work.

go figure.

cheers,
jaxon

> -Original Message-
> From: Renze Munnik [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 10, 2001 4:06 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] RE: help, weird include problem with functions
>
>
> On Thu, Aug 09, 2001 at 02:05:24PM -0400, Jaxon wrote:
> > yes, I'm sure the directory exists :)
> >
> > here is the actual code, I suppose this would have been more helpful to
> > start:
> >
> >  > function incl_common()
> > {
> > global $modroot; //modroot is defined as http://localhost/modules in a
> > settings file
> >
> > echo "$modroot from included"; //this echos
> "http://localhost/modules";
> > properly
> >
> >
> > //the below throws the error, OpenDir: No such file or
> directory (error 2)
> > in (this function file name)
> > //but I can replce the $modroot/common with a hard-coded path
> and it works
> > fine.
> >
> > $handle=opendir("$modroot/common");
> > while ($file = readdir($handle))
> > { //load files in $directory into array
> > if  ($file != ".." && $file != ".")
> > {
> > $files_to_include[count($files_to_include)] = $file;
> > }
> > }
> >
> > //clean up and sort
> > closedir($handle);
> > if (is_array($files_to_include))
> > {
> > while (list ($key, $val) = each ($files_to_include))
> > {
> > include "$modroot/common/$val";
> > }
> > }
> > }
> > incl_common();
> > ?>
>
> Well... Actualy I can't find anything about opening URL's with
> opendir(). Is it even possible? I don't think so. But if is it, I'd
> check this:
>
> - Is the directory readable for the webserver?
> - Does your webserver allow this kind of actions? I'd say it's a bit
>   of a security leak if anyone can just directly execute an
>   opendir() (and then ofcourse also a readdir()) on your directories
>   from a remote server.
>
> But anyway, I don't know if it's possible to do an opendir() on an
> URL. I've tried your example on my on server and I can't get it to
> work unless I give the actual directory instead of the URL.
>
> --
>
> * R&zE:
>
> -- 
> -- Renze Munnik
> -- DataLink BV
> --
> -- E: [EMAIL PROTECTED]
> -- W: +31 23 5326162
> -- F: +31 23 5322144
> -- M: +31 6 21811143
> -- H: +31 23 5516190
> --
> -- Stationsplein 82
> -- 2011 LM  HAARLEM
> --
> -- http://www.datalink.nl
> -- 
>


-- 
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: help, weird include problem with functions

2001-08-09 Thread Jaxon

yes, I'm sure the directory exists :)

here is the actual code, I suppose this would have been more helpful to
start:

http://localhost/modules in a
settings file

echo "$modroot from included"; //this echos "http://localhost/modules";
properly


//the below throws the error, OpenDir: No such file or directory (error 2)
in (this function file name)
//but I can replce the $modroot/common with a hard-coded path and it works
fine.

$handle=opendir("$modroot/common");
while ($file = readdir($handle))
{ //load files in $directory into array
if  ($file != ".." && $file != ".")
{
$files_to_include[count($files_to_include)] = $file;
}
}

//clean up and sort
closedir($handle);
if (is_array($files_to_include))
{
while (list ($key, $val) = each ($files_to_include))
{
include "$modroot/common/$val";
}
}
}
incl_common();
?>


-- 
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: help, weird include problem with functions

2001-08-09 Thread Jaxon

hmm...yes, it does work, I jumped the gun on the simple example, cuz I
thought it was an echo problem..
my un-simplified example has an opendir() in function foo() file.


function.php is:


so the simple example does indeed work, but the opendir() is choking trying
to deal with the variable.

hmmm...

jaxon

> -Original Message-
> From: Renze Munnik [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 09, 2001 1:06 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] RE: help, weird include problem with functions
>
>
> On Thu, Aug 09, 2001 at 12:48:38PM -0400, Jaxon wrote:
> > oh, this still happens when I fix the missing () in the foo
> declaration :)
> >
> > cheers,
> > jaxon
> >
>
>
> Works fine, no problems at all!
>

>
>


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




[PHP] RE: help, weird include problem with functions

2001-08-09 Thread Jaxon

oh, this still happens when I fix the missing () in the foo declaration :)

cheers,
jaxon

> -Original Message-
> From: Jaxon [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 09, 2001 12:34 PM
> To: [EMAIL PROTECTED]
> Subject: help, weird include problem with functions
> 
> 
> 
> can anyone tell me why this doesn't work??
> assuming I have these three files:
> 
> settings.php is:
> 
> 
> page.php is:
>require("settings.php"); 
>   echo "$bar from page.php"; //this works!!!
>   include "function.php";
> ?>
> 
> 
> function.php is:
>function foo{
>   global $bar;
>   echo "$bar from foo"; //this does not work!!!
>   }
>   foo();
> ?>
> 
> for some reason the $bar in function foo() doesn't have a value... :(
> calling page.php only returns the $bar from page.php
> 
> thanks in advance!
> jaxon
> 

-- 
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] help, weird include problem with functions

2001-08-09 Thread Jaxon


can anyone tell me why this doesn't work??
assuming I have these three files:

settings.php is:


page.php is:



function.php is:


for some reason the $bar in function foo() doesn't have a value... :(
calling page.php only returns the $bar from page.php

thanks in advance!
jaxon


-- 
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] in_array() with associate array?

2001-07-31 Thread Jaxon

hi,

in_array is confusing me :)

can someone show me an example of how to test if 

$some_array[some_key]

actually has a value, without outputting the value?

tia,
jaxon


-- 
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] array from mysql help?

2001-07-24 Thread Jaxon

Hi,

I want to create an array like this:

$tree = array (
"first"  => array ("stuff1", "stuff2", "stuff3"),
"second" => array ("stuff1", "stuff2")
);


based on tree of information, stored in a database table:

level parent_cat child_cat
--
1   first   first
1   second  second
2   first   stuff1
2   first   stuff2
2   first   stuff3
2   second  stuff1
2   second  stuff2


That translates to a structure like this:


   firstsecond
 | |
 |-||  |---|
stuff1  stuff2  stuff3  stuff1  stuff2


Can someone point me towards an SQL example that would help me structure the
query, and an example of how to reference information in it once I have it?
e.g. a while list/each but for a multidimensional array?

cheers,
jaxon.


-- 
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] count number of form fields?

2001-07-13 Thread Jaxon

Hi,

Can someone give me an example of how to count the number of form fields
entered?
E.g. let's say I have three dropdown lists, the first is mandatory, and the
second two are optional.
I want to be able to tell my target php script how many of the dropdowns are
populated.

thanks in advance!
jaxon


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




RE: [PHP] PHP authenticating and session management

2001-06-22 Thread Jaxon

Does this depend on cookies?

regards,
jaxon


> -Original Message-
> From: Style|warrioR [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 22, 2001 5:09 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP authenticating and session management
>
>
> I'm not quite sure if this is the perfect way cause I'm pretty new to this
> session stuff, too.
> but my version looks like this:
>
> [login.php]
> a form with username and password field.
> submit --> auth.php
>
>
> [auth.php]
> check if username and password are ok (from a text file or your mysql
> database) [yes|no]
> [no] -> echo "bad login or password."; exit;
> [yes] -> start a session, save username and password in session vars,
> redirect to userpage
>
>
> lets say your userpages look like "aUsername_blah.php"
>
>
> ["aUsername_blah.php"]
> include a script on every userpage that checks if login and password are
> correct [yes|no]
> [no] -> redirect to login.php
> [yes] -> display page
>
>
> comments appreciated :)
> .andi
>
>
>
>
>
>
> "Arash Dejkam" <[EMAIL PROTECTED]> schrieb in im Newsbeitrag:
> 9guhbf$msi$[EMAIL PROTECTED]
> > Hi,
> >
> > I want to use PHP session manager but I have some problems,
> >
> > I want the session start in a login page so I do this for example:
> >
> > after authenticating...
> > session_start();
> > session_register("username");
> >
> > then I want the user to be able to see his own pages, what do I
> have to do
> > in those pages?
> >
> > simply check $username and bring up the user's page ? but this makes it
> > possible for any hacker to send a cookie with username and see
> that page.
> I
> > know that PHP stores a unique random number for each session
> but how can I
> > check that it matches with the number in the cookie.
> >
> > help me please I'm really confused !
> >
> > Thanks
> >
> > Arash Dejkam
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




RE: [PHP] DOCUMENT_ROOT

2001-04-25 Thread Jaxon

Not to beat a dead horse, but assuming a site structure like this:

/htdocs
/htdocs/modules
/htdocs/includes
/htdocs/templates

where all my PHP logic scripts are in htdocs, and all the bits and pieces
are in the other dirs, is there any way to set include_path to:

$include_path = "$DOCUMENT_ROOT/config; $DOCUMENT_ROOT/includes;
$DOCUMENT_ROOT/templates;"

so I can just include("filename.inc.php"); where ever I am in my structure,
without worrying about putting in a relative or absolute path, AND do this
without altering the php.ini?? (cuz I may not have access to it in a shared
hosting env)

cheers,
jaxon



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

2001-04-23 Thread Jaxon

Hmm...

Is there any way to set something like include_path on the fly, so you just
define all your possible direcories at once in what is essential a 'site
environment' variable, and then you can include/require your files without
putting any path info in?

regards,
jaxon

> -Original Message-
> From: Toby Miller [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 23, 2001 3:44 PM
> To: indrek siitan
> Cc: PHP General Mailing List
> Subject: Re: [PHP] Site Structure
>
>
> While it is true that you don't have to put your files in the web
> directory
> at all and it is a more secure option there is still one very large
> inconvenience that prevents me from going with that option. You lose the
> usefulness of just including
> "$DOCUMENT_ROOT/yourfolder/yourfilename". This
> is the main reason that I do put my files in the root web
> directory. So how
> do you tell all of your files where your included content is? Do you hard
> code the path in every page? If so, do you also have development,
> stage, and
> live environments that mimic the exact same directory structures?
> If not, do
> you always change the include strings by hand every time you move from one
> environment to another? Do you run into these problems? What kind of
> solutions/workarounds have you implemented?
>
> I have always used this style of including documents because it enables me
> to do my mockup ideas on my Windows machine with PWS. Then I can move onto
> my Linux test box and try the site in my home account. Then I can push the
> exact same code to the dev server which uses www as the root web
> directory.
> Then I can push the exact same code to the staging server for
> clients to see
> which has wwwroot as the root web directory and the live
> environment mimics
> the stage environment so that move makes little to no difference. Now if
> someone else was working on the same project and checked the files out of
> CVS they would have to tweak their copy to work in their special
> environment
> instead of just running and developing the files. This just seems like a
> whole lot of extra work to me. Correct me if I'm wrong, but the only way
> anyone can see the source code of a php file if the extension is
> associated
> with the PHP interpreter is if you provide a phps file that they
> can see or
> if someone uninstalls the PHP interpreter (which bypasses the situation
> because the first condition is no longer being met).
>
> I'm really curious to see how other developers handle these kind of
> development situations.
>
> - Original Message -
> From: "indrek siitan" <[EMAIL PROTECTED]>
> To: "Toby Miller" <[EMAIL PROTECTED]>; "Jordan Elver"
> <[EMAIL PROTECTED]>
> Cc: "PHP General Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, April 23, 2001 1:22 PM
> Subject: RE: [PHP] Site Structure
>
>
> > Hi,
> >
> > > Also, it's not a good idea to use the .inc extension unless you've
> > > associated it with PHP. The reason is if I type the URL directly to
> > > /includes/header.inc I will get the source code for that file in text
> > > format.
> >
> > you don't have to keep your .inc files in the web server document
> > root folder at all...
> >
> >
> > Rgds,
> >   Tfr
> >
> >  --==< [EMAIL PROTECTED] >==< MySQL development team >==< Tallinn / Estonia
> >==--
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




[PHP] store array in a file?

2001-04-15 Thread jaxon


Hey all, can someone make a recommendation here?

I want to keep site structural info pulled from a database in an array, and
store it in a flat file that can eliminate the database hit.

Then I'll just delete the file when structure changes, and regenerate it
with a call to a recreation script that does the necessary sql once.

So 
 - does this make sense?
 - how to sore the array in a flat file
 - any way to make the array global once loaded?

Thanks for any pointers!

cheers,
jaxon


-- 
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] new php.net look

2001-04-07 Thread jaxon

> The older look was neat to show off to people re: pop up menus, etc.,
> but this is
> a real speed demon, and will be much more useful for searching around.

Speaking of which - there used to be a little HOWTO for doing those kind of
popups - does anyone know where it has gone to?

regards,
jaxon



> 
> Thanks again!
> 
> 


-- 
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] new php.net look

2001-04-07 Thread jaxon

> The older look was neat to show off to people re: pop up menus, etc.,
> but this is
> a real speed demon, and will be much more useful for searching around.

Speaking of which - there used to be a little HOWTO for doing those kind of
popups - does anyone know where it has gone to?

regards,
jaxon



> 
> Thanks again!
> 
> 


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

2001-03-25 Thread Jaxon

whups, sorry - here is the example:

I want to turn URI's like:

/script.php/main/index.html?junk=junk
/script.php/main/index.html//
/script.php/main/index.html??

all into:

/script.php/main/index.html

best regards,
jaxon

On 3/25/01 9:25 PM, "Aaron Tuller" <[EMAIL PROTECTED]> wrote:

> why can't you str_replace the $QUERY_STRING frm the $REQUEST_URI?
> 
> give an example of what you are trying to do?  (I'm sorry if you did
> and I missed it)
> 
> -aaron
> 
> At 9:06 PM -0500 3/25/01, Jaxon wrote:
>> K, read em all, and understood more than I thought I :)
>> 
>> 
>> I still don't see how you can 'sanitize' a URI, eg discard anything
>> including and after "//" or "??".  I think this is needed if you want to
>> discard a query string or irregular syntax from your URI.
>> 
>> ereg's don't work reliably, due to the possibility of special chars in the
>> URI.
>> 
>> regards,
>> jaxon
>> 
>> On 3/25/01 3:18 PM, "Philip Olson" <[EMAIL PROTECTED]> wrote:
>> 
>>>  Hi!
>>> 
>>>  Check out these two related articles (and user comments) :
>>> 
>>>  Building Dynamic Pages With Search Engines in Mind :
>>>  
>>>* http://phpbuilder.com/columns/tim19990117.php3
>>>* http://phpbuilder.com/columns/tim2526.php3
>>> 
>>>  Also check phpinfo() for available predefined variables and plan
>>>  accordingly.
>>> 
>>>  Predefined Variables   :
>>>  
>>>* http://www.php.net/manual/en/language.variables.predefined.php
>>> 
>>>  And for the brave, check out mod_rewrite :
>>> 
>>>  Mod-Rewrite:
>>>  
>>>* http://httpd.apache.org/docs/mod/mod_rewrite.html
>>>* http://www.engelschall.com/pw/apache/rewriteguide/
>>>* http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite
>>> 
>>> 
>>>  Regards,
>>> 
>>>  Philip Olson
>>>  http://www.cornado.com/
>>> 
>>> 
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


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




Re: [PHP] URL parsing

2001-03-25 Thread Jaxon

K, read em all, and understood more than I thought I :)


I still don't see how you can 'sanitize' a URI, eg discard anything
including and after "//" or "??".  I think this is needed if you want to
discard a query string or irregular syntax from your URI.

ereg's don't work reliably, due to the possibility of special chars in the
URI.

regards,
jaxon

On 3/25/01 3:18 PM, "Philip Olson" <[EMAIL PROTECTED]> wrote:

> Hi!
> 
> Check out these two related articles (and user comments) :
> 
> Building Dynamic Pages With Search Engines in Mind :
> 
>   * http://phpbuilder.com/columns/tim19990117.php3
>   * http://phpbuilder.com/columns/tim2526.php3
> 
> Also check phpinfo() for available predefined variables and plan
> accordingly.
> 
> Predefined Variables   :
> 
>   * http://www.php.net/manual/en/language.variables.predefined.php
> 
> And for the brave, check out mod_rewrite :
> 
> Mod-Rewrite:
> 
>   * http://httpd.apache.org/docs/mod/mod_rewrite.html
>   * http://www.engelschall.com/pw/apache/rewriteguide/
>   * http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite
> 
> 
> Regards,
> 
> Philip Olson
> http://www.cornado.com/
> 
> 


-- 
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] A few questions...

2001-03-25 Thread Jaxon

while a bit ugly, you could just use array_pop() to get each item into a
variable and then echo them back out into your variable assignment...

somewhat cleaner would be to create an assoc array of config vars:

$uri_items_num=count($path_array);
for ($i=1, $i <= $uri_items_num, $i++)
{
$key=array_pop($path_array);
$value=array_pop($path_array);
config_array[$key] = $value
}

or something.

regards,
jaxon

On 3/25/01 6:54 PM, "Chris Cocuzzo" <[EMAIL PROTECTED]> wrote:

> right. ok I understand that explode function. But what I'm asking is not so
> much once I have a URL in the form of /something/something/something
> ...etc.., but more if I have a URL like /something?d=a&f=g, to make it like
> /something/d/a/f/g  ... do you know what I mean?
> 
> 
> Chris
> 
> -Original Message-
> From: Jaxon [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 25, 2001 6:32 PM
> To: [EMAIL PROTECTED]; PHP General List (E-mail)
> Subject: Re: [PHP] A few questions...
> 
> 
> Chris,
> 
>> I think I just slightly unsure of how that explode() function works in
> this
>> situation...could you clarify further?
>> 
>>> 
>>> $path_array = explode('/', $REQUEST_URI);
>>> 
>>> $last_item  =   array_pop($path_array);
>>> $next_to_last_item  =   array_pop($path_array); / item
>>> 
> $REQUEST_URI contains the non-domin path (the URI) - it's a predefined
> variable like $PHP_SELF, etc
> 
> http://www.php.net/manual/en/language.variables.predefined.php
> 
> in this explode() example, the '/' is the devider, so if you have
> 
> http://www.somedomain.com/dir1/dir2/dir3/somepage3.php
> 
> The URI is: /dir1/dir2/dir3/somepage3.php
> 
> and 'exploding' divides that into array elements (dir1, dir2, dir3,
> somepage.php)
> 
> regards,
> jaxon
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


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




Re: [PHP] A few questions...

2001-03-25 Thread Jaxon

Chris,

> I think I just slightly unsure of how that explode() function works in this
> situation...could you clarify further?
> 
>> 
>> $path_array = explode('/', $REQUEST_URI);
>> 
>> $last_item  =   array_pop($path_array);
>> $next_to_last_item  =   array_pop($path_array); / item
>> 
$REQUEST_URI contains the non-domin path (the URI) - it's a predefined
variable like $PHP_SELF, etc

http://www.php.net/manual/en/language.variables.predefined.php

in this explode() example, the '/' is the devider, so if you have

http://www.somedomain.com/dir1/dir2/dir3/somepage3.php

The URI is: /dir1/dir2/dir3/somepage3.php

and 'exploding' divides that into array elements (dir1, dir2, dir3,
somepage.php)

regards,
jaxon


-- 
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] Requesting username/pwd with apache and aqcuiring input

2001-03-25 Thread Jaxon

check this out:
http://www.zend.com/zend/tut/authentication.php

regards,
jaxon


On 3/25/01 5:59 PM, "NoSpeed" <[EMAIL PROTECTED]> wrote:

> Hi
> 
> I wondered if it was possible in PHP to let it pop up a screen which
> reqcuires username/pwd from the visitor, just like you can tell apache to do
> so with the .htaccess files.
> 
> And if yes, how to retrieve the input from the user ?
> 
> --
> - NoSpeed
> --
> - Carpe Noctem
> 
> "The stickers on the side of the box said "Supported Platforms: Windows 98,
> Windows NT 4.0, Windows 2000 or better", so clearly Linux was a 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]




Re: [PHP] A few questions...

2001-03-25 Thread Jaxon

Chris,

a few answers :)

On 3/25/01 5:43 PM, "Chris Cocuzzo" <[EMAIL PROTECTED]> wrote:

> hey-
> 
> Alright I noticed that question about URL parsing. I could've sworn I saw
> some article on PHPBuilder.com that said that instead of doing all that
> modifying with apache, you could simply write something to change the URL
> with '?' and '&' and '=' so that they symbols could be represented using a
> simple /, does anyone remember seeing it?...

dunno - think it's in the php.ini?
> 
> In any case, I'll ask, what would be the best way to do this with
> scripting, something like str_replace() or perhaps a regular expression to
> both modify the URL and then allow pages using that modified URL to
> recognized the variable/value pairs? Or is that even possible?

You could... I'm hacking through using:

$path_array = explode('/', $REQUEST_URI);

$last_item  =   array_pop($path_array);
$next_to_last_item  =   array_pop($path_array); / item

only drawback is the positional stuff is fixed.
now I am trying to figure out how to generate my hrefs in the page to have a
matching structure
> 
> My other question is this: Sometimes I notice URL's where it looks like
> this, http://www.whatever.com/?blah=blah&d=d, or
> http://www.whatever.com/local?name=name&d=d. How is that done, where there
> is no file extension after the file name, or no file name at all, just a
> question mark directly after the slash?

probably the a .htaccess  or apache.conf directive:

 
ForceType application/x-httpd-php3
 

This would send everything to a script called "local".
This is from: http://phpbuilder.com/columns/tim19990117.php3

hth,

regards,
jaxon
> 
> thanks
> Chris
> 


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

2001-03-25 Thread Jaxon

oops :)

http://www.domain.com/index.php/main/index.html?ii=1
versus
http://www.domain.com/index.php/main/index.html

I want to get "index.html" and "main" into variables, as the two items will
always be present - if $ii is set, I want to strip it from the URI before
parsing the items out.

I suppose with parse_url() I could do something..but I really only want to
deal with the URI.

currently, this seems to work:

$path_array = explode('/', $REQUEST_URI);

if (isset($ii))   array_pop($path_array); // remove $ii
$page_name  = array_pop($path_array); //get page name from end of array
$tpl= array_pop($path_array); //get page type from next item

but is inelegant :)

regards,
jaxon

> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Jaxon) wrote:
> 
>> Any way to combine both forms of url parsing?
>> I want to use standard slash notation for navigation ,but also account for
>> the occasional variable used within a single page.
>> 
>> e.g. URL can be either:
>> domain.com/index.php/main/index.html?ii=1
>> 
>> or: 
>> domain.com/index.php/main/index.html?ii=1
> 
> Umm, how are these different?
> 
> (If you're trying to extract info from a url, perhaps
> parse_url(),basename(), and/or dirname() are what you're seeking...?)


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

2001-03-25 Thread Jaxon

Any way to combine both forms of url parsing?
I want to use standard slash notation for navigation ,but also account for
the occasional variable used within a single page.

e.g. URL can be either:
domain.com/index.php/main/index.html?ii=1

or: 
domain.com/index.php/main/index.html?ii=1

if (isset($ii) // how do I grab value and truncate $REQUEST_URI

$path_array = explode('/', $REQUEST_URI);

$page_name  = array_pop($path_array); //get page name from end of array
$page_type  = array_pop($path_array); //get page type from next item

best regards,
jaxon


On 3/23/01 9:09 PM, "Aaron Tuller" <[EMAIL PROTECTED]> wrote:

> super easy.
> 
> $path_array = explode('/', $REQUEST_URI);
> $numPathElements = count($path_array);
> 
> then loop through the elements and do what you need, you might need
> to use strtok() if you're expecting slashes in your arguments.
> 
> -aaron
> 
> At 8:58 PM -0500 3/23/01, Jaxon wrote:
>> how about parsing a url from passing variables like :
>> test.php/op/3/op2/6/pagename.html
>> 
>> cannot this be parsed, to let search engines spider past the "?" properly?
>> 
>> regards,
>> jaxon


-- 
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] indirectly call function?

2001-03-24 Thread Jaxon


hi all, I'm trying to change which function is called at runtime:

e.g.
page1.php:

include "functions_def.inc.php"; //contains definition for mod_news()
$module = "mod_news()"; //for example - gets assigned by case statement
include page2.inc.php


page2.inc.php:




the page shows "mod_news()" instead of calling my function :(
It works if I use  but not if I'm trying to hold
the function name in the variable.

I've tried 




all to no avail.

any ideas?

tks!
jaxon
  


-- 
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] breadcrumbs? (Was: URL parsing)

2001-03-23 Thread Jaxon


could someone check this?

>From the URL parsing discussions, you should be able to do these two things
with a URL like this:
index.php/main/default/sitelevel1/sitelevel2/sitelevel3/name.html

1. set some page variables from the URL:

function page_init()
{
global $REQUEST_URI;
global $init_vars[];//array set in config file, eg.
//$init_vars[]="$tpl";
//$init_vars[]="$stylesheet";

$path_array = explode('/', $REQUEST_URI);

while (list ($init_key,$init_value) = each($init_var[]))
   {
list($uri_key, $uri_value) = each($path_array[])
$init_value = uri_value
   }
}

2. create a you-are-here thingy like:
sitelevel1 >> sitelevel2 >> sitelevel3 >> name.html

function breadcrumbs()
{
global $REQUEST_URI
global $init_depth; //how much of initial uri items to discard

$path_array = explode('/', $REQUEST_URI);

for ($i=0, $i <= $init_depth; $i++);
{
array_shift($path_array); //discard config item - not used here
}

$page_name = array_pop($path_array); //strip page name from end of array
$crumbs_length  = count($page_array); //how long is path now?
$crumbs_div = " >> "; //use to divide the breadcrumbs

for ($i=0, $i <= $crumbs_length; $i++);
{
list($position,  $value) = each($path_array);
echo $value;
echo $crumb_div;
}

echo($pagename);
}


now, anyone have any idea how to make each sitelevel item an href???

regards,
jaxon


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

2001-03-23 Thread Jaxon

Oh wait, just do this in my page :

URL -> index.php/main/1/pagename.html

$path_array = explode('/', $REQUEST_URI);
   
$tpl  =  $path_array[0];
$ii   =  $path_array[1];
$pagename =  $path_array[2];

that works - sorry for being obtuse.

regards,
jaxon


On 3/23/01 9:30 PM, "Jaxon" <[EMAIL PROTECTED]> wrote:

> 
> Well assuming that this:   index.php/tpl/main/ii/1/pagename/name.html
> is representative of this: index.php?tpl=main&ii=1$pagename=name.html
>   
> then:
>  
> $path_array = explode('/', $REQUEST_URI);
> $numPathElements = count($path_array);
> 
> gives me:
> 
> $path_array[0] = tpl
> $path_array[1] = main
> $path_array[2] = ii
> $path_array[3] = 1
> $path_array[4] = pagename
> $path_array[5] = name.html
> 
> But can I make that:
> 
> $path_array[tpl] = main
> $path_array[ii] = 1
> $path_array[pagename] = name.html
> 
> Instead?
> 
> I'm going to have to do this for every page, so I want to avoid much that
> would slow the page down - what do folks think?
> 
> regards,
> jaxon
> 
> 
> 
> 
> On 3/23/01 9:09 PM, "Aaron Tuller" <[EMAIL PROTECTED]> wrote:
> 
>> super easy.
>> 
>> $path_array = explode('/', $REQUEST_URI);
>> $numPathElements = count($path_array);
>> 
>> then loop through the elements and do what you need, you might need
>> to use strtok() if you're expecting slashes in your arguments.
>> 
>> -aaron
>> 
>> At 8:58 PM -0500 3/23/01, Jaxon wrote:
>>> how about parsing a url from passing variables like :
>>> test.php/op/3/op2/6/pagename.html
>>> 
>>> cannot this be parsed, to let search engines spider past the "?" properly?
>>> 
>>> regards,
>>> jaxon
>>> 
>>> On 3/23/01 7:46 PM, "Richard Lynch" <[EMAIL PROTECTED]> wrote:
>>> 
>>>>  I think you can change the separator in php.ini, and for sure you could do
>>>>  it by hand using $PATH_INFO or something.
>>>> 
>>>>  Personally, my first question would be if the new "standard" is actually
>>>>  being used or supported by anybody else...
>>>> 
>>>>  --
>>>>  Visit the Zend Store at http://www.zend.com/store/
>>>>  Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
>>>>  Volunteer a little time: http://chatmusic.com/volunteer.htm
>>>>  - Original Message -
>>>>  From: Dave Smith <[EMAIL PROTECTED]>
>>>>  Newsgroups: php.general
>>>>  Sent: Saturday, March 17, 2001 10:55 AM
>>>>  Subject: [PHP] URL parsing
>>>> 
>>>> 
>>>>>  I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
>>>>>  using the semi colon as a seperator. Is this currently supported by php
>>>>  4.0.3?
>>>>> 
>>>>>  Cheers
>>>>> 
>>>>>  Dave Smith
>> 
> 


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

2001-03-23 Thread Jaxon


Well assuming that this:   index.php/tpl/main/ii/1/pagename/name.html
is representative of this: index.php?tpl=main&ii=1$pagename=name.html

then:
   
$path_array = explode('/', $REQUEST_URI);
$numPathElements = count($path_array);

gives me:

$path_array[0] = tpl
$path_array[1] = main
$path_array[2] = ii
$path_array[3] = 1
$path_array[4] = pagename
$path_array[5] = name.html

But can I make that:

$path_array[tpl] = main
$path_array[ii] = 1
$path_array[pagename] = name.html

Instead?

I'm going to have to do this for every page, so I want to avoid much that
would slow the page down - what do folks think?

regards,
jaxon




On 3/23/01 9:09 PM, "Aaron Tuller" <[EMAIL PROTECTED]> wrote:

> super easy.
> 
> $path_array = explode('/', $REQUEST_URI);
> $numPathElements = count($path_array);
> 
> then loop through the elements and do what you need, you might need
> to use strtok() if you're expecting slashes in your arguments.
> 
> -aaron
> 
> At 8:58 PM -0500 3/23/01, Jaxon wrote:
>> how about parsing a url from passing variables like :
>> test.php/op/3/op2/6/pagename.html
>> 
>> cannot this be parsed, to let search engines spider past the "?" properly?
>> 
>> regards,
>> jaxon
>> 
>> On 3/23/01 7:46 PM, "Richard Lynch" <[EMAIL PROTECTED]> wrote:
>> 
>>>  I think you can change the separator in php.ini, and for sure you could do
>>>  it by hand using $PATH_INFO or something.
>>> 
>>>  Personally, my first question would be if the new "standard" is actually
>>>  being used or supported by anybody else...
>>> 
>>>  --
>>>  Visit the Zend Store at http://www.zend.com/store/
>>>  Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
>>>  Volunteer a little time: http://chatmusic.com/volunteer.htm
>>>  - Original Message -
>>>  From: Dave Smith <[EMAIL PROTECTED]>
>>>  Newsgroups: php.general
>>>  Sent: Saturday, March 17, 2001 10:55 AM
>>>  Subject: [PHP] URL parsing
>>> 
>>> 
>>>>  I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
>>>>  using the semi colon as a seperator. Is this currently supported by php
>>>  4.0.3?
>>>> 
>>>>  Cheers
>>>> 
>>>>  Dave Smith
>


-- 
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] quick array questions

2001-03-23 Thread Jaxon


can an array be stored in a database field?
E.g. make a few runtime settings for a page, store the settings as an array
in a field, and use that array to make some runtime settings?

Follow up to that question, can that array be persisted from page to page
without a cookie?

regards,
jaxon


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

2001-03-23 Thread Jaxon


how about parsing a url from passing variables like :
test.php/op/3/op2/6/pagename.html

cannot this be parsed, to let search engines spider past the "?" properly?

regards,
jaxon

On 3/23/01 7:46 PM, "Richard Lynch" <[EMAIL PROTECTED]> wrote:

> I think you can change the separator in php.ini, and for sure you could do
> it by hand using $PATH_INFO or something.
> 
> Personally, my first question would be if the new "standard" is actually
> being used or supported by anybody else...
> 
> --
> Visit the Zend Store at http://www.zend.com/store/
> Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> - Original Message -
> From: Dave Smith <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Sent: Saturday, March 17, 2001 10:55 AM
> Subject: [PHP] URL parsing
> 
> 
>> I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
>> using the semi colon as a seperator. Is this currently supported by php
> 4.0.3?
>> 
>> Cheers
>> 
>> Dave Smith
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
> 


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




Re: [PHP] Problem with cookies

2001-03-23 Thread Jaxon

Rob, 

perhaps some code?

regards,
jaxon


On 3/23/01 7:03 PM, "wx" <[EMAIL PROTECTED]> wrote:

> Hello:
> 
>   I've set up a authentication script in PHP, and have made it to where once
> the user has been successfully authenticated, it puts the username
> ($global[username]), password ($global[password]), and realname
> ($global[realname]) into a cookie. The included functions file
> (./inc/common.inc) does this, my problem is:
> 
>   Once it has been authenticated, the main page (index.php) goes through an if
> statement for the variable $authok, if $authok is "1", then display the main
> page, elseif $authok != 1, then display login, it displays the main page fine
> except, the realname and the username don't show up, until I reload the page
> and the realname and the username then show up. I don't understand why it is
> doing this. Please if you can, help me fix this.
> 
> Thanks a lot
> Rob Vella
> 


-- 
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] parse error inside comment????

2001-03-20 Thread Jaxon

Hi Gurus - any suggestions here would be welcome, I'm baffled.

I have a file that does this:



but when I call this file, it gives me a parse error in
function_definitions.php.  No biggie, so I start trying to figure out what
paren, quote, etc. I've forgotton, and I cannot.

The line that PHP is choking on is for a function that I'm not using in the
above page, so I comment it out, thinking to go back and rewrite it later
when I need it, and the parse error is still showing up on the same line

To summarize, a parse error is showing up on a file being 'required', even
if the lines in question are commented out.

thanks in advance for ANY pointers.

cheers!
jaxon


-- 
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] Replace a string in array then re-write line.

2001-03-08 Thread Jaxon

Jon,

I've done something similar with strtr(), pulling the array from a database
and swapping the result set into a file.

$fd = fopen ($file, "r");
$string = fread ($fd, filesize ($template));
fclose ($fd);

$array = mysql_fetch_array($result, MYSQL_ASSOC);
echo (strtr($string, $array));

just my .02:

regards,
jaxon




On 3/8/01 10:53 PM, "enthalpy" <[EMAIL PROTECTED]> wrote:

> 
> ok so im using fopen to read a file split each line in to an array. Check
> those variables against the same situation with a different file. Replace
> a string in the second file with a string in the first file. Then rewrite
> the line with the new variable.
> 
> here is a small example of how im opening and exploding the lines
> 
> $fpoint1 = fopen ($newfile,"r") or die("couldnt open working file");
> while ($data = fgetcsv ($fpoint1, $newfilesize, " ")) {
> $num = count ($data);
> echo "$num fields in line $row: \n";
> for ($c=0; $c<$num; $c++) {
> 
> }
> 
> im opening the second file the same way and if data[0] and data2[0] are =
> then it will replace the strings.
> 
> anyway if i made any sense at all i think you will know what im talking
> about.
> 
> <-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]




Re: [PHP] HREFs that can't be

2001-03-01 Thread Jaxon

Hi Chris,

For my own edification, how are you creating the links dynamically - I need
to do something similar ..?

As far as removing GET variables, you could just flag variables in a
database, that would eliminate the majority of the inter-page stuff.

You would still need to leave one session on the client, though...

hth,
jaxon

On 3/1/01 9:37 PM, "Boget, Chris" <[EMAIL PROTECTED]> wrote:

> I know I've been posing some funky wierd questions
> all day, but today has just been one of those days...
> I'm just trying to get a sense of other possibilities.
> And to find out what's plausable and what's not.
> 
> Ok, here's my situation.  I've a script that generates
> a variable number of HREFs/anchors.  Each of those
> HREFs can go to variable pages and also have a variable
> number of GET variables.
> So, for the sake of this example, lets say my script
> generates the following HTML:
> 
> ---
> 
> Here
> There
> This Place
> That Place
> 
> ---
> 
> As you know, those variables are being passed to the
> linked page via GET variables.  Now, here comes the
> oddball question:
> 
> How can I (is it even possible) pass those variables
> to each page w/o using GETs and w/o using Cookies.
> Ultimately, the plan they are pushing is to make our
> site(s) free of all GET variables (including the SESSID;
> yes, you read that right) and of cookies.  Also those
> GET variables above should be turned into session
> variables if and when possible, but only if the user
> clicks on the actual link.
> 
> This is basically the environment that has been presented
> to me.  Is such an environment possible?  If so, how?
> What is necessary to make it work this way?  If it is not,
> to what extent is it possible?
> 
> Thanks for reading this far.  Thanks, also, for fielding
> this question and offering any help and any insight you
> can on my dilema.
> 
> Chris
> 


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




Re: [PHP] What means "can't truncate sockets!"

2001-03-01 Thread Jaxon



well, because you are using "http://" PHP will have opened a tcp/ip socket
:)

try using both fread()  AND  fclose()

from the manual:
http://www.php.net/manual/en/function.fread.php

// get contents of a file into a string
$filename = "/usr/local/something.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);

then truncate $contents


not sure, but should work...

regards,
jaxon


On 3/1/01 7:32 PM, "SED" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I'm trying to truncate a txt-file which I in my script use
> "http://mydomain/path/to/my/file.txt" as a reference but I get this error
> message:
> 
> Warning: can't truncate sockets! in
> domains/mydomain/www/path/to/my/phpfile.php on line 47
> 
> Does it mean I'll have to use "real" path e.g. c:\\domains\\mydomain...
> (etc.) or is it something else I should focus at? I'm working on a remote
> server (Linux/Apache) but this works 100% on my local server (Win2k/IIS5).
> 
> Regards,
> Sumarlidi Einar Dadason
> 
> SED - Graphic Design
> 
> --
> Phone:   (+354) 4615501
> Mobile:  (+354) 8960376
> Fax: (+354) 4615503
> E-mail:  [EMAIL PROTECTED]
> Homepage:www.sed.is <- New Homepage!
> --
> 


-- 
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] nested include, eval, and function declaration problems

2001-02-27 Thread Jaxon

Thought I had this licked but it's giving me a headache ... can anyone help?

here is the index.php:



now functions.inc declares functOne() and functTwo()...

functOne() performs an eval on $string,
and $string contains an "echo functTwo();"

This gets as far as the functTwo call and pukes:

Fatal error: 
Call to undefined function:
funOne() in functions.inc: eval()'d code on line 30

If I declare functTwo() within $string, I'm fine, but I want to keep all my
functions in one file :)  I cannot include functions.inc again in $string,
because then I'm trying to redeclare functOne() after is has been used...
plus, it's ugly.

ANY pointers appreciated...

cheers!
jaxon



-- 
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] parse error on line after last one???

2001-02-27 Thread Jaxon

Hi all,

Can anyone tell me why I¹m getting an unhelpful error when trying to pull up
a file?

The index.php I¹m calling is including a functions file ­ functions.inc.php

I¹m getting a parse error on line 144 ­ but functions.inc.php only has 143
lines...!

does this actually mean anything, or is it just poor error reporting??

Cheers!
jaxon


--
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] really weird html - was "extract() help"

2001-02-24 Thread Jaxon

gak. everyone ignore me.
idiocy is setting in this late at night.

stoopid me put a  tag INSIDE the loop.

and thanks CC Zona for the pointer on the var_dump() - very helpful!

regards,
jaxon

On 2/25/01 2:38 AM, "Jaxon" <[EMAIL PROTECTED]> wrote:

> I replaced extract() with $row[] - much better.
> 
> Now I have the strangest thing happening - the  html
> formatting only applies to the first iteration in the loop, even though it
> shows up in the html source!!
> 
> regard,
> jaxon
> 
> 
> html generation:
> 
> for ($i = 1; $i <= 5; $i++)
>   
>   {
>   $sql="select stuff from table";
>   $result = mysql_query($sql, $link_id);
>   $row = mysql_fetch_row($result);
>   
>   echo "
>   $row[2]
>   $row[3]
>   $row[1]
>   $row[4]
>href=\"news.php?#$row[0]\">...more
>   
>
>";
>
>   echo "";
>   }
> 
> resultant source:
> -
> 
>   First Headline
>   first subtitle
>   2001-02-24
>   get it right here now... this is the place to be, I tell
> you
>href="news.php?#1">...more
>   
>
>   SECOND HEADLINE!
>   second subtitle
>   -00-00
>   even more good stuff coming out of our second news
> item!!!
>href="news.php?#2">...more
>   
>
>   HEADLINE 3!!!
>   subtitle 3
>   2001-02-26
>   getcha third item here!!
>href="news.php?#3">...more
>   
>
> 


-- 
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] really weird html - was "extract() help"

2001-02-24 Thread Jaxon

I replaced extract() with $row[] - much better.

Now I have the strangest thing happening - the  html
formatting only applies to the first iteration in the loop, even though it
shows up in the html source!!

regard,
jaxon


html generation:

for ($i = 1; $i <= 5; $i++)

{
$sql="select stuff from table";
$result = mysql_query($sql, $link_id);
$row = mysql_fetch_row($result);

echo "
$row[2]
$row[3]
$row[1]
$row[4]
...more

 
 ";
 
echo "";
}

resultant source:
-

First Headline
first subtitle
2001-02-24
get it right here now... this is the place to be, I tell
you
...more

 
SECOND HEADLINE!
second subtitle
-00-00
even more good stuff coming out of our second news
item!!!
...more

 
HEADLINE 3!!!
subtitle 3
2001-02-26
getcha third item here!!
...more

 


-- 
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] extract() help

2001-02-24 Thread Jaxon

Hi PHPers,

the following function is supposed to build an html table, creating a
content row for every row in a database table.  It is creating a table with
the correct number of rows, but NO content is being echoed...

I think I must be using the extract() function inside the for loop wrong...
any pointers?

tia!
jaxon


";


if (!isset($max)) $max=5; //upper limit of news boxes to build

for ($i = 1; $i <= $max; $i++)

{

$sql="select i.nID, i.date, i.headline, i.subtitle, i.blurb from
news_items i, news_box b where i.nID = b.nID and b.dID = $i";

$result = mysql_query($sql, $link_id);
$row = mysql_fetch_row($result);

extract($row); //the variables below match field names in this row

echo "
$headline
$subtitle
$date
$blurb
...more
 ";

echo "";
}
}
?>


-- 
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] best slashdot?

2001-02-22 Thread Jaxon

I hate to post flamebait, but I genuinely want to know -
what have people liked as far as a slasdot style PHP apps? 

I would love one that has integrated user management and mailing lists :)

TIA, and sorry for the YAWIB (yet another which-is-best) post.

regards,
jaxon

-- 
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] image orientation?

2001-02-21 Thread Jaxon

Hi,

Is there any way to take an image from the filesystem, say a .jpg or .png,
and display it in a different orientation?  e.g. 20 degrees to the right?

best regards,
jaxon


-- 
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] is eval expensive?

2001-02-20 Thread Jaxon

Hi,

is eval() really that expensive?
I want to parse a bunch of PHP 'modules' into an HTML string, so I can
mostly separate content from markup.
I've found a couple of comments on the list that say it is expensive, but
none of my PHP books mention it :)

cheers!
jaxon


-- 
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] fread strangeness (was: nested echo and includes, mixedhtml / PHP)

2001-02-19 Thread Jaxon

David - very cool, thanks much for your help!

if any other newbies run into the same problem:

echo "stuff";   //prints "stuff"
echo $string;   //prints contents of string, does NOT parse.

include(filename);  //whenever encountered, prints contents of file
//parses only if PHP tags present.

require(filename);  //builds contents into page as if part of script
//even if require() inside conditional 'false'
//if doesn't parse right, script breaks.

eval($string); //prints contents of $string AFTER parsing PHP tags.

nesting them in multiple ways allows very dynamic code reuse and modular
page building, which is your friend.

cheers!
jaxon






On 2/19/01 8:03 PM, "David Robley" <[EMAIL PROTECTED]>
wrote:

> On Tue, 20 Feb 2001 11:37, Jaxon wrote:
>> Same problem, found it's coming from somewhere else :(
>> It looks as if fread or fopen is preventing PHP from from parsing ...
>> 
>> index.php:
>> 
>> > $file="test.inc";
>> $fd = fopen ($file, "r");
>> $string = fread ($fd, filesize ($file));
>> fclose ($fd);
>> echo "$string";
>> ?>
>> 
>> test.inc:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> index.html show a blank html page, with the contents of test.inc
>> visible via view source...grr.  how can I get it to actually parse the
>> PHP?
>> 
>> help!
>> jaxon
>> 
> 
> eval() is possibly what you need.


-- 
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] fread strangeness (was: nested echo and includes, mixed html /PHP)

2001-02-19 Thread Jaxon

Same problem, found it's coming from somewhere else :(
It looks as if fread or fopen is preventing PHP from from parsing ...

index.php:



test.inc:







index.html show a blank html page, with the contents of test.inc visible via
view source...grr.  how can I get it to actually parse the PHP?

help!
jaxon



On 2/19/01 6:16 PM, "Jaxon" <[EMAIL PROTECTED]> wrote:

> Hi PHPers!
> 
> I'm doing a simple page build by:
> - reading file.html into $string
> - reading variables into $array
> 
> and then:
> echo (strtr($string, $array);
> 
> The file.html held in $string contains some PHP 
> and file.inc also has some PHP 
> 
> I'm doing this to assemble the page via little 'modules'.
> 
> This is not working, e.g. the PHP in $string is not getting parsed by PHP
> before being output to the browser, although I DO see the PHP in the
> resultant page source...any ideas?
> 
> Any comments welcome!
> 
> regards,
> jaxon
> 


-- 
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] nested echo and includes, mixed html / PHP

2001-02-19 Thread Jaxon

Hi PHPers!

I'm doing a simple page build by:
- reading file.html into $string
- reading variables into $array

and then:
echo (strtr($string, $array);

The file.html held in $string contains some PHP 
and file.inc also has some PHP 

I'm doing this to assemble the page via little 'modules'.

This is not working, e.g. the PHP in $string is not getting parsed by PHP
before being output to the browser, although I DO see the PHP in the
resultant page source...any ideas?

Any comments welcome!

regards,
jaxon


-- 
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] send error messages via email?

2001-02-18 Thread Jaxon

Hi,

May be a silly newbie question, but is there a way to send captured warnings
and errors when calling a script to an admin email?

Perhaps configure either apache or php_mod to point all error reporting to a
script that does this?

I'd appreciate any suggestions!

Thanks!
Jaxon


-- 
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] can we select image field from mssql use php

2001-02-15 Thread Jaxon

sounds like a windows bug... and not enough info to diagnose.
why is filename in [] by the way?

you may wish to include more of you connection script as well.
first thing I would try with an error like that is to upgrade your PHP.
sounds like you have .dll's arguing for memory address space  - i'm not sure
how to track what the other application is.

regards,
jaxon


On 2/16/01 12:51 AM, "codemake" <[EMAIL PROTECTED]> wrote:

> hi:
> i use php 4.0 and win 2000 chinese edition  and mssql 7.0
> i have table with image field name is "isospicture"
> 
> here is my script
> when mssql_querry execute there will error message
> 
> 
> "0x7332fcbb"  command  reference "0x00bcb000" memory can't written
> 
> why ?
> 
> $SQL = "Select  isospicture   from  isospic  where [filename] ='rose'";
> $result1   = mssql_query($SQL,$link_ID);  //here  wrong
> 
> gary yang 
> from taiwan
> 


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

2001-02-11 Thread Jaxon

anyone try myphpPagetool?
it seems to be of the same camp.

regards,
jaxon


On 2/11/01 10:28 PM, "Kath" <[EMAIL PROTECTED]> wrote:

> Hell yes to phpmyadmin, IMHO.
> 
> I use it on all my servers.
> 
> - Kath
> 
> - Original Message -
> From: "php php" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, February 11, 2001 2:17 PM
> Subject: [PHP] afraid !
> 
> 
>> Hi!
>> i've just joined ur mailing list!
>> i used to work on asp with oracle and access!
>> i'm working on windont NT but i want to publish my site at a provider that
>> has linux? do i have to change my code for that ?
>> do u know any provider that accepts acces and mysql with php4?
>> i'm afraid of using mysql with php cause i'm in hurry and that i
> discovered
>> that mysql interface is not as good and easy as of oracle and access! is
> it
>> true that if i want to insert data to a table i have to do it from the
>> commend line?
>> Thanks   a lot
>> _
>> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
> 


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




Re: [PHP] First connection?

2001-02-11 Thread Jaxon

Lonnie,

Try something like this:

create a file called db_connection_params.inc - I do this maintainability :)

(change to match your specifics)



Here is a sample page with connection/query:




There are lot's of different ways to do this, check out the mysql functions:
http://www.php.net/manual/en/ref.mysql.php

HTH!

regards,
jaxon

On 2/11/01 4:40 PM, "Info" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Fifteen years ago I did lots of Informix SQL on Unix -- including transaction
> processing -- BUT I find there isn't a lot of immediate help from that
> experience -- I tried using some webmonkey examples as "basic training" for
> php with MySQL and got nowhere.
> 
> I'm on Red Hat with Apache 1.3.9, PHP 4.02 and MySQL 3.22.32
> 
> Is there a good place to find typical PHP and MySQL code examples for that
> configuration?
> 
> My pages are "virtual" hosted and I have access to phpMyAdmin 2.0.5 which is a
> menu access by my ISP.
> 
> My php.ini is at /usr/local/lib
> 
> I've built a very small database of five fields in database "eprofitsys" in
> table "employees" and would like to connect to it within a .php file.  So,
> obviously, I am at ground zero.  Anyone want to lift me up.
> 
> Lonnie
> 


-- 
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] oops - wrong! (was: how to alter assoc_array?)

2001-02-11 Thread Jaxon

ack. 
ignore me. 
not enough coffee.


the 'while' was in the wrong place.
also dropped the array() in favor of array_name[] to ensure I keep it
associative.

$array = mysql_fetch_array($result, MYSQL_ASSOC);

while (list ($key,$value) = each($array))
   {
  $key ="~" . $key;
  $tagged_array[$key] = $value;
   }


thanks!
jaxon


On 2/11/01 4:10 PM, "Jaxon" <[EMAIL PROTECTED]> wrote:

>Okay, I don't have it :)

>This should be recreating a 3 row array of key:value pairs with a "~"
>character prepended to each key, but is only echoing _one_ key:value pair -
>anyone see why?
>
>while($array = mysql_fetch_array($result, MYSQL_ASSOC))
>{
>  list($key, $value) = each($array);
>  $key_prep="~$key";
>  $new_array=array("$key_prep => $value");
>
>  echo $key_prep;
>  echo " assigned to ";
>  echo $value;
>}


-- 
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] oops - wrong! (was: how to alter assoc_array?)

2001-02-11 Thread Jaxon

Okay, I don't have it :)

This should be recreating a 3 row array of key:value pairs with a "~"
character prepended to each key, but is only echoing _one_ key:value pair -
anyone see why?

while($array = mysql_fetch_array($result, MYSQL_ASSOC))
{
  list($key, $value) = each($array);
  $key_prep="~$key";
  $new_array=array("$key_prep => $value");

  echo $key_prep;
  echo " assigned to ";
  echo $value; 
}

outputs:

~boy assigned to hello

where are my other two rows?  :)

regards,
jaxon


>>> If $array contains the following:
>>> 
>>> boy => hello
>>> girl => hi
>>> dog => bark
>>> 
>>> How can I alter all the elements the same way?
>>> 
>>> e.g. so that it now conatins:
>>> 
>>> Xboy => Xhello
>>> Xgirl => Xhi
>>> Xdog => Xbark
>>> 
>>> thanks!
>>> jaxon
>>> 
>>> 
>>> -- 
>>> 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]
>> 
>> 
>> __
>> Do You Yahoo!?
>> Get personalized email addresses from Yahoo! Mail - only $35
>> a year!  http://personal.mail.yahoo.com/
> 


-- 
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 to alter assoc_array?

2001-02-10 Thread Jaxon

jason, thanks ... got it.


while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
list($key,  $value) = each($row);
$key_new="X.$key";
$value_new="X.$value";
$new_array=array($key_new => $value_new");
}

thanks,
jaxon


On 2/10/01 2:32 PM, "jason cox" <[EMAIL PROTECTED]> wrote:

> I would just loop through the array and grab the
> key/value pairs and then add them to a new array as
> you modify them.
> 
> Jason 
> --- Jaxon <[EMAIL PROTECTED]> wrote:
>> Hi folks!
>> 
>> If $array contains the following:
>> 
>> boy => hello
>> girl => hi
>> dog => bark
>> 
>> How can I alter all the elements the same way?
>> 
>> e.g. so that it now conatins:
>> 
>> Xboy => Xhello
>> Xgirl => Xhi
>> Xdog => Xbark
>> 
>> thanks!
>> jaxon
>> 
>> 
>> -- 
>> 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]
> 
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/


-- 
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] how to alter assoc_array?

2001-02-10 Thread Jaxon

Hi folks!

If $array contains the following:

boy => hello
girl => hi
dog => bark

How can I alter all the elements the same way?

e.g. so that it now conatins:

Xboy => Xhello
Xgirl => Xhi
Xdog => Xbark

thanks!
jaxon


-- 
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] ereg_replace with assoc array?

2001-02-08 Thread Jaxon

Thanks for the feedback!
 
>From the docs it appears that I can do this:

$string = file.tpl; //html mixed with {placeholders}

$array = fetch_mysql_array($result, MYSQL_ASSOC); //array of field => values

echo strtr($string, $array); //passing only 2 arguments means 2nd is array

one thing - I want to use special {} characters in my file.tpl.
Does anyone know if there is some way I can tell strtr to only evaluate
items in {} tag for replacing?

regards,
jaxon


On 2/8/01 5:49 PM, "Brad S. Jackson" <[EMAIL PROTECTED]> wrote:

> 
> 
> See the documentation for strtr and preg_replace.
> 
> http://www.php.net/manual/en/html/function.strtr.html
> http://www.php.net/manual/en/html/function.preg-replace.html
> 
> 
> "Jaxon" <[EMAIL PROTECTED]> wrote:
> Hi
> 
> Can I do this
> 
> $string = file.tpl;
> 
> while (list($pattern, $replacement) = each($array)) {
> ereg_replace ($pattern, $replacement, $string);
> }
> 
> echo $string;
> 
> 
> 
> note some assumptions below:
> 
> $array contains an assoc array:
> 
> first  foo
> second bar
> third  rab
> fourth oof
> 
> file.tpl is this:
> 
> some html {first}
> more html {second}
> even more html {third}
> lots more html {fourth}
> 
> This seems like a slow way to do this...
> any advice is welcome!
> 
> tia!
> jaxon
> 
> 
> 


--
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_replace with assoc array?

2001-02-08 Thread Jaxon

Hi

Can I do this

$string = file.tpl;

while (list($pattern, $replacement) = each($array)) {
ereg_replace ($pattern, $replacement, $string);
}

echo $string;



note some assumptions below:

$array contains an assoc array:

first  foo
second bar
third  rab
fourth oof

file.tpl is this:

some html {first} 
more html {second}
even more html {third}
lots more html {fourth} 

This seems like a slow way to do this...
any advice is welcome!

tia!
jaxon


-- 
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] passing array to function?

2001-02-06 Thread Jaxon


How do you write a function that takes an array as an argument?

Could someone please point me at an example?

Regards,
Jaxon


-- 
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] db forms creator?

2001-02-04 Thread Jaxon

Hi, can anyone point me towards an easy way to generate forms to update a
mysql database?

I've seen some sites where I can specify a list of table fields and the
datatype for each, and get an output of:

1. the sql to create the table
2. a php form that can be used to update the table

problem is I can't find the site now :)

has anyone else found this?

Regards,
jaxon


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

2001-01-21 Thread Jaxon

Hi,

I'm trying to echo out the field names used as key values in a
mysql_fetch_array:

$link_id = mysql_connect("localhost", "root", $pass);

mysql_select_db("database", $link_id);

$result = mysql_query("select * from lists where id = 1", $link_id);

$rowData = mysql_fetch_array($result);

while (list($fieldName) = each($rowData))
{ echo "$fieldName,"; }

I'm expecting to get this:

id,listname,joinconfirm,leaveconfirm,homepage,author,canjoin,bannedemails,de
scription,subject,masteremail,

but instead getting this:

0,id,1,listname,2,joinconfirm,3,leaveconfirm,4,homepage,5,author,6,canjoin,7
,bannedemails,8,description,9,subject,10,masteremail,

Why are the index numbers for the array showing up?  From the docs,
mysql_fetch_array should create an array of field names to field values...?
To make things worse, if I also echo the data:

while (list($fieldName,  $fieldValue) = each($rowData))
{ echo "$fieldName,$fieldValue," ;}

Then a value is echoed after both the index number and the field value, eg:

0,1,id,1,1,testlist,listname,testlist,  etc...

What am I doing wrong?

Regards,
Jaxon


-- 
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] Please: XTemplate help?

2001-01-20 Thread Jaxon

Cool, so just iterate through the array and sort it into the template
assignment - quite nice!

Thanks for the pointers Kristi!

Regards,
Jaxon

On 1/20/01 3:37 PM, "Kristi Russell" <[EMAIL PROTECTED]> wrote:

> while ( $rowData = mysql_fetch_array($result))
> {
>   list($fieldName,  $fieldValue) = each($rowData);
>   $template->assign("$fieldName", $fieldValue);
> }
> 
> 
> - Original Message -
> From: "Jaxon" <[EMAIL PROTECTED]>
> To: "Kristi Russell" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Saturday, January 20, 2001 2:03 PM
> Subject: Re: [PHP] Please: XTemplate help?
> 
> 
>> Kristi,
>> 
>> That makes more sense, thanks, but one problem - I don't want to have to
> do:
>> 
>> $template->assign("FIELD2", $row[fieldname2]);
>> 
>> If I've already called mysql_fetch_array, then I have an array like this:
>> 
>> field1:field1_data
>> field2:field2_data
>> field3:field3 data
>> 
>> Is there any way to use the array itself as the assignment, or tell
>> XTemplate to do so?  That way I can use one file to generate pages from
>> different templates.
>> 
>> Regards,
>> Jaxon
>> 
>> 
>> On 1/20/01 12:26 PM, "Kristi Russell" <[EMAIL PROTECTED]> wrote:
>> 
>>> require "xtpl.p"; //include XTemplate engine
>>> 
>>> //don't need this - wrong.
>>>> require "html.xtpl"; //html layout file with field names e.g.
> {firstfield}
>>> 
>>> You need to create a new instance of the Xtemplate class so:
>>> //assign the new instance to a variable name you'll use - I called it
>>> $template
>>> //and I specified which "html layout file" to use.
>>> 
>>> $template = new Xtemplate("html.tpl"); // I name them tpl not xtpl
> *shrug*
>>> 
>>> while($row = mysql_fetch_array($result))
>>> {
>>>   $template->assign("FIELD1", $row[fieldname]);
>>>   //FIELD1 being the name you're going to use in the layout file by
>>> {FIELD1}
>>>   //$row being the name of the array you fetched, field name being the
>>> fieldname in the database
>>> 
>>>   $template->assign("FIELD2", $row[fieldname2]);
>>> 
>>>   $template->parse("main");//replace {field} with matching result row
>>> element
>>>   $template->out("main");` //send final html page to browser
>>> }
>>> 
>>> 
>>> 
>>> Kristi
>>> 
>>> 
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
> 


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




Re: [PHP] Please: XTemplate help?

2001-01-20 Thread Jaxon

Kristi,

That makes more sense, thanks, but one problem - I don't want to have to do:

$template->assign("FIELD2", $row[fieldname2]);

If I've already called mysql_fetch_array, then I have an array like this:

field1:field1_data
field2:field2_data
field3:field3 data

Is there any way to use the array itself as the assignment, or tell
XTemplate to do so?  That way I can use one file to generate pages from
different templates.

Regards,
Jaxon


On 1/20/01 12:26 PM, "Kristi Russell" <[EMAIL PROTECTED]> wrote:

> require "xtpl.p"; //include XTemplate engine
> 
> //don't need this - wrong.
>> require "html.xtpl"; //html layout file with field names e.g. {firstfield}
> 
> You need to create a new instance of the Xtemplate class so:
> //assign the new instance to a variable name you'll use - I called it
> $template
> //and I specified which "html layout file" to use.
> 
> $template = new Xtemplate("html.tpl"); // I name them tpl not xtpl *shrug*
> 
> while($row = mysql_fetch_array($result))
> {
>   $template->assign("FIELD1", $row[fieldname]);
>   //FIELD1 being the name you're going to use in the layout file by
> {FIELD1}
>   //$row being the name of the array you fetched, field name being the
> fieldname in the database
> 
>   $template->assign("FIELD2", $row[fieldname2]);
> 
>   $template->parse("main");//replace {field} with matching result row
> element
>   $template->out("main");` //send final html page to browser
> }
> 
> 
> 
> Kristi
> 
> 


-- 
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] Please: XTemplate help?

2001-01-20 Thread Jaxon

Hi Debreceni, 

I need to use a template parser, and XTemplate looks like it will do what I
need, but I'm not sure how. I can use mysql_fetch_array to produce an array
of field_name:value.  If I use {field} names in the html template, can I use
XTemplate to take the array and parse?

This is what I have so far - please look at the ASSIGN step

assign($page_array); //HELP! How is this step done?
//I already have an array that assigns field
//names to data elements, how can I skip this?
//I don't want to assign each element since then
//I would need one .p page for each .xtpl page

$xtpl->parse("main");//replace {field} with matching result row element
$xtpl->out("main");` //send final html page to browser
?>

Does this make sense?

Thanks in advance for any help!

Regards,
Jaxon


-- 
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] help - templating?

2001-01-19 Thread Jaxon

I think the code below is pretty simple...
Can anyone suggest ANY way to do the bit in my last comment block???

thanks in advance!
Jaxon




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