I am currently a real newbe in the world of PHP and webdesign in general. I currently writing my first PHP application. Although unfortunately I did not plan it out.
I need to know what is the best way to design web applications. Just a few tips will do.
Maybe if I show you all an example (not finished) this may help you to understand what I mean a little better.
>>> Here is what I mean in program flow
Here at the beginning of the script if it dosent get any variables it goes back to the index page of the website.
>>> otherwise if it gets the variable mode it flows into
the next part
See in my theory in all major web applications all form elements are sent via POST and if you wanted to access some particular page with in the application you use on a link i.e
.
Sorry I might have over complicated this question. I don't really know enough about the application flow to know what I am asking truely.
If you can decipher this message I would really appreciate it.
Thank you.
I need to know what is the best way to design web applications. Just a few tips will do.
Maybe if I show you all an example (not finished) this may help you to understand what I mean a little better.
Code:
<?
require_once('../config/Dbconnector.php');
$connect = new Dbconnector();
$local = $_SERVER["PHP_SELF"];
if (!$_GET)
{
header("Location: index.php");
}
Here at the beginning of the script if it dosent get any variables it goes back to the index page of the website.
Code:
else if ( $_GET['mode'] )
the next part
Code:
{
if ($_GET['mode'] == "create") //>>>>> if mode = create do this
{
echo "League Name: ".$_POST['name']."<br/>";
echo "Number of Groups: ".$_POST['num']."<br/>";
echo "League Type: ".$_POST['type']."<br/>";
if (isset($_POST['num']))
{
//some more code
exit();
}
include("include/create.php"); // OTHER WISE include this into page
exit();
}
}
else
{
echo "SORRY INCORRECT SANTAX";
}
?>
Code:
<a href = "page.php?id =<? echo $variable ?>"> click here </a>
Sorry I might have over complicated this question. I don't really know enough about the application flow to know what I am asking truely.
If you can decipher this message I would really appreciate it.
Thank you.
Comment