simcoweb
Members-
Posts
1,104 -
Joined
-
Last visited
Everything posted by simcoweb
-
I can't believe I forgot the $'s.
-
So you want it to just display ALL instances of Duct Tape as one item in a list?
-
if((a == b) || (b == c)){ echo "execute your code here"; } else { echo "nothing equalled anything"; } if((a == b) and (b == c)) { echo "execute your code here"; } else { echo "nothing matched so nothing done"; }
-
I would assume you already have people registering as a member on your site? If not, there's no way they'd know who is who.
-
Try this: <?php include 'database.php'; $sql = "SELECT * FROM userstable"; $results = mysql_query($sql) or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>userid</th> <th>name</th> </tr>"; while($row = mysql_fetch_array( $results )) { echo "<tr><td>"; echo $row["userid"]; echo "</td><td>"; echo $row["name"]; echo "</td></tr>"; } echo "</table>"; ?>
-
[SOLVED] POST variables apparently not working
simcoweb replied to Nilesta's topic in PHP Coding Help
You might want to try it this way: include 'auth.php'; if (isset($_POST['submit'])){ $UserName = $_POST['name']; $Password = $_POST['pass']; $Result = Login($UserName, $Password); }else{ $Result = 4; }; -
You would use an 'if' statement something like: if($_POST['username'] = 'admin') { header("Location: adminpage.php"); } if($_POST['username'] = 'staff01') { header("Location: staff01page.php"); } if($_POST['username'] = 'staff02') { header("Location: staff02page.php"); }
-
Looping MySQL Results into multicolumn table
simcoweb replied to sford999's topic in PHP Coding Help
I use this for multiple columns that are determined by the number of entries. Modify the HTML output a bit to suit your column headings and it should work. The references to the links, of course, would need to be modified as well: // run query $sql = "SELECT * FROM subcategories WHERE cat_id='2'"; $results = mysql_query($sql) or die(mysql_error()); // display results $totalColumns = 2; $i = 1; echo "<table border='0' cellpadding='2'>"; while ($row = mysql_fetch_array($results)){ if ($i == 1) echo "<tr>"; echo "<td>"; echo "<a href='getcat.php?subcat_id=". $row['subcat_id'] . "'>" . $row['subcat_name'] . "</a>"; echo "</td>"; if ($i == $totalColumns) { echo "</tr>"; $i = 0; } $i++; } echo "</table>"; -
Re-populating text fields for Image Upload?
simcoweb replied to Solarpitch's topic in PHP Coding Help
Ok, you have this: name="Submit" but in my code I had: name="submit" with lower case S. Change it to uppercase and give it a try. -
Re-populating text fields for Image Upload?
simcoweb replied to Solarpitch's topic in PHP Coding Help
Well, then let me ask you a question. What is the name of your 'submit' button in your form code? -
[SOLVED] Retrieving Data from Multiple Tables???
simcoweb replied to kemper's topic in PHP Coding Help
Simply by changing your query. The WHERE is looking for a value from $division right now. If you change it to $division_id then the value would be passed from the form. -
I am looking for a checkbox (yes/no) orientated PHP script
simcoweb replied to Danosaur's topic in PHP Coding Help
First, create a form that has the checkbox selections. Then you'd build the query to write either to a file or database, your choice. This wouldn't be an 'upload' script. Simply gathering data and storing it. -
[SOLVED] Retrieving Data from Multiple Tables???
simcoweb replied to kemper's topic in PHP Coding Help
First, this line is wrong. Your WHERE doesn't match the variable you've named: $sql = "SELECT * FROM `f2007_scheduling` WHERE division='$division' ORDER BY date ASC"; should be: $sql = "SELECT * FROM `f2007_scheduling` WHERE division='$division_id' ORDER BY date ASC"; -
Re-populating text fields for Image Upload?
simcoweb replied to Solarpitch's topic in PHP Coding Help
You can try this: <input style="width:200px;" name="userfile" type="file" id="menu_textbox" value="<? if(isset($_POST['submit'])) echo $_POST['userfile']; ?>"> -
Let me see if i'm clear on your question....you want someone to write the code for you?
-
You might try doing the query this way: $sql = "INSERT INTO parasite (parasitename, parasitefrom, parasitegenre, parasitedescription, parasiteremoval) VALUES ('$parasitename', '$parasitefrom', '$parasitegenre', '$parasitedescription', '$parasiteremoval')";
-
Normally those are determined using a set of keywords associated with the pics. Having a database field for either a description or keywords or both would do the trick.
-
One thing right off the bat: $checkfilename= "select id from $table where file='".$POST['file']."';"; Take off the last "; You duplicated it.
-
<font face="Arial" size="2" color="#FFFFFF">Username</font>
-
Might be a silly question, but is your page named with a .php extension?
-
Question: Even though they may change order, the question id's or field names don't change. Correct?