473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

header

Hi,

I have this problem

<?php

$doc = "name";

$result = "code";

header('Location: content2.php?docCode= $doc + resultCode=$result');

?>

I have two variabeles (doc and result) i want to pass to content2.php

There i will get them

$doc_n = $_GET('docCode');

$result_n=$_GET('resultCode');

What's wrong with my header?

Thanks

Alain

Jul 17 '05 #1
2 2747
Alain Dhaene wrote:
<?php
header('Location: content2.php?docCode= $doc + resultCode=$result');
?> What's wrong with my header?

Too many spaces; wrong syntax.

Try (after changing server and path)

header('Location: http://server.com/path/to/content2.php?' .
'docCode=' . urlencode($doc) .
'&amp;resultCode=' . urlencode($result));
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
Alain Dhaene wrote:

Hi,

I have this problem

<?php

$doc = "name";

$result = "code";

header('Location: content2.php?docCode= $doc + resultCode=$result');

?>

I have two variabeles (doc and result) i want to pass to content2.php

There i will get them

$doc_n = $_GET('docCode');

$result_n=$_GET('resultCode');

What's wrong with my header?


You should put in the full URL, as some browsers don't support relative urls.
You should not put spaces in your url. (these will usually work in IE, but NS 4
work accept them)
Different variables must be seperated with "&", not "+".
Your variables should be url encoded.

Try this:

header('Location:
http://yoursite.com/content2.php?docCode='.urlencode($doc).'&resultCod e='.urlencode($result));

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John | last post by:
Hi. I am having a few header problems at the moment with a login page. I don't have my headers at the top of the page where I've learned I need to have them. However, I also know I'm supposed...
11
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do...
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
18
by: John Smith | last post by:
Hi all What does the group think of the practise of including one header file from inside another? I have some legacy code where this has been done, and it creates a dependency on a module...
6
by: Jason Collins | last post by:
There seems to be an inconsistency (bug?) in the way the Set-Cookie header is handled by the WebHeaderCollection. That is, the values of Set-Cookie, when an Expires is specified, contain the ","...
0
by: Dean Hallman | last post by:
Hello, I am developing a BHO that should add a custom HTTP header on a specific domain only. Don't want the header globally, otherwise I could just add a registry key. So, on...
4
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code...
1
by: Shalako | last post by:
I check my error log and see these entries: malformed header from script. Bad header= Missing gauge reports are ind: padata.pl /perl/pema/padata.pl did not send an HTTP header malformed...
5
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I have a sub in vb.net that adds extra headers to a gridview and it works very well. however, i tried to translate it to c# and i'm getting the header inserting itself over the first datarows and...
30
by: xiao | last post by:
HI~ EVERY ONE~ I have a small program here, when I tried to compile it , it always reminds that arrary.c: In function `main': arrary.c:39: error: `header' undeclared (first use in this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.