php-general Digest 31 Dec 2005 11:46:13 -0000 Issue 3880

Topics (messages 228051 through 228058):

XSLT doesn't work anymore
        228051 by: Tobi Reif

Re: Can the URL be controlled for more user-friendly readability?
        228052 by: Richard Lynch

Re: any https / php gotchas ???
        228053 by: Colin Ross

Reading body of page being recieved by another php page
        228054 by: Jamie Kemp
        228055 by: Zareef Ahmed

Managing upload files in multiple servers(pawns)
        228056 by: Srinadh Sannidhanam
        228058 by: Duncan Hill

Re: how to create a php5 extensions on C/C++, reflecting php Class Api's ?
        228057 by: Edwin Barrios

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi

Can anyone help me with this issue?

http://marc.theaimsgroup.com/?l=php-general&m=113456345526736&w=2

Tobi

--- End Message ---
--- Begin Message ---
On Fri, December 23, 2005 10:43 pm, Dave M G wrote:
>       I have a PHP/MySQL web site where there are profiles for performers
> at
> a comedy show.

Cool!

Every entertainment venue should do this.

> The profiles are accessed by passing a variable to the
> PHP script via URL, which can then look up the right performer data in
> the database.
>       The resulting URL looks like this:
>       http://www.tokyocomedy.com/people.php?person=6
>       However, having "?person=6" in the URL is not only ugly, but it makes
> it hard for people to remember URLs and for the performers to use them
> when sending out information about themselves.
>       It would be much nicer to have the url look more like this:
>       http://www.tokyocomedy.com/firstname-lastname
>       Or something like that.

You mean like this?
http://uncommonground.com/artist_profile/Ellen+Rosner
:-)

#1:
Re-name your script from "people.php" to just "people"

In your example, if you actually want the HOMEPAGE to be the
"people.php" script, you can skip this step, so long as your homepage
is a PHP script.
(IE, it's index.php not index.htm, or your server is configured to
pass .htm files through PHP)

#2:
Force the web server to treat "people" as a PHP script even though it
doesn't end in .php
Open up .htaccess on the server (or create one) and add this:
<Files people>
  ForceType application/x-httpd-php
<Files>

Also skip this step if you want your HOMEPAGE to be your "people" page
-- or use it to force "index.htm" to be PHP script if it's not
already:
<Files index.htm>
  ForceType application/x-httpd-php
</Files>

#3:
I was going to type a lot of PHP stuff here...
I'll just show my source code and comment on it:
http://uncommonground.com/artist_profile.phps

The 'require' lines connect to the database and define some functions
you can ignore, so forget those.

$search_key = $_SERVER['PATH_INFO'];

This is the crucial "Magic Line" that gives you the data:
"/Dave+Martin"

Only sometimes it's:
"/artist_id/42"
as you'll see if you click through some of the links to other artists
on the site.
See the list of performance dates at the bottom of the page here:
http://uncommonground.com/artist_profile/Ellen+Rosner
[More on this "artist_id/42" later.]

I first strip off the "/" in front to get:
"Dave+Martin"

Or maybe it's:
"artist_id/42"

Use urldecode() to change "Dave+Martin" into "Dave Martin"

Next, I check to see if I have an artist_id or if I want to look up
the name:
    if (stristr($search_key, 'artist_id')){

Then I either use the artist_id I was handed (as your script does
right now) or I look up the name.

If you do this on your HOMEPAGE, you'd want something like:

if (stristr($search_key, 'artist_id')){
  //We KNOW who the artist is, look them up by ID
}
elseif (strlen($search_key)){
  //There was an artist name in PATH_INFO
  //Search the database for that name
}
else{
  //There was NOTHING in PATH_INFO, so dump out the actual HOMEPAGE
  ?>
  <html><head>Tokyo Comedy</head><body>Welcome to Tokyo
Comedy!</body></html>
  <?php
}
only a lot more code in there :-)

Inside the strlen($search_key) branch...
If more than one name matches, dump out all the names for the user to
pick one.  Example:
http://uncommonground.com/artist_profile/Ellen

Then they'll click on the link, and you'll have the exact artist_id
you want.

