Jump to content

businessman332211@hotmail.com

Members
  • Posts

    304
  • Joined

  • Last visited

Everything posted by businessman332211@hotmail.com

  1. Ok here is the process I have to followIPN "Instant Payment Notification" comes back from paypal.It hits my ipn.php page.I ahve already tested it out, that worksNow i need to(ALL of this I have to do on ipn.php which is where paypal is sending back the information from.)1. Database there user information, using there email address, and hashed password.2. Withdraw there information from the database after entry, using there email address and hashed password.(The purpose is so I can obtain the id number the db associated with the username.3. Database the text they have typed out for there content in a cms table using the userid that was associated with them(for association purposes).4. Create a directory using the person's chosen domain name.4. Based on what template they have chosen(currently template1.php or template2.php), open that specific file, and save the contents of the file to a variable.5. Examine the contents of that variable, and locate the area that is labeled <div class="content">6. Add the following information underneat that line of code within the variable information I have extracted from the file. <?php$select = "SELECT * FROM cms WHERE userid = '$id';";$query = mysql_query($select);if ($row = mysql_fetch_array($query)) {// Display the content they ahd in the database out within the page here}?> 7. Take the new variable containing the alterations that were made(the data insertion), and save it to the directory I had chosen for them, using the name "index.php".8. Close the mysql connection, do garbage collection, and whatever else is needed(no telling how many requests might hit this page at one time).Now that is the process I have come up with, I have gotten help for a few pieces, like opening the file, resaving the file, copying it to another file, creating a directory, ex-cetera.There are a few things I am having trouble planning out before I start.I already set up the sub-domain script itself that he wanted, and it works, so that is taken care of, and the paypal, and ipn integration is already totally complete. All I have to do now get the rest of what I listed finished. I have been planning this a little at a time, and keeping him updated on the progress.Now I have to ask for one more bit of advice, and this is the last thread I will open, I will keep using this one for the rest of my questions on this project, since I got all the information together, and put down full details about what I was doing.Ok I need to figure out how to get the ID number of the user within the file information. I have seen how to insert the information, if I just pass the id to it, will it automatically dynamically put it within the file, as needed or will that be a problem.Once I write out a portion of the code, or write everything out and start testing, this will be the same thread I use if I run into problems or something, so I don't keep opening threads, adn so the full explanation is right here.
  2. I have set up the framework almost for a program. I know it's not a good idea to create new tables dynamically(database tables). At this point though, I have a lot of information going throughpaypal, and coming back to paypal's IPN system. The thing is if I am not careful this could be riddled with security issues, when they finally payout. I am taking either template1.php or template2.php depending on which one they have chosen(more are getting added later), and I am opening it, reading the contents of it, and saving it in a variable. Then I need to find a way to create a cms for it, I need to get the cms put within the file information somehow, as well as decide what table structure in the database I can use for something like this. So they will be able to login to there administration area later on, and do what they need to do??
  3. Ok, that will work.What I was also wondering though.Thanks
  4. Is there a way to take an image of a fileFor instance if you had a .php, or a .htm file and you wanted to screen shot the layout, is there a way to get php to form a picture of it?also I was wonderingOk. say I have a file.I need to take that file, work with it, and save it, as another copy using php.I use get_file_contents, or file open to get the file open, then I can make my changes, then I Have to resave it, is this with file copy or something?
  5. Actually I just now noticed that, but the fix was me changing the data type to int, I had it as varchar in the database, but now I have it as the number, but I think either solutions would have worked, I just wish I had of known that before.
  6. I tried taking that out but it's still not working, I am using mysql, i can't believe this, thanks to this I won't get the bonus for finishing it today, this is really aggravating, I thought I was using it like it was suppose to be used.Even when I blatantly told it, return search results were price was greater than the minimum, but less than the maximum, it still didn't work, I really don't understand this.
  7. still didn't work, the one in there for testing is 80, even if I go show much as a little off on min/max it's not reading itminimum 50 maximum 100it doesn't read it because hte minimum is 50, what's going on.This is what I am using now.$select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' AND price BETWEEN '$searchpricemin' AND '$searchpricemax';";
  8. $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' AND (price BETWEEN '$searchpricemin' AND '$searchpricemax');"; $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' AND price > '$searchpricemin' AND price < '$searchpricemax';"; can someone please help, I have to get this project finished today but thanks to this I won't. I don't thinkit's not searching properly, if the number is like 80, and my min is 70 and max is 95 it returns it, but if I go too high or low from the numbers it doesn't likeminimum- 50maximum- 200then it doesn't return it, what's going on. It's to search the price between a specific range.
  9. actually that's not true. W3schools.com updates there stuff regularly, I honestly see minor/major changes throughout all tutorials from time to time, without ever knowing. Sometimes entirely new tutorials, or entirely new sections. They rewrite codes for some tuturials fairly regularly, as they get requests for new ideas. I am just thinking, someone manual going in, and creating a rough cut of the updates. likeUpdate - 9-23-2006Major UpdatesPhp tutorial- added a few new sections, revised a couple of old ones.Javascript - added a new sectionASP-refined some of the codeMINOR UPDATES and new tutorialsAdded a new ajax tutorialdid some front page text changedEither way you get the point.
  10. actually I just figured that out, what I am hoping someone can do now, is a script analysis, give me there personal advice on the overall script I am declaring it done, but I would hate for 2-3 months of the site being live, they start complaining, and I check and find out this script is somehow causing unexpected errors or somethign I wasn't expecting, especially on a live website. Anyone have any advice?? <?phpsession_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><?phpinclude './includes/meta.inc.php'; // includes meta tags, stylesheet, and javascript inclusion?></head><body><div id="wrap"><?phpinclude './includes/header.inc.php'; // inserts header, logo, and everything up there?> <br style="clear: both;" /> <?phpinclude './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><?phpinclude './includes/banner.inc.php'; // includes the banner, randomly selected from a database?> <?phpinclude './includes/footer.inc.php'; // includes the page footer, bottom navigation copyright?></div></body></html>
  11. it didn't work, I went ahead and tried that just now. It didn't seem to work, anymore advice? I can't get that next link to work, no matter what I do.
  12. of course, I have lot's of projects, a few of which I might turn down, but I would of course have to charge you around 15-20 percent of the total price. I am in the middle of 1 project for 1500 building a classified system1 project for 1000 building a different system1 project for 3000 on a teamed with me and a friend, 1500 a pieceanother person about to send me a projectworking on details with someone about something at the end of this weekdoing 2 minor projects for 2 other peopleand a guy who said he had about 4 people wanting to get phpbb up and running, for around 50-75 which I turned down, because they wanted it skinned and everything, I am sure I can find you something to do, email me, businessman332211@hotmail.com
  13. 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. <?phpsession_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><?phpinclude './includes/meta.inc.php'; // includes meta tags, stylesheet, and javascript inclusion?></head><body><div id="wrap"><?phpinclude './includes/header.inc.php'; // inserts header, logo, and everything up there?> <br style="clear: both;" /> <?phpinclude './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 = 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><?phpinclude './includes/banner.inc.php'; // includes the banner, randomly selected from a database?> <?phpinclude './includes/footer.inc.php'; // includes the page footer, bottom navigation copyright?></div></body></html>
  14. OK,. I worked over all of those issues, can someone tell me why my next link isn't workingOk, I need some help if possible. I did some work on it, and so far it seems that pagination is very, very simple compared to waht I use to think. WHat I want to figure out though, is one thing. Everything seems to work but one thing, that one thing seems to be the actual next link. I have like 4-5 entries in the database, and lowered the limit numbers to 2 so I can test everything to make sure it works, if it all works with 2, then it'll work with 50. so When I tried it, everything worked fine, then when I click the button to go next, it displays the same results instead of new results? Any advice?Code: <?phpsession_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><?phpinclude './includes/meta.inc.php'; // includes meta tags, stylesheet, and javascript inclusion?></head><body><div id="wrap"><?phpinclude './includes/header.inc.php'; // inserts header, logo, and everything up there?> <br style="clear: both;" /> <?phpinclude './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 = 2; $limit = mysql_real_escape_string($limit); if ($_GET['$rownumber']) { $rownumber = $rownumber + 2; $rownumber = mysql_real_escape_string($rownumber); }else { $rownumber = 0; $rownumber = mysql_real_escape_string($rownumber); } // 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 />"; echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumber={$rownumber}\">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><?phpinclude './includes/banner.inc.php'; // includes the banner, randomly selected from a database?> <?phpinclude './includes/footer.inc.php'; // includes the page footer, bottom navigation copyright?></div></body></html>
  15. IF you are trying to help me with this, please ignore the first 2 posts of mine, I posted 3 different posts in this thread. If you notice I did this instead of creating multiple threads, so look at the bottom one if you are going to help, that is the current stage I am at, and now I am totally up against a wall, can't figure this thing out.Ok I ditched all the tutorials, I ditched all this crap. I picked it up and tried to program my own from scratch. I have laid out the framework at the top, and I am going to pass the same stuff to each query, so it should work with each one. here is my code but I ran into a problem with it.You will see I started with general information, i prepared the universal variables. I also prepared my limit, and everything before hand, like it should be prepared. Then I started off testing my first query with this, to see if it was going to work. It didn't I got an error, If you look at the first query, I tried passing it the limit, and the other row number, then at the bottom, I tried create just a next link right now, but it's not working, it started giving me an error, I list that at the bottom. Actually it even shows the next page link, with the variables getting passed through it, but something about my query now is not right.Quote Code: <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 = 50; $limit = mysql_real_escape_string($limit); if ($_GET['$rownumber']) { $rownumber = $rownumber + 50; $rownumber = mysql_real_escape_string($rownumber); }else { $rownumber = 0; $rownumber = mysql_real_escape_string($rownumber); } // 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' SORT BY dateentered LIMIT $limit, $rownumber;"; $query = mysql_query($select); $num_rows = mysql_num_rows($query); while ($row = mysql_fetch_array($query)) { echo "<hr />"; echo "<br />"; echo "<a href=\"view.php\" title\"View Post\">{$row[itemtitle]}-{$row[price]}- {$row[dateentered]}</a>"; } echo "<a href=\"display.php?ps={$postset}&s={$school}&c={$category}&sc= {$subcategory}&rownumber={$rownumber}\">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>
  16. I use sessions for long, I was thinking of using a session array for thislike $_SESSION['pagination'] = array()then create my array variables for the page number, limit number, and everything else. Is this safe, or something that will work.
  17. 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 statementCode: <?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; }?> 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 howThese are related to this 1 page1. 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 dropped2. Pagination, I want to show about 1-200 per page. And hten have multiple pages, based on the number of total search results.
  18. I keep seeing occassionally them adding in new stuff to the tutorials, even entirely new tutorials. I need to find out where to get a list of recent updates, or something, a place where they say, we added stuff likethe date1. we added stuff to the php tutorial. We added this title, this title, we added some information to this title,, and we put up a whole new php section called this2. We added a new tutorial called Blank3. We redid the enitre tutorial on javascript4. we did this5. we did thatjust some place where I can see and know what new stuff they added to the website.
  19. The reason I didn't do that, is because I need to be able to put the stuff within the layout. For instance if there are errors and I did that, they would display at the top, right now they display within the content area of the layout. Which looks a lot more professional. if ($errorhandler != "") {echo "<span class=\"spanred\">";echo $errorhandler;echo "</span>";} This is where I am showing errors, it appears within the content, but if there are no errors, I wanted it to go ahead and proceed with login. So I ended up having to use a link, to finish login.
  20. well I guess that will have to do, for the logout, I got it working with justCode:<?phpsession_start();session_destroy();header("location: /index.php");?>For my other page, I just settled for the, finish the process type of setup.Code: <?phpsession_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><?phpinclude './includes/meta.inc.php'; // includes meta tags, stylesheet, and javascript inclusion?></head><body><div id="wrap"><?phpinclude './includes/header.inc.php'; // inserts header, logo, and everything up there?> <br style="clear: both;" /> <?phpinclude './includes/leftnav.inc.php'; // inserts left navigation?> <div id="content"> <div id="processor"> <h3>Sign Up Completion</h3><?php// signing into database, and preparing for validation and entrymysql_connect("mysql185.secureserver.net", "#####", "#####");mysql_select_db("joyel");// Get information from database to work with$errorhandler = "";$username = mysql_real_escape_string($_POST['username']);$username = strtolower($username);$password = mysql_real_escape_string($_POST['password']);$password = strtolower($password);if ($username == "") {$errorhandler .= "The Login Username was left blank.<br />";}if ($password == "") {$errorhandler .= "The password was left blank.<br />";}if ($errorhandler != "") {echo "<span class=\"spanred\">";echo $errorhandler;echo "</span>";}if ($errorhandler == "") {$password = md5($password);$selectemail = "SELECT * FROM userinfo WHERE email = '$username';";$queryemail = mysql_query($selectemail); if ($rowemail = mysql_fetch_array($queryemail)) { // checks if email exists $selectpass = "SELECT * FROM userinfo WHERE email = '$username' AND password = '$password';"; $querypass = mysql_query($selectpass); if ($rowpass = mysql_fetch_array($querypass)) { $_SESSION['username'] = $rowpass['email']; $_SESSION['schoolaccess'] = $rowpass['schoolname']; $_SESSION['controller'] = true; $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; $_SESSION['lastlogin'] = date("m/d/y"); echo "<p>Please finish the login process by clicking the link below.</p><br />"; echo "<a href=\"/index.php?school={$_SESSION[schoolaccess]}\" title=\"Finish Login\">Finish Login Process</a>"; }else { // Send email to account owner, notifying him of date and time of attempted access // With improper password to his/or her account echo "You have attempted an unauthorized access.<br />"; echo "If you are not the user of this account, please discontinue this activity "; echo "immediately."; echo "The original account owner was sent all of your computer information. If they."; echo "Report the unauthorized attempt to administration you will be banned from the "; echo "site for an indefinite period of time."; $to = "{$rowemail[email]}"; $subject = "www.thecampussource.com: Security Issue"; $newdate = date("m/d/y"); $newtime = time(); $message = " There has been a possible unauthorized attempt on your account. Someone attempted to access your account via your email address, however they provided the wrong credentials. The following information was information we were able to recover from the attempted entry. If you are wondering whether or not this was you, please compare this IP number with your IP number for a match, if there was no match, then please contact administration, with the IP number of the person who attempted unauthorized access, with a forwarded version of this email, and we will investigate, and possible ban that user from the site.IP Address: {$_SERVER['REMOTE_ADDR']}Possible Browser: {$_SERVER['HTTP_USER_AGENT']}Date of Attempt: {$newdate}Possible Time Of Attempt: {$newtime}";$headers = "From: Administrator@thecampussource.com"; mail($to, $subject, $message, $headers);} // end security measure }else { echo "There is no point in continuing with the process. your email does not exist "; echo "within our database. Please double check your email address, register, or contact "; echo "support if you feel you recieved this message in error.<br />"; }} // close error handler check?> </div> </div><?phpinclude './includes/banner.inc.php'; // includes the banner, randomly selected from a database?> <?phpinclude './includes/footer.inc.php'; // includes the page footer, bottom navigation copyright?></div></body></html> Also, you know, if anyone has any advice, on how I can make that login processor page redirect automatically back to the homepage, and have it work, It would be greatly appreciated, but if not I can live with this.
  21. <?phpif (!$_GET['redirect']=='dw') exit('bad link');$page = $_GET['redirect'];$email = $_GET['email'];mail("jitu@asicip.com", "Asic Ip Download Access", "Someone has access {$page} using {$email}");header('Location: ' . $page);?> That worked, you see what's confusion me. I had it send an email first, then sent the redirect, there has to be a way to make this work, if not how am I suppose to send them back to the index page after they log in???
  22. I am trying to redirect someone to another location after they login. I need it to do what it needs to do, and redirect them back to the homepage, set on what school they are suppose to, so I have to pass school through itheader("Location: index.php?school={$_SESSION[schoolaccess]}"); That is what I have, but it is saying header allready sent, I thought the location header could be sent anywhere??incase if it helps. The code is below. <?phpsession_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><?phpinclude './includes/meta.inc.php'; // includes meta tags, stylesheet, and javascript inclusion?></head><body><div id="wrap"><?phpinclude './includes/header.inc.php'; // inserts header, logo, and everything up there?> <br style="clear: both;" /> <?phpinclude './includes/leftnav.inc.php'; // inserts left navigation?> <div id="content"> <div id="processor"> <h3>Sign Up Completion</h3><?php// signing into database, and preparing for validation and entrymysql_connect("mysql185.secureserver.net", "######", "##########");mysql_select_db("joyel");// Get information from database to work with$errorhandler = "";$username = mysql_real_escape_string($_POST['username']);$username = strtolower($username);$password = mysql_real_escape_string($_POST['password']);$password = strtolower($password);if ($username == "") {$errorhandler .= "The Login Username was left blank.<br />";}if ($password == "") {$errorhandler .= "The password was left blank.<br />";}if ($errorhandler != "") {echo "<span class=\"spanred\">";echo $errorhandler;echo "</span>";}if ($errorhandler == "") {$password = md5($password);$selectemail = "SELECT * FROM userinfo WHERE email = '$username';";$queryemail = mysql_query($selectemail); if ($rowemail = mysql_fetch_array($queryemail)) { // checks if email exists $selectpass = "SELECT * FROM userinfo WHERE email = '$username' AND password = '$password';"; $querypass = mysql_query($selectpass); if ($rowpass = mysql_fetch_array($querypass)) { $_SESSION['username'] = $rowpass['email']; $_SESSION['schoolaccess'] = $rowpass['schoolname']; $_SESSION['controller'] = true; $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; $_SESSION['lastlogin'] = date("m/d/y"); $url = "http://www.thecampussource.com/index.php?school={$_SESSION['schoolaccess']}"; header("Location: {$url}"); }else { // Send email to account owner, notifying him of date and time of attempted access // With improper password to his/or her account echo "You have attempted an unauthorized access.<br />"; echo "If you are not the user of this account, please discontinue this activity "; echo "immediately."; echo "The original account owner was sent all of your computer information. If they."; echo "Report the unauthorized attempt to administration you will be banned from the "; echo "site for an indefinite period of time."; $to = "{$rowemail[email]}"; $subject = "www.thecampussource.com: Security Issue"; $newdate = date("m/d/y"); $newtime = time(); $message = " There has been a possible unauthorized attempt on your account. Someone attempted to access your account via your email address, however they provided the wrong credentials. The following information was information we were able to recover from the attempted entry. If you are wondering whether or not this was you, please compare this IP number with your IP number for a match, if there was no match, then please contact administration, with the IP number of the person who attempted unauthorized access, with a forwarded version of this email, and we will investigate, and possible ban that user from the site.IP Address: {$_SERVER['REMOTE_ADDR']}Possible Browser: {$_SERVER['HTTP_USER_AGENT']}Date of Attempt: {$newdate}Possible Time Of Attempt: {$newtime}";$headers = "From: Administrator@thecampussource.com"; mail($to, $subject, $message, $headers);} // end security measure }else { echo "There is no point in continuing with the process. your email does not exist "; echo "within our database. Please double check your email address, register, or contact "; echo "support if you feel you recieved this message in error.<br />"; }} // close error handler check?> </div> </div><?phpinclude './includes/banner.inc.php'; // includes the banner, randomly selected from a database?> <?phpinclude './includes/footer.inc.php'; // includes the page footer, bottom navigation copyright?></div></body></html>
  23. The reason noone can see the php information is because when it hits the browser, it's not there to see. The idea of the php processor is to take the php, and at some point output something. To the browser, or only output certain things based on certain conditions, like using includes in an if statement or something. So they request the page, it goes to the processor, it runs the program, and turns whatever it needs to into xhtml output, or css/javascript output if you are using it to output one of those, or vb script then it returns it to the browser, where it ends up running just naturally, as if it had been done with plain static pages, except the output is done with php, but the php is no longer there, just the xhtml/css/javascript or whatever markup that the php processor created with what you told it to create, with echo's and the like.
  24. I had actually totally dropped this for lack of time, but I will do what I can to get this working, I like the advice, when I have time to go back and try that again, I think that will help a lot I am saving hte post.
  25. I did all the layout planning, but everytime I code it, something doesn't work out, I plan the layout, then get ready to start the coding, and find cross browser compatibility issues, amount other things, when I finally had it right, it had resolution issues(issues in higher resolution monitors), and it wasn't working like that either.
×
×
  • Create New...