Jump to content

simcoweb

Members
  • Posts

    1,104
  • Joined

  • Last visited

Everything posted by simcoweb

  1. he could also use if ($num_rows == 1) {
  2. Thanks, jesirose.. my fingers got ahead of me :)
  3. You're missing a closing } to your first 'else' statement. Put it just before your closing ?> php tag.
  4. Ok, I think I understand. This bit of code confuses me, however: [code]<?php   if (count($errors) < 1) {   } else { $msg = "<p class=\"error\">The following errors have occurred: " . implode('<br />', $errors) . "</p>\n";   } } ?>[/code] Basically what it's saying is IF the number of errors is less than 1... blah blah. But the blah blah doesn't get to happen because you immediately 'else' it. It's in place of the 'else' that you would execute your error display code then after that you'd 'else' it.
  5. Personally i've not seen where the line can end with a curly bracket instead of the required ; Here's the format I use for errors and it never has an issue: [code]<?php if ($username=="") {         $err.= "Please provide a username<br/>";     }     if (!$email) {         $err.= "Please provide your email address<br>";     }     if ($email) {         if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {             $err.= $email. " is not a valid email address.<br/>";         }     }     if ($password=="") {         $err.= "Please provide password<br/>";     }     if ($confirmPass=="") {     $err.= "Please confirm your password.<br/>"; } if ($confirmPass != $password) {   $err.= "Your passwords do not match. Please re-enter your passwords."; } ?>[/code] etc. etc.  Notice it is checking several things like IF it's empty or IF it doesn't match, etc.
  6. I was gonna say, personally i've not seen that 'if' statement written in that format. Here's what I use; $num_rows = mysql_num_rows($result); if ($num_rows => 0) {     echo "Our database shows this username has already been registered. Please choose another username."; } else {     echo "WORKING!"; } Also, your mysql connection is missing one vital ingredient. The database name: mysql_select_db("database_name");
  7. You're missing a { here: [code]if(0 != mysql_num_rows($result)) [b]{[/b][/code] And that's assuming you adapted c4onastick's changes also as that open 'if' statement will produce another error. If statements always have code to run and that code is between curly's: if ($this_does_not_work == true) {   echo "This does not work"; }
  8. I believe what you need is this function: strtotime() which converts dates to timestamp format. http://us3.php.net/strtotime
  9. Ok, I see that now. Learn something new each day! :)
  10. Hi. I'm a bit confused with the code since it appears that your form drop down selector is going to have one big choice of all three of those options in one option. $pulldown1 = '<option>Select One</option>'; Then two lines down you concatenate it with two other choices: $pulldown1 .= "<option value=\"{$row['order_number']}\">{$row['order_number']}) {$row['test_ordered']}</option>\n"; If I read this right it will produce a display of one option containing all three choices. Or maybe i'm not reading that right? Getting information displayed about a particular row (or in this case a particular person) only requires you have the query specify a unique identifier...like an 'id' field. [code]$query1 = "SELECT * FROM orders  WHERE id='$id' ";[/code] Where the 'id' is passed in your search form. Or, the order_id or whatever you want to search by. Make sense? Then, that query would work like this: [code]<?php $query1 = "SELECT * FROM orders  WHERE id='$id' "; $results = mysql_query($query1); echo "<table><tr>         <th>Field 1</th><th>Field 2</th><th>Field 3</th><th>Field 4</th>         </tr>"; while ($row = mysql_fetch_array($results)) {       echo "<tr><td>" . $row['field1'] . "</td><td>" . $row['field2'] . "</td><td>" . $row['field3'] . "</td><td>" . $row['field4'] . "</td>               </tr>"; } echo "</table>\n"; ?> [/code] That will produce a table with field names at the top (the <th> tags) and a row for each result (presumably one row).
  11. Try taking the '.' 's out of your extension array.
  12. Ok, where is the session variable being transferred to? There's no mention of a session_start(); in the posted. code. Is it in the header file?
  13. Ok, in the 2nd and 3rd pages you need to add the 'name' attribute to the fields. If you have 'globals' turned on use this method: <input type='hidden' name='username' value='<?php echo $username;?>'> If turned off then this method: <input type='hidden' name='username' value='<?php echo $_POST['username'];?>'>
  14. Am I missing something here or should those escape characters be "\" backslashes instead of "/" 's ?
  15. After step one when they get to step two are these two variables getting populated? <?php echo $_POST["fname"]; ?> <?php echo $_POST["sname"]; ?>, Welcome To One Time Deals<br />
  16. Are you getting a specific error?
  17. Judging from your $query, you're getting this info from a form? If so, just post the variables ahead of your while loop so you can use them again: $banner = $_POST['banner']; Then you can echo it anywhere.
  18. If i'm understanding correctly, you are hosting images for people and you want to provide them with the url to their image?
  19. 'NULL' is not a value. That's a setting. Strip out the reference to your non-used table fields and simply have the INSERT specify just the info field. [code] <? $info = $_POST["info"]; include("dbconnect.php"); $profile=MYSQL_QUERY("INSERT INTO account 'info' VALUES '$info "); echo("Profile updated!"); ?>[/code]
  20. A form with no 'action' is a form that will not work :) You can have multiple forms with the same name but why would you do that?  ??? What are the field settings for your textarea data in your mysql database?
  21. Yep, we learn something new everyday here :)
  22. Do you HAVE to use Iframes? You can simply 'include' the PHP files into the page(s) with creating an IFrame.
×
×
  • 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.