WebSite X5Help Center

 
Frank G.
Frank G.
User

PHP header() redirect problem  en

Author: Frank G.
Visited 1984, Followers 2, Shared 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

Posted on the
3 ANSWERS
Paul M.
Paul M.
Moderator

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

Read more
Posted on the from Paul M.
Frank G.
Frank G.
User
Author

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>

Read more
Posted on the from Frank G.
Incomedia
Claudio D.
Incomedia

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!

Read more
Posted on the from Claudio D.