Yes everyone will point to using ahref<a href="index.php?variable=1>.
But im just wondering if I can do the same thing using headers header("Location: index.php?variable=1").
Note: Yes I can also use sessions but wish to user headers.
Thanks, Regards X

Recommended Answers

All 4 Replies

But im just wondering if I can do the same thing using headers header("Location: index.php?variable=1")

Yes you can. Then you can acess the 'variable' in index.php just like how you do it using $_GET.

Ok so just to confirm, how would I do the value:
header("Location: index.php? $VARIABLE = $VARIABLE")
something like
header("Location: index.php?" . $VARIABLE . "=" . $VARIABLE)
that will work according to the previous, forum? Thanks :)

header("location: index.php?variable1=".$variable1."&variable2=".$variable2);

:)

commented: Thanks as always nav ;) +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.