Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. I am doing some pre-project research, and I have to find one of those.  But he wants one for less than 1k a month and that's what he was priced, any advice on cheapones, they have to be 1. dedicated ip web hosts 2. have wildcarded dns(where a script can create sub-domain names 3. High version of php & mysql
  2. actually if I just use if (!is_numeric($variable)) { echo "$variable has to be a number, please go back and correct this"; } Won't that guarantee that it's a number, then I can just add the dollar sign on there.
  3. Is there a way for me to test something. like if I have an input, I need to make sure it's a number, I can do this with is_number($variable); it will tell me if it's a number, that's easy, but then I have to check to see if it's got the $ symbol in front of it, if it doesn't then I need to put one there, if it does then I need to leave it alone, how can I do this???
  4. I know, that is something I always do.  I do that for get, post, session, and sometimes even variables I create, to avoid any possibilty.  There may not be a possibility, but incase if there is, then it's there, incase
  5. Someone told me something vaguely similar, as a favor can you explani that to me, so I understand the point.  I want advice from everyone here, this is NOT asking for help this time, this is asking for a script analysis I guess you could call it.  I have finished the whole thing, it has previous and next buttons, I have to go back and do my queries( like what they are displaying) because the data will be different for each one.  I just don't want to get to the point where I go ahead and say it's finished, and then 2 months from now they are complaining about something to do with the site, and it ends up being something with teh  pagination system that didn't go right.  If you can just look over everything, tell me if everything is right, if you don't see any problems then I am declaring it done.  It works right for both previous and next pages, and everything seems to work properly.??  Is there anything i Missed before I declare it done. [code]<?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php include './includes/meta.inc.php'; // includes meta tags, stylesheet, and javascript inclusion ?> </head> <body> <div id="wrap"> <?php include './includes/header.inc.php'; // inserts header, logo, and everything up there ?>     <br style="clear: both;" /> <?php include './includes/leftnav.inc.php'; // inserts left navigation ?>     <div id="content">         <div class="overall"> <h3>Postings</h3> <?php // connect to database mysql_connect("mysql185.secureserver.net", "####", "#####"); mysql_select_db("joyel"); // get together the critical variables, and clean them up. $postset = mysql_real_escape_string($_GET['ps']); $school = mysql_real_escape_string($_GET['s']); $category = mysql_real_escape_string($_GET['c']); $subcategory = mysql_real_escape_string($_GET['sc']); $limit = 50; $limit = mysql_real_escape_string($limit); if ($_GET['rownumberprev']) { $rownumber = mysql_real_escape_string($_GET['rownumberprev']); }elseif ($_GET['rownumbernext']) { $rownumber = mysql_real_escape_string($_GET['rownumbernext']); }else { $rownumber = 0; } // go through databases.  Easier to keep up with, let's start with database number 1 switch ($postset) { // Work with database postset1 case "postset1": // test query for total row numbers $testselect = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $testquery = mysql_query($testselect); $total_rows = mysql_num_rows($testquery); // query db $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; $temp = true; } if ($temp != true) { echo "We apologize but there were no results"; } echo "<hr />"; if ($rownumber != 0) { $rownumberprev = $rownumber - 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - 50)) { $rownumbernext = $rownumber + 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; } break; // work with database postset2 case "postset2": // test query for total row numbers $testselect = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $testquery = mysql_query($testselect); $total_rows = mysql_num_rows($testquery); // query db $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; $temp = true; } if ($temp != true) { echo "We apologize but there were no results"; } echo "<hr />"; if ($rownumber != 0) { $rownumberprev = $rownumber - 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - 50)) { $rownumbernext = $rownumber + 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; } break; // work with database postset3 case "postset3": // test query for total row numbers $testselect = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $testquery = mysql_query($testselect); $total_rows = mysql_num_rows($testquery); // query db $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; $temp = true; } if ($temp != true) { echo "We apologize but there were no results"; } echo "<hr />"; if ($rownumber != 0) { $rownumberprev = $rownumber - 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - 50)) { $rownumbernext = $rownumber + 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; } break; // work with database postset4 case "postset4": // test query for total row numbers $testselect = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $testquery = mysql_query($testselect); $total_rows = mysql_num_rows($testquery); // query db $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; $temp = true; } if ($temp != true) { echo "We apologize but there were no results"; } echo "<hr />"; if ($rownumber != 0) { $rownumberprev = $rownumber - 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - 50)) { $rownumbernext = $rownumber + 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; } break; // work with database postset5 case "postset5": // test query for total row numbers $testselect = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $testquery = mysql_query($testselect); $total_rows = mysql_num_rows($testquery); // query db $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; $temp = true; } if ($temp != true) { echo "We apologize but there were no results"; } echo "<hr />"; if ($rownumber != 0) { $rownumberprev = $rownumber - 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - 50)) { $rownumbernext = $rownumber + 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; } break; // work with database postset6 case "postset6": // test query for total row numbers $testselect = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $testquery = mysql_query($testselect); $total_rows = mysql_num_rows($testquery); // query db $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; $temp = true; } if ($temp != true) { echo "We apologize but there were no results"; } echo "<hr />"; if ($rownumber != 0) { $rownumberprev = $rownumber - 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - 50)) { $rownumbernext = $rownumber + 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; } break; // work with database postset7 case "postset7": // test query for total row numbers $testselect = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $testquery = mysql_query($testselect); $total_rows = mysql_num_rows($testquery); // query db $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; $temp = true; } if ($temp != true) { echo "We apologize but there were no results"; } echo "<hr />"; if ($rownumber != 0) { $rownumberprev = $rownumber - 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - 50)) { $rownumbernext = $rownumber + 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; } break; // work with database postset8 case "postset8": // test query for total row numbers $testselect = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $testquery = mysql_query($testselect); $total_rows = mysql_num_rows($testquery); // query db $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; $temp = true; } if ($temp != true) { echo "We apologize but there were no results"; } echo "<hr />"; if ($rownumber != 0) { $rownumberprev = $rownumber - 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - 50)) { $rownumbernext = $rownumber + 50; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; } break; } ?>         </div>     </div> <?php include './includes/banner.inc.php'; // includes the banner, randomly selected from a database ?> <?php include './includes/footer.inc.php'; // includes the page footer, bottom navigation copyright ?> </div> </body> </html>[/code]
  6. Yes, on the index page, test for sessions.  If there not set, then redirect them to a page, on that page, tell them there sessions are expires, ask them if they want to renew, if they do renew them from the db,.
  7. Yes that all works, even the previous link disappears when it's suppose to.  They both work perfectly as far as functionality, I just need it to disappear when it reaches the end.
  8. I have it set going back 2 and forward 2 I am increasing that to 50, that is how many records it's going to jump For instance if my limit is 50, the starting row is 0, the first record set is 0-50, after that 50-100 then 100-150 well you get the point.  But you see what I mean.  I need to get the next link changed, hten I am changing all of those to 50.
  9. It doesn't kill all sessions for all user's sessions are user specific. If user a logs in, and it registers a bunch of sessions, and 4 other people login 2, and oen logs out, and it takes them to 1 page that has nothing but [code]<?php session_destroy(); header("Location: index.php"); ?>[/code] The session file associated with that one user is erased, all the others are left alone.
  10. The previous link was showing no matter what, and even at the beginning, if they hit it, it changed to -2, so it kept going, I fixed that with what I showed earlier, now for some reason the next link's not working.  I need it to disappear, I even created a test query to get the total number of rows from the database, and still can't figure out anything to make the next link disappear, I just want to make it to where when it get's to the final page of results, then it makes the next link disappear.  But nothing at this point seems to be working.
  11. [code] <?php if ($rownumber != 0) {    $rownumberprev = $rownumber - 2;    echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } ?> [/code] That seemed to have fixed up the previous link properly, it seems to be working, but nothign seems to be working for the next link.
  12. shit, that never happened before.  I have been dealing with a lot later, 2 days ago, I spent 11 hours of doing the hardest programming I ever had before straight.  Then I spent 4 hours the next day(yesterday, tuesday), finishing that up, then about 8 hours of even harder programming, followed up by pagination today(which was the hardest), so because of that, I guess I am getting a little burnt out.  Now I am stuck on this and it's not working, I changed that by the way, but now I looked at the variables, when the first page comes up, $rownumber is first set to 0 when I go if ($rownumber == 0) { // echo the previous link } then it still displays the previous link??
  13. By the way I asked this after awhile of fighting with the different greater than less than, and equal to or less than, and equal to or less that, trying to use a variety of combinations of numrows, and record number, to try and make previous disappear, when there are none before, and vice versa, but nothing worked.
  14. After 3-4 cups of coffee, 2 headaches, and a major brain cramp, I finally have gotten a skeleton, workable system for pagination, and a thourough understanding of the basic concept behind it, so I can replicate it later, or customize it more when I have all this set in.  For now I am against a wall, Ihave encountered 2 things with my script, and no matter how hard I think at this point, I cannot figure these 2 things out. THe system it self works perfectly, it is set up right, and for it to keep working, I can just change the number to 50, and it will use 50 results, as well as I can put it on every case switch and it will all work properly, the thing here is though, it works.  However there are 2 issues I can't figure out. 1. If they try to go previous, for instance if they go next 1 time, then previous 2 times, it passes there current script, adn starts showing a blank page, it keeps lessening that number, and never stops, so each time you hit previous, it goes to another blank page.  2. The same for next, you can keep going to next for ever.  How can I factor in when to make it now show next, and not show previous, I don't want those showing up if there is nothing there, any advice on how I can fix this. [code]<?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php include './includes/meta.inc.php'; // includes meta tags, stylesheet, and javascript inclusion ?> </head> <body> <div id="wrap"> <?php include './includes/header.inc.php'; // inserts header, logo, and everything up there ?>     <br style="clear: both;" /> <?php include './includes/leftnav.inc.php'; // inserts left navigation ?>     <div id="content">         <div class="overall"> <h3>Postings</h3> <?php // connect to database mysql_connect("#######", "#####", "######"); mysql_select_db("joyel"); // get together the critical variables, and clean them up. $postset = mysql_real_escape_string($_GET['ps']); $school = mysql_real_escape_string($_GET['s']); $category = mysql_real_escape_string($_GET['c']); $subcategory = mysql_real_escape_string($_GET['sc']); $limit = 2; $limit = mysql_real_escape_string($limit); if ($_GET['rownumberprev']) { $rownumber = mysql_real_escape_string($_GET['rownumberprev']); }elseif ($_GET['rownumbernext']) { $rownumber = mysql_real_escape_string($_GET['rownumbernext']); }else { $rownumber = 0; } // go through databases.  Easier to keep up with, let's start with database number 1 switch ($postset) { // Work with database postset1 case "postset1": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' ORDER BY dateentered LIMIT $rownumber, $limit;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); echo "<hr />"; while ($row = mysql_fetch_array($query)) { echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; echo "<br />"; } echo "<hr />"; echo "<br />"; $rownumberprev = $rownumber - 2; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; $rownumbernext = $rownumber + 2; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumbernext={$rownumbernext}\">Next Page</a>"; break; // work with database postset2 case "postset2": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); while ($row = mysql_fetch_array($query)) { } break; // work with database postset3 case "postset3": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); while ($row = mysql_fetch_array($query)) { } break; // work with database postset4 case "postset4": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); while ($row = mysql_fetch_array($query)) { } break; // work with database postset5 case "postset5": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); while ($row = mysql_fetch_array($query)) { } break; // work with database postset6 case "postset6": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); while ($row = mysql_fetch_array($query)) { } break; // work with database postset7 case "postset7": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); while ($row = mysql_fetch_array($query)) { } break; // work with database postset8 case "postset8": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); while ($row = mysql_fetch_array($query)) { } break; } ?>         </div>     </div> <?php include './includes/banner.inc.php'; // includes the banner, randomly selected from a database ?> <?php include './includes/footer.inc.php'; // includes the page footer, bottom navigation copyright ?> </div> </body> </html>[/code]
  15. [code]<?php         include("include/emails.php");   include("include/common.php");         $subject = "Forgotten password"; $email = mysql_real_escape_string($_POST['email']); $select = "SELECT username, password FROM users WHERE email = '$email';"; $result = mysql_query($select);         if($row = mysql_fetch_array($result)) { $to = "{$email}"; $subject = "Username and password"; $message = " Username: {$row[username]} Password: {$row[password]} "; if (mail($to, $subject, $message,"From: $adminemail")) { echo "Your details have been sent to your email."; }else { echo "There was a problem sending the email"; } }           ?>[/code]
  16. It would depend as he said, where the database is stored, if it's in the database $select = "SELECT * FROM tablename WHERE column = 'value';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { echo $row['whatever']; } that will show just one thing, not the best script but it was written hastilly.
  17. Also your form is severely bloated, you could probably cut that down to about 10-12 lines for the form, and use css to style it, instead of about 30-40 lines of wasted space.  Also whether you are a php programmer, it only takes about 2 days to learn how to program form validation and email sending.  Using a third party script is normally not as secure. 
  18. What's it doing, is it returning an error, is it not working, how is it not working, what's it doing.
  19. I was told earlier something about session arrays. Can I save this information in a session lile $_SESSION['pagination'] = array() and set the array with the different variables for count and stuff.  I was thinking about this now, because if I can, and it will keep it seperate totally from the logged in related sessions, then I think it would be a good idea.  Then again, won't it make them come back to those search pages, everytime.  Is there a bad thing about setting it up this way.
  20. actually what I Found on google, it returns that id resource, in order to get the information you have to run mysql_fetch_array() to it, after the query that was just something I read on google somewhere just now though
  21. By looking at the query I would say you are going about it the wrong way, and it's severely insecure.  Take each varaible, and pass them into a smaller variable, and pass those to the query like $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); ex cetera on all of those, then build a simpler query to help you find the problem. Like $sql = "INSERT INTO plateau_pros (username, password, confirmpass, firstname, lastname, email, business, title, address, city, zip, phone, fax, mobile, category, comments, specialties, photo) VALUES ('$username', '$password', '$confirmpass' and so on, and so forth, if you get resource id area, create a debug script(wildteen taught me that) like $debug = " /n DEBUG INFORMATION: echo Contents of user: {$username} echo Contents of Password: {$password}"; and so forth, then whenever you need to debug, call that variable, and it'll tell you all the contents, of all the variables, you can hunt down the problem that way. $sql = "INSERT INTO `plateau_pros`(`username`, `password`, `confirmPass`, `firstname`, `lastname`, `email`, `business`, `title`, `address`, `city`, `zip`, `phone`, `fax`, `mobile`, `category`, `comments`, `specialties`, `photo`) VALUES('".@$_POST['username']."', '".@$_POST['password']."', '".@$_POST['confirmPass']."', '".@$_POST['firstname']."', '".@$_POST['lastname']."', '".@$_POST['email']."', '".@$_POST['business']."', '".@$_POST['title']."', '".@$_POST['address']."', '".@$_POST['city']."', '".@$_POST['zip']."', '".@$_POST['phone']."', '".@$_POST['fax']."', '".@$_POST['mobile']."', '".@$_POST['category']."', '".@$_POST['comments']."', '".@$_POST['specialties']."', '".substr(strrchr($eg_uploadFile1, "/"), 1)."'), $eg_objConn1"; mysql_query($sql) or die(mysql_error()); $newid = mysql_insert_id();
  22. file_get_contents() or fopen or something similar then use regular expressions for whatever you need,.
  23. If it's a resource id, it means it' snot returning any information. check to make sure your table names match your query, as well as your fields.
  24. I put it off on an older project.  I didn't know how at the time, and that site won't need it for a long time.  This one however, is a project I have no choice but to use that on.  Expcept that the layout behind hte programming is like 8 search results for each section, on one page. In a giant case switch statement [code]<?php // get together the critical variables, and clean them up. $postset = mysql_real_escape_string($_GET['ps']); $school = mysql_real_escape_string($_GET['s']); $category = mysql_real_escape_string($_GET['c']); $subcategory = mysql_real_escape_string($_GET['sc']); // go through databases.  Easier to keep up with, let's start with database number 1 switch ($postset) { // Work with database postset1 case "postset1": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { } break; // work with database postset2 case "postset2": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { } break; // work with database postset3 case "postset3": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { } break; // work with database postset4 case "postset4": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { } break; // work with database postset5 case "postset5": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { } break; // work with database postset6 case "postset6": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { } break; // work with database postset7 case "postset7": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { } break; // work with database postset8 case "postset8": $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school';"; $query = mysql_query($select); if ($row = mysql_fetch_array($query)) { } break; } ?>[/code] looking on this, it is obvious I haven't actually started working with displaying yet. I have 2 things I am having to do here, and neither one of them I am 100% sure on how to do.  I am going to pull just the title of the title out and display it(that will be the results), but it will be a link going to one of the results page.  That part is easy, just have it appear as a link, and past the post id to one of the 8 table handlers.  I have 8 pages, 1 for each table results, or maybe even 1 page with another switch statement to handle them all, whatever, that's easy.  For this though, on this page, I am just shwoing the title of the post.  That is also pretty easy.  Now here comes the difficult thing, I have 2 goals i have to accomplish and I am not sure how These are related to this 1 page 1. Seperate them by date.  I have the date saved in the database, of when they were posted, but I am unsure, (sort of  like craigslist), to allow them to show a date, everything for that date, show the next date, and everything for that date.  That type of setup.  Then after 30 days the admins clear it, and the ones older than 30 days are dropped 2. Pagination, I want to show about 1-200 per page.  And hten have multiple pages, based on the number of total search results.
×
×
  • 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.