Re: Re: a function question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've not read the whole thread, but might I suggest you might want to use PHP to get the information from a MySQL database and use that data to populate your
Flash interface. If you use an action script construct like loadVars or loadVariables it is not too difficult to pass parameters from Flash to PHP to MySQL, and
then use PHP to pass them back to Flash.

Just a thought.

Blu

Patrick Roane wrote:

> Thanks for all of your help. Sorry for the late
> response, I've been out of town.
>
> Anyway, my objective with this is to ultimately create
> a website that uses php and mysql to store and load
> information about gigs (for a band). I design web
> sites and primarily rely on 'flash' to do the job
> (which can be time consuming). If you go to
> www.franklin-band.com and go to the '2005' link,
> you'll see all the months for this year and the gigs
> that are booked. I'd like to stay true to this format,
> but eventually replace the flash w/php so that our
> booking agent can simply 'log in' and type in the
> details himself.
>
> --- Jason Barnett <jason.barnett@xxxxxxxxxxxxx> wrote:
>
> >
> > >
> > > Here is my code (which I can't get to work):
> > >
> > > <?php
> >
> > /** Note that my code / comments are untested, but
> > should be helpful. */
> >
> > >
> > >
> > >         $mail = "FOJOMO@xxxxxxxxx";
> > >     $user = "patrick";
> > >
> > >     function usermail( $user, $mail ) {
> > >
> >
> > /** We don't need global $user or $mail since these
> > are passed into the
> > function.  In fact doing this just might confuse
> > yourself... */
> >
> > >         $user; = ucwords( $user ); // capitalizes
> > the
> > >     //'p' in patrick
> >
> > /** The above is incorrect.  A semicolon terminates
> > a line!  Try the
> > following: */
> >
> > $user = ucwords( strtolower( $user ) );
> >
> > >         $mail; = strtolower( $mail ); // converts
> > all
> > > //of FOJOMO into lower case
> > >
> >
> > $mail = strtolower( $mail );
> >
> > >
> > >
> > >   if ( strstr( $mail ), "@" )) {
> >
> >
> > /** Agreed with Graeme's previous comment, strpos is
> > fine for this. */
> >
> > if ( strpos( $mail, '@' ) ) {
> >
> >
> > >     // searches for the '@' sign
> > >   user_array = explode("-", $user, $mail); // this
> >
> > $user_array = explode( '-', $user);
> >
> > > //function (explode) creates the array
> >
> > /** Check the manual page for explode
> > http://php.net/manual/en/function.explode.php
> >
> > Why do you explode on hyphens?  Do you have a system
> > to prevent users
> > from creating email addresses without hyphens?  And
> > what do you want to
> > do with this array?  */
> >
> > >                     } else {
> > >     print "Please enter a valid e-mail address";   //
> > > default if test fails to //find the '@' sign
> > >
> > >
> > >     }
> > >
> >
> > /** Nothing is returned either... did you want
> > something? */
> > return $user_array;
> >
> > } /** end of function usermail */
> >
> >
> > /** Now we test the function and echo the result of
> > running the function. */
> > $result = usermail( $user, $mail );
> > print nl2br( print_r( $result ) );
> >
> >
> > >
> > >
> > > ?>
> > >
> >
> >
> >
> > --
> > Teach a person to fish...
> >
> > Ask smart questions:
> > http://www.catb.org/~esr/faqs/smart-questions.html
> > PHP Manual: http://php.net/manual/
> > php-general archives:
> > http://marc.theaimsgroup.com/?l=php-general&w=2
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> =====
>
> ----------------
> "forget your lust for the rich man's gold. All that you need, is in your soul. You can do this if you try. All that I want for you my son, is to be satisfied"
>
>   ~ Lynard Skynard

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux