| Author |
passing a variable
|
|
|
| Hey gang. I have a question.
Is it possible to pass a variable in PHP, and pick it up on an asp page?
thanks
| |
| richard.a.fletcher@googlemail.com 2006-04-20, 3:57 am |
| Don't know about asp. But if you have a php page produce a cookie, or
pass things in the get string then presumable asp can pick it up.
| |
|
| well.. what i have is php creating a group of variables.
i don't know php at all, but i am good with asp.
so how would i code it to pass in a string?
like asp would be test.asp?user=<%=username%>
so what would be the querystring for php??
<richard.a.fletcher@googlemail.com> wrote in message
news:1145522112.789520.63450@u72g2000cwu.googlegroups.com...
> Don't know about asp. But if you have a php page produce a cookie, or
> pass things in the get string then presumable asp can pick it up.
>
| |
| Geoff Berrow 2006-04-20, 7:57 am |
| Message-ID: <H9SdnV3PNr3M5trZRVn-rw@adelphia.com> from Jeff contained
the following:
>like asp would be test.asp?user=<%=username%>
>
>so what would be the querystring for php??
All variables in php are preceded by a dollar sign.
You can use a short form very similar to that above but a more reliable
way is:-
test.php?user=<?php echo=$username; ?>
--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
| |
|
| thanks a bunch
"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:2a1f42p90vaer5mn4no9ql84d81qaih549@
4ax.com...
> Message-ID: <H9SdnV3PNr3M5trZRVn-rw@adelphia.com> from Jeff contained
> the following:
>
>
> All variables in php are preceded by a dollar sign.
> You can use a short form very similar to that above but a more reliable
> way is:-
>
> test.php?user=<?php echo=$username; ?>
> --
> Geoff Berrow 0110001001101100010000000110
> 0011011010110110010001101111011001110010
11
> 1001100011011011110010111001110101011010
11
| |
|
|
"Jeff" <gig_bam@adelphia.net> wrote in message
news:fLqdnQZIEdCiEtrZnZ2dnUVZ_s2dnZ2d@ad
elphia.com...
> thanks a bunch
>
> "Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
> news:2a1f42p90vaer5mn4no9ql84d81qaih549@
4ax.com...
>
>
| |
|
| ok. another dumb question for this noob.
the string is test.php?user=<?php echo=$username; ?>
but how do i write that. in asp it is response.redirect. what is the php
code?
"Jeff" <gig_bam@adelphia.net> wrote in message
news:fLqdnQZIEdCiEtrZnZ2dnUVZ_s2dnZ2d@ad
elphia.com...
> thanks a bunch
>
> "Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
> news:2a1f42p90vaer5mn4no9ql84d81qaih549@
4ax.com...
>
>
| |
|
| i found this.. but it doesn't work correctly
Header("test.php?user=<?php echo=$claninfo");?>
"Jeff" <gig_bam@adelphia.net> wrote in message
news:fLqdnQZIEdCiEtrZnZ2dnUVZ_s2dnZ2d@ad
elphia.com...
> thanks a bunch
>
> "Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
> news:2a1f42p90vaer5mn4no9ql84d81qaih549@
4ax.com...
>
>
| |
|
| ok. the next pending question i have, is are you able to connect to, and
update a access DB using php??
"Jeff" <gig_bam@adelphia.net> wrote in message
news:fLqdnQZIEdCiEtrZnZ2dnUVZ_s2dnZ2d@ad
elphia.com...
> thanks a bunch
>
> "Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
> news:2a1f42p90vaer5mn4no9ql84d81qaih549@
4ax.com...
>
>
| |
| Geoff Berrow 2006-04-20, 6:58 pm |
| Message-ID: <mLOdnbdwKP-uTdrZnZ2dnUVZ_v6dnZ2d@adelphia.com> from Jeff
contained the following:
>ok. the next pending question i have, is are you able to connect to, and
>update a access DB using php??
yes, using ODBC
--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
| |
| Geoff Berrow 2006-04-20, 6:58 pm |
| Message-ID: <8aWdnSCRJ7QFVNrZRVn-gw@adelphia.com> from Jeff contained
the following:
>i found this.. but it doesn't work correctly
>
>Header("test.php?user=<?php echo=$claninfo");?>
Ah, yes, you may have a problem then because I don't think you can pass
variables using header. BICBW
--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
| |
| David Haynes 2006-04-20, 6:58 pm |
| Jeff wrote:
> i found this.. but it doesn't work correctly
>
> Header("test.php?user=<?php echo=$claninfo");?>
>
>
> "Jeff" <gig_bam@adelphia.net> wrote in message
> news:fLqdnQZIEdCiEtrZnZ2dnUVZ_s2dnZ2d@ad
elphia.com...
>
>
header("location: text.php?user=$claninfo");
-david-
| |
|
| if i can't pass it using header... then what is the script to pass it??
"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:kgkf42h7o1jgo1e8t6vulhtsluq1flum52@
4ax.com...
> Message-ID: <8aWdnSCRJ7QFVNrZRVn-gw@adelphia.com> from Jeff contained
> the following:
>
>
> Ah, yes, you may have a problem then because I don't think you can pass
> variables using header. BICBW
>
> --
> Geoff Berrow 0110001001101100010000000110
> 0011011010110110010001101111011001110010
11
> 1001100011011011110010111001110101011010
11
| |
| Jack Butler 2006-04-25, 7:00 pm |
| Jeff wrote:
> if i can't pass it using header... then what is the script to pass it??
>
>
> "Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
> news:kgkf42h7o1jgo1e8t6vulhtsluq1flum52@
4ax.com...
>
>
No kidding that won't work! it's simple. I pass variables all the time.
<?
header("Location:
somefile.php?somevar=".$somevar."&someothervar=".$somethingelse);
?>
:)
| |
| Geoff Berrow 2006-04-25, 7:00 pm |
| Message-ID: <5%E2g.7925$sq5.4615@newsread2.news.atl.earthlink.net> from
Jack Butler contained the following:
>No kidding that won't work! it's simple. I pass variables all the time.
I said I wasn't sure. No idea where I got that idea from.
That might save me some time...
--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
| |
|
| Ok. i tried that. i get an error
Parse error: parse error in C:\*****\*****\*****\Clanstats\index2.php on
line 178
using this
header("Location:
update.asp?stats1=".$clanstats.");
basically these stats are pulled from another source. the page has been
coded from xml to php. i know squat about php,(i am an asp person), so i am
trying to get this page to send the variables to an asp page, to upload into
a db.
ultimately, i want to be able to send a variable for each playername to a
page to be uploaded into an access db.
but i haven't gotten that far yet.
thanks
"Jack Butler" <vouksh@earthlink.net> wrote in message
news:5%E2g.7925$sq5.4615@newsread2.news.atl.earthlink.net...
> Jeff wrote:
>
> No kidding that won't work! it's simple. I pass variables all the time.
>
> <?
> header("Location:
> somefile.php?somevar=".$somevar."&someothervar=".$somethingelse);
> ?>
>
> :)
| |
|
| i am also on teamspeak, or msn.... if anyone can help me figure out how to
send all these variables. once they get to the asp page... it is smooth
sailing for me.. but getting there is proving to be a thorn in my side.
"Jack Butler" <vouksh@earthlink.net> wrote in message
news:5%E2g.7925$sq5.4615@newsread2.news.atl.earthlink.net...
> Jeff wrote:
>
> No kidding that won't work! it's simple. I pass variables all the time.
>
> <?
> header("Location:
> somefile.php?somevar=".$somevar."&someothervar=".$somethingelse);
> ?>
>
> :)
| |
| Hugh Janus 2006-05-07, 7:01 pm |
| Your missing a "
header("Location: update.asp?stats1=".$clanstats."");
"Jeff" <gig_bam@adelphia.net> wrote in message
news:ofOdnY7x0JqeatHZRVn-sg@adelphia.com...
> Ok. i tried that. i get an error
>
> Parse error: parse error in C:\*****\*****\*****\Clanstats\index2.php on
> line 178
> using this
> header("Location:
> update.asp?stats1=".$clanstats.");
>
> basically these stats are pulled from another source. the page has been
> coded from xml to php. i know squat about php,(i am an asp person), so i
> am trying to get this page to send the variables to an asp page, to upload
> into a db.
>
> ultimately, i want to be able to send a variable for each playername to a
> page to be uploaded into an access db.
>
> but i haven't gotten that far yet.
>
> thanks
>
>
> "Jack Butler" <vouksh@earthlink.net> wrote in message
> news:5%E2g.7925$sq5.4615@newsread2.news.atl.earthlink.net...
>
>
| |
|
| On Sun, 7 May 2006 12:07:37 +1200, "Hugh Janus" <hugh_janus@bigfoot.com> wrote:
>Your missing a "
>
>
>header("Location: update.asp?stats1=".$clanstats."");
>
try
header("Location: update.asp?stats1=$clanstats");
you can put a variable inside double quotes
| |
| David Haynes 2006-05-07, 7:01 pm |
| Hugh Janus wrote:
> Your missing a "
>
>
> header("Location: update.asp?stats1=".$clanstats."");
The last "" translates to the empty string.
header("Location: update.asp?stats1=".$clanstats);
should work just fine, however,
header("Location: update.asp?stats1=$clanstats");
will also work and is easier to read in my opinion.
-david-
| |
|
| Ok, tried all the suggestions. and I am getting this.
Warning: Cannot modify header information - headers already sent by (output
started at C:\***mywebpath***\Clanstats\index_playe
r2.php:63) in
C:\C:\***mywebpath***\Clanstats\index_pl
ayer2.php on line 96
any ideas??
"Gleep" <Gleep@Gleep.com> wrote in message
news:ocrq52tg2vkbb8sooq6ss0mkg4255184o8@
4ax.com...
> On Sun, 7 May 2006 12:07:37 +1200, "Hugh Janus" <hugh_janus@bigfoot.com>
> wrote:
>
> try
> header("Location: update.asp?stats1=$clanstats");
>
> you can put a variable inside double quotes
>
| |
|
| Jeff wrote:
> Ok, tried all the suggestions. and I am getting this.
> Warning: Cannot modify header information - headers already sent by
> (output started at C:\***mywebpath***\Clanstats\index_playe
r2.php:63)
> in C:\C:\***mywebpath***\Clanstats\index_pl
ayer2.php on line 96
>
> any ideas??
Yup, your either outputting stuff before the header call, or you have
spaces/other characters outside your php-tags.
http://www.php.net/manual/en/function.header.php
Check the given lines.
--
Rik Wasmus
| |
|
| On Sun, 7 May 2006 12:41:20 -0400, "Jeff" <gig_bam@adelphia.net> wrote:
make sure there are no echo or print statements before/above the header
also make sure <?php is the very first thing on line 1 with no spaces above
you can not have ANY output before the header
>Ok, tried all the suggestions. and I am getting this.
>Warning: Cannot modify header information - headers already sent by (output
>started at C:\***mywebpath***\Clanstats\index_playe
r2.php:63) in
> C:\C:\***mywebpath***\Clanstats\index_pl
ayer2.php on line 96
>
>any ideas??
>
>
>"Gleep" <Gleep@Gleep.com> wrote in message
> news:ocrq52tg2vkbb8sooq6ss0mkg4255184o8@
4ax.com...
>
|
|
|
|