Jump to content

[SOLVED] return true; doesn't work!


xyn

Recommended Posts

Hey,

This usually works. but this time it's not.

Basially I have a actions page which will

run various tasks as ordered via $_POST

vars.

 

And when i want to kill the script. but the

rest of the websites template to show up.

I use the Return false; and Return True;

except the return false; works. but it wont

return true as directed.

 

My coding

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="576">
                <tr>
                  <td width="576">
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="576">
                    <tr>
                      <td width="96" align="center" class="text">
                      <p align="center"><a href="/client/index.php">Home</a></p>
                      </td>
                      <td width="96" align="center" class="text">
                      <a href="/client/account.php">Account</a></td>
                      <td width="96" align="center" class="text">
                      <a href="/client/password.php">Edit Password</a></td>
                      <td width="96" align="center" class="text">
                      <a href="/client/invoices.php">Invoices</a></td>
                      <td width="96" align="center" class="text">
                      <a href="/client/note.php">Note</a></td>
                      <td width="96" align="center" class="text">
                      <a href="/client/index.php?logout=true">Logout</a></td>
                    </tr>
                  </table>
                  </td>
                </tr>
                <tr>
                  <td width="576"><hr color="#2B2B2B" size="1"></td>
                </tr>
                <tr>
                  <td width="576" valign="top" height="400">
				<?php
				if(isset($_POST['update_password']))
				{	//UpdatePassword
					echo('down');
					return false;

					echo('c');  //this tested the false return
				}

				return true;
				echo('e');  //this tested the true return.
				?>
                  </td>
                </tr>
              </table>
              </td>
            </tr>
          </table>

Link to comment
https://forums.phpfreaks.com/topic/42208-solved-return-true-doesnt-work/
Share on other sites

1) Why are you using return and not die or exit?

2) This this file being include()ed or require()ed ?

 

Orio.

 

1. when i use die; or exit; it will CHOP the bottom half of the website layout.

    so return false will stop running the code until the told otherwise ie return true;

 

Basically i use return true after the coding to allow the HTML template to load.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.