-1

I fixed my old problem, but now I have a new one :)

Here is my code http://wklej.org/id/1004299/

line 41: //header('location:test.php?pytanie='.$next); which doesn't work

SkuterPL
  • 89
  • 1
  • 8
  • 3
    Your testcase goes into the question. Your question is expected to help other people, as part of this archive of questions on programming languages called "Stack Overflow". It's not a code debugging service, or programming helpdesk. – Lightness Races in Orbit Apr 06 '13 at 16:14

1 Answers1

0

No output should be above the headers. There is a range of reasons why this could be caused. examples.

<?php
header ("Location: test.php");
?>

this wont throw an error

<?php
 echo "blabla";
header ("Location: test.php");
?>

OR

<strong> test</strong>
<?php
header ("Location: test.php");
?>

and in your case:

print_r($Array);
header ("Location: page.php");

Will throw an error.

Daryl Gill
  • 5,464
  • 9
  • 36
  • 69
  • I chaned to this code http://wklej.org/id/1004319/ delete all echo, but it still doesn't work – SkuterPL Apr 06 '13 at 16:20
  • `print_r($_SESSION['odpowiedzi']);` -- This is output. which is stopping the headers from being sent – Daryl Gill Apr 06 '13 at 16:21
  • sorry I didn't see this :) I've deleted it, but still doesn't work – SkuterPL Apr 06 '13 at 16:24
  • `header('location:test.php?pytanie='.$next);` I cannot see how `$next` is defined? So are you getting an `unidentified index` error message? – Daryl Gill Apr 06 '13 at 16:27
  • http://wklej.org/id/1004328/ this part of code is responsible for $next – SkuterPL Apr 06 '13 at 16:30
  • Have you verified that `$next` is correctly assigned within your `$_POST[]` parameters. – Daryl Gill Apr 06 '13 at 16:31
  • yes, because when I have open website test?pytania=2 and I write echo $next it is shows "3" PS it is noit $_POST, but $_GET :) – SkuterPL Apr 06 '13 at 16:33
  • Daryl Gill are you still there? because I don't know what I should do – SkuterPL Apr 06 '13 at 17:16
  • @user1195901 I am sorry, I got no notifications come through.. and if you have verified that your variables are properly set.. Give me a minute or two – Daryl Gill Apr 06 '13 at 17:17
  • OK I will wait, if I can help you, I can send all code to you, here you can see result http://skuterpl.vot.pl/egzamin/test/test.php?pytanie=2 – SkuterPL Apr 06 '13 at 17:19
  • @user1195901 running: http://pastebin.com/CfUf1hUY alone, the header works.. so are you being presented with any error messages; because the headers are sucessfuly working – Daryl Gill Apr 06 '13 at 17:26
  • I don't know how to use this website, I insert my all code http://pastebin.com/UZb9dTbT what next, it works or not? – SkuterPL Apr 06 '13 at 17:30
  • @user1195901 it's impossible for me to test your code locally due to not having a full database; but what I am asking, is are you getting any error messages? – Daryl Gill Apr 06 '13 at 17:32
  • No, I don't have any error, you can check it yourself on http://skuterpl.vot.pl/egzamin/test/test.php?pytanie=2 and the 'wstecz' button should get to next page, because I have only this code if (isset($_POST['wstecz']) && isset($_POST['odp'])) { header('location:test.php?pytanie='.$next); } for this button – SkuterPL Apr 06 '13 at 17:34
  • I have checked if $back works, but it doesn't want to work too :/ – SkuterPL Apr 06 '13 at 17:48
  • again you left my topic? – SkuterPL Apr 06 '13 at 18:17
  • @user1195901 sorry, I was getting one of my mates to translate the web-content to english so I can understand what i'm looking at. It seems you have something that is re-directing to `test.php` prior to your $_GET param – Daryl Gill Apr 06 '13 at 20:07
  • where is it? because I don't see this re-directing – SkuterPL Apr 07 '13 at 10:47
  • I found it :D I changed to this: echo "
    "; and now it works
    – SkuterPL Apr 07 '13 at 12:21