You are here: Re: Variable Passing Not Sending Complete Name « PHP Programming Language « IT news, forums, messages
Re: Variable Passing Not Sending Complete Name

Posted by Jerim on 08/15/07 13:51

On Aug 15, 8:22 am, Rik <luiheidsgoe...@hotmail.com> wrote:
> On Wed, 15 Aug 2007 15:17:47 +0200, Jerim <wyo...@gmail.com> wrote:
> > I have a PHP script which simply calls another PHP script using
> > include(). Let's call them website.php and website_include.php, with
> > website.php simply including website_include.php. I can pass the
> > variable to website.php fine. Using an echo command, I can see that it
> > has the complete phrase such as "Permission Denied." When I call the
> > website_include.php, which is the page that actually does all the
> > work, the variable has changed to just "Permission." This happens with
> > any phrase I send. I am using the following syntax to call
> > website_include.php:
>
> > include("http://www.domain.com/website_include.php?variable=$phrase)
>
> Really try to use the local filesystem if you can, not a roundabout by
> HTTP. It's unneccessary and cumbersome in most cases.
>
> Your problem is in this case you should have urlencoded() the $phrase,
> spaces are _not_ valid in the query string of an url.
>
> Much easier would be:
>
> website.php
> <?php
> $phrase = 'Test this.';
> include('./website_include.php');
> ?>
>
> website_include.php
> <?php
> echo $phrase;
> ?>
> --
> Rik Wasmus

I appreciate the help, but that didn't work. The variable that
website.php is sending isn't hard coded. This system is for searching
names in a database. The variable that is getting passed is a persons
name. I start out with a page that lists all names, such as name.php.
All the names are clickable, so that you can get more details on that
person. So name.php passes the persons name onto website.php.
website.php catches the variable using a $_GET statement. Then it
calls website_include.php. The full variable name between website.php
and website_include.php is getting lost. Right now actually,
website_include.php isn't showing any name. So far, the only way to
get website_include.php to show even part of the name is to pass it
the name variable in the URL, and have website_include.php do a $_GET.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация