PHP header() redirect problem
Auteur : Frank G.
Visité 2089,
Followers 2,
Partagé 0
Hello, I am trying to implement a conditional page redirect after user login using php header() function but to no avail. As far as I can tell I have followed all the rules such as putting header function at beginning of page...followed proper syntax. Can you offer some advice on how I can make this work with website X5. Thanks
Posté le
Hello Frank,
I would like to try and help you with this, but I need you to be a little more specific. On what condition do you want visitors to be redirected after login? And to which page?
Can you advise what version of X5 you are using? Is it Evolution v10?
And how does your attached PNG image relate to what you are trying to achieve?
Kind regards,
Paul
Auteur
I would like them redirected if they are registered as a user company in Mysql database of which the page connects with on load in header (confirmed this works and connects fine with querys). So far I am using the following code in the body.
Regarding the attachment in previous submission, I appologise it was submitted in error so you can disregard.
<?php
$result = mysql_query("SELECT * FROM Members WHERE COMPANY = '$_POST[name]'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}else{
header('Location: download.php', true);
}
?>
<form
method="post"action="<?php echo $_SERVER['PHP_SELF']; ?>">
Company:<inputtype="text"name="name"><br>
<inputtype="submit"name="submit"value="Submit Form"><br>
</form>
Hello Frank,
Unfortunately we cannot give support to custom code. I can help you to add it to your project but since the functions do not depend on WebSite X5, you can search useful information about the custom code with search engines like google or wait until someone on the community of Answers can help you.
In any case the code seems not to be complete, like a part is missing.
Many thanks!