You are not logged in.

#26 23 Jan 2007 12:05 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Ok, seems to work good now, http://www.bamboocommandos.com/bc_data/result.php, but, is there a way that I can make yet another input box on this result page, that will allow people to search up a specific ID (every submission gets a unique ID number, like the result here is number 91). So that if I for example write 90 in the box and press submit, it automatically brings up number 90?

And I heard something about a "loop" somewhere, showing them all in the order they were submitted, is it possible?


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#27 23 Jan 2007 2:20 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

a loop is a way to do something over and over (until you want to stop).  there are 2 (or 3) ways to do a loop in php,

1. using the while structure:

Code:

while($test) {
    // execute this code
}

a slight modification called do while:

Code:

do {
    // execute code here
}while($test);

2. using a for:

Code:

for($i = 0; i < $something; $i++) {
    // execute code here
}

or a modification of the for: foreach:

Code:

foreach($array as $temp_val) {
    // execute code here
}

with a while loop, the thing inside the parentheses will determine whether the block is executed.  the do/while executes it first then tests to see if it can run again.  $test is a boolean statement like:

while($test == "some value") { ... }

or

$test = true;
while($test) { ... }


its like an if statement, when it is true, the while block is executed.


the for statement is typically used for iterating a certain number of times.  its similar to this while loop:

Code:

$count = 0;
while($count < 43) {
    // some code
    $count = $count + 1; // $count++ does the same thing
}

the for syntax is as follows:

for(<counter initialization> ; <if true> ; <counter manipulation>)

where <counter initialization> is executed first, the code block is executed, the <if true> statement is tested, and if true, the <counter manipulation> is executed.  each section is separated with a semicolon.  the variable you declare inside the <counter initialization> is only available inside the loop.  after the loop is done, you no longer have access to it.

the foreach is used on an array to iterate through the items in the array.  if you have an array like this:

Code:

$array[0] = "foo";
$array[1] = "bar";
$array[2] = "baz";
foreach($array as $item) {
    echo $item;
}

is the same as:

Code:

$array[0] = "foo";
$array[1] = "bar";
$array[2] = "baz";
$count = count($array);
for($i = 0; $i < $count; $i++) {
    echo $array[$i];
}

so in your case, you want to pull an array of rows from the database, and iterate through them, you'd use a for or foreach with the results of your fetch statement like I did in that sample I posted a while ago.

Offline

 

#28 24 Jan 2007 10:17 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Ok, using the "while" one, I got this code:

Code:

<?php
$con = mysql_connect("localhost","bambooco_butch29","roflkaka772");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("bambooco_banlist", $con);

$result = mysql_query("SELECT * FROM banned ORDER BY id");

while($row = mysql_fetch_array($result))
  {
  echo $row['ID'];
  echo "<br />";
  echo $row['name1'];
  echo "<br />";
  echo $row['map'];
  echo "<br />";
  echo $row['reason'];
  echo "<br />";
  echo $row['ban'];
  echo "<br />";
  echo $row['name2'];
  echo "<br />";
  echo $row['date'];
  echo "<br />";
  echo $row['ip'];
  echo "<br />";
  echo "<br />";
  echo "<br />";
  echo "<br />";
  }
mysql_close($con);
?>

Which basically works good, but how can I make it say something before it shows the result? Like this:

Code:

<td width="95" align="left" valign="middle">Banned Name: <?php
$con = mysql_connect("localhost","bambooco_butch29","roflkaka772");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("bambooco_banlist", $con);
$result = mysql_query("select * from banned where id = 91");
while($row = mysql_fetch_array($result))
  {
  echo $row['name1'];
  echo "<br />";
  }
mysql_close($con);
?></td>

That one shows up as this; "Banned Name: Ronald McDonald", is it possible to have plain html text within the while thing?


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#29 26 Jan 2007 2:36 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Yay, found it out, after a few attempts, hehe. I am wondering, does there exist such a thing as a code "changer" in php? For example: I have a php statement connected to my MySQL database like this:

Code:

<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_db", $con);

$result = mysql_query("SELECT * FROM banned ORDER BY id");

while($row = mysql_fetch_array($result))
  {
  echo $row['name1'];
  echo " " . $row['date'];
  echo " " . $row['name2'];
  echo "<br />";
  }
mysql_close($con);
?>

So that I can for example have a input box, where I can write the number or name of a field (like I use the ID field with auto_increment) to change the source code to bring up number 2 and look at it?


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#30 26 Jan 2007 3:13 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

hrm... missed the post before this one.

1. yes you can embed plain html in your php code:

Code:

while($row = mysql_fetch_array($result)) {
// end your php tag:
?>
<p><?= $row['name1']." ".$row['date']." " . $row['name2'] ?></p>
<?php
// ^^^ you have to re-open your php tag
  }

the <?= $var ?> syntax is the same as saying:

<? echo $var ?>

all php code needs to be inside <? ... ?> tags.  if you end your php tag inside your while loop, you can add plain html and it will print it.  just make sure you re-open your php tag before the end bracket.


now, for the second part, this is where you as a developer need to be real careful.  the way you do that is to insert the value that was posted from your input box into your sql statement.  if your db id is an int, use:

Code:

$id = intval($_POST['id']);
$result = mysql_query("SELECT * FROM banned WHERE id='.$id.' ORDER BY id");

this is where SQL Injection vulnerabilities come in.  if you don't sanitize the user submitted value, somebody can place rogue sql into your query and return something you may not want them returning.  but thats another topic altogether.

Offline

 

#31 26 Jan 2007 4:09 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Ok, so if I do this:

Input field:

Code:

<td align="center">
    <form action="form_action.asp" method="post">
    <input type="int" name="id" value="Insert ID number here" />
    </form>
</td>

(Not sure what to put in the action thingy, but I'm figuring this:

form_action.asp containing:

Code:

<?php
    $id = intval($_POST['id']);
$result = mysql_query("SELECT * FROM banned WHERE id='.$id.' ORDER BY id");
?>

)

Or am I on the wrong track? I understand what the code you posted means and does, but am a little uncertain about how to make the input correctly, and make it appear below where the input box is.


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#32 26 Jan 2007 8:22 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

asp is microsoft's active server page technology.  php is a different scripting technology and is what you're using.


the input html tag does not have a type="int"  it has a type="text" which is what you're needing.


in the sql statement, the value of $id, which comes from the posted input box in the html gets inserted into the string for the query, so that if you typed in 3 into the text box on the form, when the php processes it, ends up looking like:

Code:

"select * from banned where id = 3 order by id"

which will return the matching record (and the order by clause is not really needed since you'll only be getting one record).

Offline

 

#33 27 Jan 2007 2:21 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Argh, cant get this thing to work. I now have this:

Code:

<form action="select_process.php" method="post">
<table width="500" border="0" align="center">
  <tr>
    <td align="center">Input ID here:&nbsp;
      <input type="text" name="id" value="" /></td>
  </tr>
  <tr>
    <td align="center"><input name="Submit" type="submit" id="Submit" value="Submit"></td>
  </tr>
</table>
</form>

In the result.php file, and this:

Code:

<html>
<head>
<title>AMAGAD, COOKIES!</title>
</head>

<body>
<?php
    $id = intval($_POST['id']);
$result = mysql_query("SELECT * FROM banned WHERE id='.$id.' ORDER BY id");
?>
</body>
</html>

In the mentioned select_process.php, but I am guessing that this is the wrong approach to it. I understand how it works, but not how it works together, how it links from when I write for example 1 in the input field in my form and press submit, and then is supposed to show me the information from field with the id of 1. Tried it this way, not sure yet how I get it in the same page.

How does it link the form and input and submit button to the output?


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#34 27 Jan 2007 3:30 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

if you look up how http works, the browser either requests a file from the server, or posts data to it.  if you request index.php, then the server will fetch it, run the php script and spit out what index.php produces.

when you post to that page, the $_POST array will be filled with the elements of whatever was submitted.  if you have an input w/ an id of "foo" then you'll have a matching element in the $_POST array named "foo".  likewise if you have a submit button named "Submit" then when you post to your page you'll have a member of $_POST named "Submit."

in the start of your script you can check whether $_POST contains any elements using the isset function:

Code:

if(isset($_POST)) {
    // the user has posted something to this page
} else {
    // the user has requested the page
}

so if you want to put the processing code in the same file as the code that generates the html, then you place the html generation in the else block, and place the form processing code inside the if( isset($_POST) ) block.

Offline

 

#35 27 Jan 2007 4:56 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Ok, read some about the POST thingy. Came up with this:

Code:

<html>
<head>
<title>AMAGAD, COOKIES!</title>
</head>

<body>
<?php
$con = mysql_connect("localhost","username","supersecretpassword");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
    $id = intval($_POST['id']);
    $map = intval($_POST['map']);
    $name2 = intval($_POST['name2']);
$result = mysql_query("SELECT * FROM banned WHERE id='.$id.' ORDER BY id");
?>
<p>
<?php
$con = mysql_connect("localhost","username","supersecretpassword");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
echo "Table ID: ";
echo $_POST["id"];
echo "<br />";
echo "Banned on: ";
echo $_POST["map"];
echo "<br />";
echo "Submitted by: ";
echo $_POST["name2"];
?>
</p>
</body>
</html>

And hot damn, it almost works. Only problem I seem to encounter is that it only shows this:

Table ID: 1
Banned on:
Submitted by:

It doesnt show the two other things that it requests... Any idea why?


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#36 27 Jan 2007 6:58 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

look closer at your code and tell me what you're trying to do... I could tell you, but I want you to see it.

you connect to the database:
$con = mysql_connect(...);

you get the id that was posted:
$id = intval($_POST['id']);

you insert it into the query:
$result = mysql_query("SELECT * FROM banned WHERE id='.$id.' ORDER BY id");

from there, what do you plan on doing with the results of that query (just guessing you don't plan on re-connecting to the database for some strange reason)?


also, just a little style hint, it makes your code much easier to read if things inside the {'s are indented.

Code:

code block {
    extra code indented {
        this is too {
            until you close the braces
            everything goes at this
            indention
        }
        things after this get indented
        here too...
    }
    and here too
    and here
}

or, if you like new line braces:

Code:

code block 
{
    extra code indented 
    {
        this is too 
        {
            until you close the braces
            everything goes at this
            indention
        }
        things after this get indented
        here too...
    }
    and here too
    and here
}

where the open brace either goes on the end of the line, or on a new line at the same indent level as the line above it.


that just makes it easy for you to see logically where you are.

Offline

 

#37 28 Jan 2007 8:07 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Hmm, looking at it, I found it hard to find any other errors than "intval", which I am guessing will only show numbers... But I cant find any reference to what it could be if not "intval". Also changed my source code, and as far as I can tell there are no other errors. After the change it looks like this:

Code:

<?php
$con = mysql_connect("localhost","bambooco_butch29","roflkaka772");
if (!$con)
{
  die('Could not connect: ' . mysql_error());
}

{
    $id = intval($_POST['id']);
    $map = intval($_POST['map']);
    $name2 = intval($_POST['name2']);
}

{
$result = mysql_query("SELECT * FROM banned WHERE id='.$id.' ORDER BY id");
}

{
echo "Table ID: ";
echo $_POST["id"];
echo "<br />";
echo "Banned on: ";
echo $_POST["map"];
echo "<br />";
echo "Submitted by: ";
echo $_POST["name2"];
}

{
mysql_close($con);
}
?>

I fail to see any other reason to why it is not showing up the rest of the information. Unless of course, this method only process the number input from one page to another, and does not put the number into a query that retrieves the information from that SQL field based on whats inside it.


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#38 28 Jan 2007 8:50 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

http://php.net has all the reference documentation on php.

here's now I see it.

1. you connect to the database
2. you get the id of the record you want (intval just ensures that the input did not contain sql but a number.  intval just takes a string "5" and turns it into an integer type 5).
3. you query the database for the record you need
4. you iterate over the results and display the html.

instead of iterating over the results of the db query, you're trying to access information posted to the page using the $_POST variable (which is what was submitted in your input form)

Offline

 

#39 30 Jan 2007 10:14 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Read up on this a little, and decided that since the method could be used for attacking my database, I would use another method. And my brother explained a little to me about what he uses to organize and edit things in his film review site, jesusreviews.com, and it worked very good. Using it now, and it allows me to do the same thing, but easier actually big_smile


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#40 08 Apr 2007 12:18 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

This is probably the ever first question I have that relates to the else function in PHP, I trying to have a code executed if several conditons are true, and another line of code executed if not all are true.
I have 2 lines of text, and in my php statement I have this:

Code:

<?php
$code1 = $_POST['code1'];
$code2 = $_POST['code2'];

echo "1: ";
if ($code1 == $code1) 
{
    echo "Validating... Done.";
}
echo "<br>2: ";
if ($code2 == $code2) 
{
    echo "Validating... Done.";
} else 
{
    echo "Invalid, flushing data and redirecting";
    header("location:error.php");
}
?>

So the thing I'm trying to accomplish is that the site should redirect you to a file called "redirected.php" if all the conditions from the if's are true, and if a single one is wrong, it should do the else, and redirect to "error.php". But how do I make sure it checks all the if's, and if they are true, then redirects?


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#41 08 Apr 2007 5:08 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

if, else, while, for and do, are all whats called "flow control" because they control the flow of execution in a program (and are pretty universal across programming languages).

else is tied to a single if statement (or series of if statements), so if what you want to test is if code1 == something or code2 == something else, otherwise, take some third action, you need to use an else if, or nest your if statements:

series of if statements:

Code:

<?php
$code1 = $_POST['code1'];
$code2 = $_POST['code2'];

if ($code1 == $code1) {
    echo "Validating... Done.";
} else if ($code2 == $code2) {
    echo "Validating... Done.";
} else {
    echo "Invalid, flushing data and redirecting";
    header("location:error.php");
}
?>

nested if statement:

Code:

<?php
$code1 = $_POST['code1'];
$code2 = $_POST['code2'];

if ($code1 == $code1 || $code2 == $code2) {
    if($code1 == $code1) {
        echo "Validating... Done.";
    } else {
        echo "Validating... Done.";
    }
} else {
    echo "Invalid, flushing data and redirecting";
    header("location:error.php");
}
?>

the first example tests if code1 equals some value, if it doesnt, then it tries to see if code2 equals some other value, otherwise (else) it redirects the user.

the second example test both conditions (code1 == something or code2 == something else) otherwise (else) it redirects the user.
then, inside the first statement (since it will only enter here if one of the first two statements are true) it tests which condition brought it here (you only have to test one, because if code1 didn't equal some value, then code2 had to equal what it was tested against (again, or it wouldn't have entered that block).


this if... else if... else block tests for the exclusive condition of one over another.  it has precedence. 

Code:

if($condition1 == $somehting) { 
} else if($condition2 == $something_else) {
} else if($condition3 == $yet_something_else) {
} else {
}

the order of precedence is condition 1 then condition 2 then, lastly condition 3.

if there is no exclusive operation to take place (like what you're wanting to do), then there is no need for an else:

Code:

$value = "nothing";
if($code1 == $something) {
    $value .= ", something";
}
if($code2 == $something_else) {
    $value .= ", something else";
}

if($value === "nothing") {
   // neither condition was true
}

so there, its not an either or, its a pure conditional operation.  we set value if one is true, we'll set the value to something else if the second condition is true, and if neither was true (testing it to see if its still in it original state) then we'll do something else.


when you have an else statement, it must be preceded by an if statement.  the else will only apply to that one if statement that came before it, so in the sample you posted, the else will be entered if the second condition (code2 == something) is false.


one other thing to point out, is that a variable will always equal itself.

Code:

$some_var = 42;
if($some_var == $some_var) {
}

is the exact same as saying:

Code:

if(42 == 42) {
}

or:


Code:

if(true) {
}

that block will always be executed and any else attached to it will never be executed.

Offline

 

#42 09 Apr 2007 3:08 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

I see the point, I am trying to develop these ifs and elses into a authenticity checking system for my new admin area on bamboocommandos.com, but I have yet to figure out how I can deny access to the admin.php site for everyone who is not redirected from a login page I made.


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#43 09 Apr 2007 7:18 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

inside your if that checks the login credentials, you call session_start(), then set a session variable:

Code:

if($authenticated) {
    session_start();
    $_SESSION['authenticated'] = true;
}

then in your admin.php:

Code:

<?php 

if(isset($_SESSION['authenticated']) && $_SESSION['authenticated']) {
    // admin code
}else {
    header("Location: login.php");
}

?>

so if the session times out, then they have to re-log in.

Offline

 

#44 12 Apr 2007 11:23 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Hmm, so admin code would be for example:

Code:

$username = $_POST['username'];
$password = $_POST['password'];
$username_check = "database info";
$password_check = "database info";

if(($username == $username_check) && ($password == $password_check))
{
echo "Admin Area";
} else 
{
echo '<meta http-equiv="Refresh" content="1;url=admin_login.php">';
}

So that it checks that the information submitted on the previous page matches the database one, and if it doesnt it redirects to the login page. When I tried using that header("location:url"); it says

"Warning: Cannot modify header information - headers already sent by (output started at F:\Program Files\xampp\htdocs\admin\admin.php:6) in F:\Program Files\xampp\htdocs\admin\admin.php on line 41"


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#45 14 Apr 2007 10:05 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

but see that only works if something has posted to admin.php... assuming all of your admin.php operations will re-post username / password is the wrong thing to do.

check username / password against that database in the login page, set an authenticated flag in their session and proceed to the admin page.  this will allow the user to be authenticated for the duration of their user session. 

checking the post array in the admin page is not the right thing to do.  you need to check the login info from your login page, and check for authentication in the session from admin.

Offline

 

#46 06 May 2007 10:53 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Ok, I do have a working admin area (just forgot to post and say that I did), now I have almost completed my mass mail system (based on html and php), but a weird checkbox error occurs;

This is the html part of the checkbox-thingy, where you choose who you want to send the mail to:

Code:

<form action="select_new_mail.php" method="post">
<?php
include("../db_connect.php");
$result = mysql_query("SELECT * FROM mail ORDER BY ID DESC");
while($row = mysql_fetch_array($result))
{
$row['id'];
echo '<table width="800" border="0" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td width="50">&nbsp;<font color="#FFFFFF">ID:&nbsp;' . $row['id'] . '</font></td>';
echo '<td width="80">&nbsp;<font color="#FFFFFF">Select:&nbsp;<input type="checkbox" name="check" value="' . $row['mail'] . '"></font></td>';
echo '<td width="150">&nbsp;<font color="#FFFFFF">Nick:&nbsp;' . $row['nick'] . '</font></td>';
echo '<td width="100">&nbsp;<font color="#FFFFFF">Level:&nbsp;' . $row['type'] . '</font></td>';
echo '<td width="420">&nbsp;<font color="#FFFFFF">Mail:&nbsp;' . $row['mail'] . '</font></td>';
echo '</tr>';
echo '</table>';
echo '<br>';
}
?>
<br>
<input name="Submit" type="submit" id="Submit" value=" Next Page ">
&nbsp;&nbsp;&nbsp;&nbsp;
<input name="Reset" type="reset" id="Reset" value="Reset Page">
</form>

I built it like this so that it will make one checkbox for each of the rows in the database, as I have a submit system for adding new mail addresses.

Here is the php part of it, where it goes wrong:

Code:

<?php
echo $check;
echo "<br>";
?>

The weird thing is that it will not echo all the selections I made, instead it only echoes one of them. The php part above is quite simple, and is not the code I will be using in the mail system, it is just to check if it echoes it correctly, which it obviously does not. I find this to be very weird, as I tought the whole point of being able to select several values in the form was to be able to have several values, not just one. Any idea what goes wrong?z


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#47 06 May 2007 4:41 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

you have to name the checkbox something different for each row (might I suggest naming it 'checkbox_'.$row['id'])  otherwise, yea, they all act as one check box (same goes with radio buttons).

Offline

 

#48 07 May 2007 10:28 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Ok, changed the name of the checkboxes to:

Code:

name="check' . $row['id'] . '

So it always has check and the id for the row in it. But how can I make it automatically echo all those rows? Wouldn't I need a array of some sort?


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#49 07 May 2007 10:55 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: How does the "Elseif" statement work?

sorry, not following you there on the "Wouldn't I need a array of some sort?" bit.

Offline

 

#50 07 May 2007 1:59 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: How does the "Elseif" statement work?

Hmm, let me re-phrase;

With a dynamically changing number of check<id>s as name for the checkboxes (everytime I add a row to the database, a new one is made), how can I get the echo on the next page to do the same, namely create an echo for each selection of checkboxes I made on the previous page, so that every box I have checked can be echoed correctly on the next page.


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 



© 2003 - 2019 NullFX
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License