473,549 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

header

Hi,

I have this problem

<?php

$doc = "name";

$result = "code";

header('Locatio n: content2.php?do cCode= $doc + resultCode=$res ult');

?>

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 2770
Alain Dhaene wrote:
<?php
header('Locatio n: content2.php?do cCode= $doc + resultCode=$res ult');
?> What's wrong with my header?

Too many spaces; wrong syntax.

Try (after changing server and path)

header('Locatio n: http://server.com/path/to/content2.php?' .
'docCode=' . urlencode($doc) .
'&amp;resultCod e=' . urlencode($resu lt));
--
--= 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('Locatio n: content2.php?do cCode= $doc + resultCode=$res ult');

?>

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('Locatio n:
http://yoursite.com/content2.php?do cCode='.urlenco de($doc).'&resu ltCode='.urlenc ode($result));

Regards,
Shawn
--
Shawn Wilson
sh***@glassgian t.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
3423
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 to have the session_start(); at the top of the page as well. So when you have two things that need to be the first which do you put first? And if I...
11
2736
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 understand the objective. This example may represent an interface in need of a bit of refactoring, but it goes to demonstrate the basic idea as I...
60
8220
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 associated with this source file For example, in a file hello.c: #include <stdio.h>
18
2724
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 (collection of files) which are not required, except for one header file's contents. I'd say 'No, header files should be included in the C source,...
6
7061
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 "," character. This seems to be incorrectly parsed during GetValues(). A simple example shows it best (there are 2 .aspx pages and an output): ...
0
3716
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 BEFORENAVIGATE2, I am canceling the current navigation and renavigating with the new custom header using Navigate2. This usually works fine, but in some cases...
4
2468
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 m_Token = null in order to destroy the session token when the user logs out. However, I'm finding that setting class instance to null results in no...
1
24114
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 header from script. Bad header= : padata.pl /perl/pema/padata.pl did not send an HTTP header malformed header from script. Bad header= Missing...
5
1959
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 inserting blank rows at the bottom. i can post the code if necessary for the C# but it basicly mirrors the vb.net -- (i''ll be asking a lot...
30
1669
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 function) arrary.c:39: error: (Each undeclared identifier is reported only once arrary.c:39: error: for each function it appears in.) Why is that ? I...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.