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:
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
Simple program to copy files between two computers over the web
I use logmein free and often need to move files between my two computers. Generally, I move the file to my server, then download it, but it takes longer because of the intermediate step.Is there a
Unidentified index error in a simple form
I have been trying to make an HTML form that is handled by a PHP script. So far my attempts to get it to work have proven fruitless.I'm referencing the Visual Quickstart Guide for PHP to learn PHP,
How to store checkbox array in a session, and then be able to add to it?
I'm trying to store an array of checkbox values into a session array, sort of like a shopping cart, but I can't figure out how to not overwrite the sessions array each time new checkbox values are
Combining refCursors and Summing
Given the following DDL:
need help in dynamic select menu in php
hi i have created a dynamic select menu using php. i have a problem in that which is when the user select any value in that menu and press submit then it does not pass to next page.my code is
sendmail code suddenly not working
Hi Guys, I maintain 3 sites (including my own) I use the following code from a french webmaster that gave me permission to use it. He designed & coded one of them. Now the code seems to have
Sort a two dimensional array.
Hi. I've set up a two dimensional array that reads as follows:Code: $modifiedData = array( array($arrCollingwoodStart[0], $numCollingwoodForTotal, $numCollingwoodAgainstTotal,
Multi Dimensional Array Append
Hi Guys I have a function that returns a multidimentional array eg $result = function(param)echo $result[0][1]." ".$result[1][1]but I want to call the function 4 diffrent times and append to
Javascript form submit and radio buttons?
When this form is submitted, it is automatically resubmitted using JS.All my fields are carried over in the $_post except for total, and state which are radio buttons and a drop down.Code:
printing links
Hi every1i am connecting to a table in sql and the looping through with a while ($ var = my sql fetch array)the question i have is that when i print_r($var)i get the associative array of all elements