After that, it's all just a bunch of SQL and PHP to dump out what I
want about the artist.

Which in my case has gotten pretty extensive and built-up over the
past several years, so it's a BUNCH of SQL and PHP, but there it is.

Here are the table names and what they are to help explain what the
queries are doing:

entities: core artist info: name, url, email, bio, etc
samples: headshots and thumbnails
cache_list: MP3s of previous performances here at our venue
cdbaby: CDBaby albumcode for CDs of this artist at http://cdbaby.com
events: performance date calendar

If anything is at all unclear, feel free to ask!

The rest of this post is just wacky ideas of things I do, that you
might want to consider doing, with your system after you get it
working.

Or maybe they'll inspire you to other better ideas -- Or at least more
appropriate for a Comedy Club.  (We're acoustic music with very very
very rare comedy acts.)

You should probably stop reading and start coding the basic simplest
page you can now, and then stop and re-read from here forward to start
dreaming up your own stuff to do...

We allow artists to log in and input their own Bios and upload Photos
(as many as they want) and Thumbnails and...

So I don't put in any of this stuff for the Artist Profile.  With
2000+ artists, and an average of 3 acts per night, every night,
there's NO WAY I'd have time to maintain all this data.

Total self-service on these pages.

If you need to see the artist login/backend in action, I can hook you
up with an artist account and a gig in, oh, 2038 so you'll see it in
action.

Artists also put in their zipcode which gives me the GPS data to list
artists from regions to cross-promote artists with each other based on
their home-town (or current base of operations at least).  Some
artists have only provided city/state or have given me nothing at all,
and sometimes we only have one artist from a certain country (Norway,
for example) and so the "Relativistic Proximity" calculation got a bit
hairy for that... :-)  It's giving each artist a "score" relative to
the artist I'm displaying, and picking the 3 "nearest"

I also link to their CDBaby pages (with a referral $$$ code) to help
them sell more CDs.  I auto-search through CDBaby in a cron job rather
than relying on artists to input that, cuz CDBaby is so clean and
simple.

Artists also put in "internal" data like a stage plot, which our sound
engineers see an Intranet page -- And the sound engineer records
free-form notes like "Use an SM58 ; He bops his head too much for the
87A" or "This guy sucks!!! Never book him again"

The engineer also records two crucial (for us) numbers:
Draw: (how many warm bodies this artist delivered)
Rating: (1 sucks ; 10 rocks)

The Talent Buyer (that's me) can then review the artist's history
EASILY (and somewhat objectively) when making booking decisions,
rather than relying on faulty (perhaps drunken) memories of who was
who and what they were like.

I'm also going to add a number for their Tip Jar $$$ (we are
prohibited by City Ordinance from charging a Cover) so we can report
to Box Office Network automatically.

This is also all tied into our web-calendar, which DRIVES our booking
process.  No more do I take endless phone calls about "What's
available?" -- Artists know they can check the web-site and see for
themselves.

The site also sends automated email confirmations for every gig
booked, listing each artists' time slot and Cc:-ing each artist on the
night of the added booking.  We have not had a single double-booking
(that actually went to the night of the event) since this system went
into place.  Artists notice right away when somebody else is in their
slot in the email, and we can FIX the problem months in advance.  I
cannot stress how much this has improved quality of life by reducing
stress.

Not to mention cutting my phone calls and emails by one-third, which
is a huge savings.

Oh, and the confirmation email gives all the artitsts the other
artists' emails and websites, so they don't come bugging me for it --
They often want to listen to the other act to see what they're getting
into, and to explore cross-promotion possibilities, or just to make
sure the night won't suck because of the other act. :-)

I'm using PostgreSQL, not MySQL for historical reasons
(my first webhost couldn't get MySQL to install, but had PostgreSQL
running)
You'll have gloss over the pg_exec and SQL nitpiking.
~* is a REGEX, but you could use LIKE in MySQL too.

>       But I can't figure out if there is a way to control the way the URL
> reads after the performer has been looked up. And, even if I could,
> would the system be able to retrieve performer data if someone typed
> the
> name directly into the URL.
>
>       Obviously, I'm still a bit of a beginner with PHP. I may have
> approached this issue from the wrong starting point, so please let me
> know if I'm missing something fundamental.
>
>       Thank you for any advice you may have.

Hope this isn't all too overwhelming...

The CORE of the technology is just $_SERVER['PATH_INFO'] but I figured
I might as well give you the whole ball of wax, eh?

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
this all depends on the web server (IIS/Apache) being used...

On 12/26/05, Curt Zirzow <[EMAIL PROTECTED]> wrote:
>
> On Mon, Dec 26, 2005 at 07:42:48AM +0000, Dave Carrera wrote:
> > Hi List,
> >
> > Are there any https / php gotchas to take into consideration for an app
> > i am writing that will run within a https environment ???
>
> I'm not sure what kind of 'gotchas' your are worried about, but
> well php doesn't really care wether you are using http or https.
>
> There is one thing to note: if you are trying to detect in php
> wether or not the request was from https or not, the result of what
> is in $_SERVER['HTTPS'], depends on the webserver, the possible
> values:
>
>   if accessed via https:
>     on, On, ON
>
>   if accessed via http:
>     !isset(), Off, OFF
>
>
> Curt.
> --
> cat .signature: No such file or directory
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I have data being sent to another php page containing xml styled data. Is it 
possible to read that data into the script? I have looked into the the 
globals set but cannot see anything like waht im looking for.

Does anyone have any ideas?

Thanks

Jamie 

--- End Message ---
--- Begin Message ---
Hi,

How you are sending the data to that script? It must be availble in $_POST,
$_GET, or $_REQUEST, depends how you are sending it.


Zareef Ahmed

----- Original Message ----- 
From: "Jamie Kemp" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Friday, December 30, 2005 8:57 PM
Subject: [PHP] Reading body of page being recieved by another php page


> I have data being sent to another php page containing xml styled data. Is
it
> possible to read that data into the script? I have looked into the the
> globals set but cannot see anything like waht im looking for.
>
> Does anyone have any ideas?
>
> Thanks
>
> Jamie


====================================================
PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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

--- End Message ---
--- Begin Message ---
Hi All,

We have a site in php and two web servers(pawns) to balance the load.
There is a page in the site through which user can upload images.

When a user uploads an image, the request goes to only one of the two
servers.
So the image will be uploaded to only one server.

How can we copy that image to other server? Do we need to transfer the image
using scp or is there any easy way?

I am afraid of getting the request to the other server for that image before
I copy it?

What steps do we need to take to avoid inconsistancies (if any) would be
caused by this kind of a system?

Please advice.


--srinadh

--- End Message ---
--- Begin Message ---
On Saturday 31 December 2005 02:06, Srinadh Sannidhanam wrote:
> Hi All,
>
> We have a site in php and two web servers(pawns) to balance the load.
> There is a page in the site through which user can upload images.
>
> When a user uploads an image, the request goes to only one of the two
> servers.
> So the image will be uploaded to only one server.

Use a shared file system such as NFS for upload storage.

Use some form of session management/balancing that ensures a client browser 
that upload ends up on the same server immediately afterwards, and use 
something like rsync to keep the image area in sync.

Shared storage is probably the better bet - perhaps with clever code that 
tries a local disk first, then the shared storage if not found on local.  If 
found shared and not local, pull to local.

--- End Message ---
--- Begin Message ---
Hello Gustavo. !

Thanks for  your suggestion, that  book it's  a interesting material to
learn more advanced features of PHP5 and to begin on the C extentions world.

The chapter 15 only take a look to extends PHP5 funtions, but there is none
section on how to create a PHP5 Class on the C extentions.

Do you know how to do that ?






On 12/27/05, Gustavo Narea <[EMAIL PROTECTED]> wrote:
>
> Hello, Edwin.
>
>
>
> I think that in chapter #15 of "PHP 5 Power Programming" you're going to
> find what you are looking for.
>
> Saludos!
>
> --
> Gustavo Narea.
> PHP Documentation - Spanish Translation Team.
> Valencia, Venezuela.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---

Reply via email to