Reditecting pages based on logic


Posted on 16th Feb 2014 07:03 pm by admin

Newbie here, apologies in advance!

I am trying to use the header function to forward one of any number of locations (taken from a db) based on the value of a response param:

Did you know?Explore Trending and Topic pages for more stories like this.
Quote<?php include '../include/db/db-open.php'; ?>
<?php
$postTypeId = $_POST['postTypeId'];
$postTypesResults = $mysqli->query("select id, editPageUrl from post_types where active = 1");
?>
<?php include '../include/db/db-close.php'; ?>
<?php
while ($postTypesResult = $postTypesResults->fetch_object()) {
if ($postTypesResult->id == $postTypeId) {
header("Location: ".$postTypesResult->editPageUrl);
}
}
?>

The value of $postTypeId is always blank if echoed (explining why the condition to forward is never met).

Two questions:
Is there anything obvious I am doing wrong causing $postTypeId to always be blank?Can the header function be used in this way?
Thanks
No comments posted yet

Your Answer:

Login to answer
191 Like 24 Dislike
Previous forums Next forums
Other forums

extract content from a website
i have written a code that will grab the content from the index page..
i would like to know how c

why aint this working?
i have this code:

Code: $num = 250;
$count = ($num - $rcount);

echo $rc

Word Trimming
Hi Guys & Gals!!

Hope you are all ok....

I need some help with the following

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

php mail form text wont appear / javascript included
Guys/gals...

I am running into a problem whereby I have a great piece of javascript code that

ALV List Display to point to another report on Double Click
Hi,

I want my ALV List Display to point to another report on Double Click on its line ite

Error in Configure System Landscape Directory phase
Hi

We are getting the error in Configure SLD phase ( 41 of 44 phase).

Please f

Async WSAConnect failed on XP with error code = 2 ("File not found")
Hi all,

I have very strange bug, please help me if you can.

It is reproduced o

HTML Viewer HIDE scrollbar
How can I disable scrollbars in a HTML Viewer control? I can't hide them. Even i have enough space b

array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_ma

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash