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
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.

Link to comment
Share on other sites

If you simply use "return <something>;" in the middle of your script outside a function and in the main file (ie- not in an included file), it'll have the same affect as using "die;" or "exit;".

I don't really understand what you are trying to do here...

 

Orio.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.