Ask a Question related to PHP Development, Design and Development.
-
Darryl #1
Basic PHP question
Greetings,
I have a page called test.php. I want to call the same page but pass a
variable to
it so that data on the page (retrieved from mysql database ) changes.
So, can I have inside test.php a call to test.php with a variable ?
thanks,
Darryl
Darryl Guest
-
Basic FLV question
Can someone please help me. we wish to stream flv files using Flash Media Server 2. we have installed the program however we are at a loss as to how... -
basic 3d question
Hi, Just a qiuck question....I have created a 3d world and exported it to director. I want to add a basic cube shape I create in 3dstudio max to... -
Basic Question
Hello, I've noticed in some sample code that sometimes people use the @ before a string when concatenating them. Example: string filePath =... -
Basic question b/w ASP & ASP .NET
I would like to know what is the basic difference between ASP and ASP .NET VB AND VB .NET ADO and ADO .NET look forward to your responses -
basic css question
In several of my posts lately, I have made it known that I am nto a huge fan of using newer stuff as opposed to older methods of getting things... -
Tyrone Slothrop #2
Re: Basic PHP question
On Tue, 20 Jan 2004 09:34:52 -0600, "Darryl" <darryl@osborne-ind.com>
wrote:
Of course! It would go something like this:>Greetings,
>I have a page called test.php. I want to call the same page but pass a
>variable to
>it so that data on the page (retrieved from mysql database ) changes.
>
>So, can I have inside test.php a call to test.php with a variable ?
<html>
<head>title</head>
<body>
<?php if ($somevar) {
# make data call here returning some data
?>
This is page with somevar.
<?php } else { ?>
This is without somevar.
<php } ?>
</body>
</head>
$somevar could be sent by post (form) or get (query string).
Tyrone Slothrop Guest
-
Damir Mehmedovic #3
Re: Basic PHP question
Hi Darryl,
you can call the page directly with variables like:
test.php?your_var=1&another_one=testing
or you can eventually use some form:
echo "<form action=\"test.php?your_var=1\" method=\"post or get\">";
instead of \"test.php?your_var=1\", you can try also the $_PHPSELF variable
and use the fields (hidden or normal) from your form..
Lot of fun..
Greetz,
Damir
"Darryl" <darryl@osborne-ind.com> wrote in message
news:97ydnQujtdtr1JDd4p2dnA@news.ruraltel.net...> Greetings,
> I have a page called test.php. I want to call the same page but pass a
> variable to
> it so that data on the page (retrieved from mysql database ) changes.
>
> So, can I have inside test.php a call to test.php with a variable ?
>
> thanks,
> Darryl
>
>
>
>
Damir Mehmedovic Guest
-
Savut #4
Re: Basic PHP question
Your code is deprecated
use this one below
<html>
<head>title</head>
<body>
<?php if ($_REQUEST["somevar"]) {
# make data call here returning some data
?>
This is page with somevar.
<?php } else { ?>
This is without somevar.
<php } ?>
</body>
</head>
Savut
"Tyrone Slothrop" <ts@paranoids.com> wrote in message
news:najq00dtiop6sectf27kthul5oefsv36ep@4ax.com...> On Tue, 20 Jan 2004 09:34:52 -0600, "Darryl" <darryl@osborne-ind.com>
> wrote:
>>> >Greetings,
> >I have a page called test.php. I want to call the same page but pass a
> >variable to
> >it so that data on the page (retrieved from mysql database ) changes.
> >
> >So, can I have inside test.php a call to test.php with a variable ?
> Of course! It would go something like this:
>
> <html>
> <head>title</head>
> <body>
> <?php if ($somevar) {
> # make data call here returning some data
> ?>
> This is page with somevar.
> <?php } else { ?>
> This is without somevar.
> <php } ?>
> </body>
> </head>
>
> $somevar could be sent by post (form) or get (query string).
Savut Guest
-
Michael Meckelein #5
Re: Basic PHP question
> <html>
I would recommend that you use the $_POST['somevar'] or respective the> <head>title</head>
> <body>
> <?php if ($somevar) {
> # make data call here returning some data
> ?>
> This is page with somevar.
> <?php } else { ?>
> This is without somevar.
> <php } ?>
> </body>
> </head>
>
> $somevar could be sent by post (form) or get (query string).
$_GET['somevar'] vars to read your parameter from the header. Of course,
Tyrone sample is good and work perfekt, but also if you start php coding,
learn how to use parmeter in a more secure way.
You can build a link to parse a varialbe to your page:
echo '<a href="test.php?var=' . $value . '">sent var</a>';
if (issset($_GET['var']))
echo $_GET['var'];
More detail information [url]www.php.net/manual/en/[/url]
Michael
Michael Meckelein Guest
-
Darryl #6
Re: Basic PHP question
One more question then.
say I have defined:
$adj = -60;
and then in a loop I do:
$adj = $adj - 30;
then I want to have something like:
-30px
how do I convert to string and concatinate the px on the end?
I still need $adj to be numeric so I can subtract from it on the next
loop iteration.
thanks,
Darryl
"Darryl" <darryl@osborne-ind.com> wrote in message
news:97ydnQujtdtr1JDd4p2dnA@news.ruraltel.net...> Greetings,
> I have a page called test.php. I want to call the same page but pass a
> variable to
> it so that data on the page (retrieved from mysql database ) changes.
>
> So, can I have inside test.php a call to test.php with a variable ?
>
> thanks,
> Darryl
>
>
>
>
Darryl Guest
-
Darryl #7
Re: Basic PHP question
Nevermind, I figured it out.
strval() is my friend.
"Darryl" <darryl@osborne-ind.com> wrote in message
news:jOCdnc-toMT4P5DdRVn-hw@news.ruraltel.net...> One more question then.
> say I have defined:
> $adj = -60;
>
> and then in a loop I do:
> $adj = $adj - 30;
>
> then I want to have something like:
> -30px
>
> how do I convert to string and concatinate the px on the end?
> I still need $adj to be numeric so I can subtract from it on the next
> loop iteration.
>
> thanks,
> Darryl
>
>
> "Darryl" <darryl@osborne-ind.com> wrote in message
> news:97ydnQujtdtr1JDd4p2dnA@news.ruraltel.net...>> > Greetings,
> > I have a page called test.php. I want to call the same page but pass a
> > variable to
> > it so that data on the page (retrieved from mysql database ) changes.
> >
> > So, can I have inside test.php a call to test.php with a variable ?
> >
> > thanks,
> > Darryl
> >
> >
> >
> >
>
Darryl Guest



Reply With Quote

