Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. Well sort of, that is on the right track.  I need to search ALL the or fields, and pull results out of whichevers match, but the other's before that, including the school name, HAVE to match 100%.  Then everything else I need it to go through checking each one, and pulling out all the results from them
  2. I am having to make a query with and's but also with or's. See the ones that have to match are category, subcategory, and schoolname.  THen I also want to have like an open source query $select = "SELECT * FROM $postset WHERE categoryname = '$category' AND subcategoryname = '$subcategory' AND schoolname = '$school' OR itemtitle LIKE '%$search%' OR description LIKE '%$search%';"; See how i need to make sure it stays within that category, subcategory and schoolname, but the other part is selecting based on different criteria.  Is this the right way to go about this??
  3. I have a table called price inside there, it's going to say a number just a regular number then for minimum maximum price the person can put 30 70 which 30 is minimum 70 is maximum this is going to search in the database, for all the results within that range.????
  4. show the page processing the form.
  5. actually yes they are, but they are post information coming from a get, or post variable.  I have 8 tables postset1 postset2 ... postset8 and that postset number is set throughout the site, in url's and forms to pass what information along.  Like when they can edit, delete posts, it goes to a page with a case switch statement, deciding which post, userid, and postid, to pull the post from, then it updates it based on the switch on $postset and yes that was the exact post I was speaking of. [b]POST MERGED BY WILDTEEN88: Please learn to use the edit button. DO NOT DOUBLE post. EVen to bump your thread too! You only bump your thread when its a a couple of hours old[/b]
  6. Uhh this is very not cool, I have one of my largest pages, after I finished programming it, it gave me a $ at end of file warning.  This means I left  a ; out somewhere a $ out somewhere, or misaligned braces, can you see anything, I have went over it 6-7 times. [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>Ad Posting Process</h3> <?php // connecting to database, selecting database mysql_connect("mysql185.secureserver.net", "######", "####"); mysql_select_db("joyel"); // This is the final process basically. Only run these queries if it's recieving a special post // which would be variable named command, value set to yes.  Upon seeing this, then take the proper post information from post, and update the database accordingly. if ($_POST['command'] == "yes") { // basic universal variables $postset = mysql_real_escape_string($_POST['postset']); $postid = mysql_real_escape_string($_POST['postid']); $userid = mysql_real_escape_string($_POST['userid']); switch ($postset) { case "postset1": $itemtitle = mysql_real_escape_string($_POST['itemtitle']); $price = mysql_real_escape_string($_POST['price']); $description = mysql_real_escape_string($_POST['description']); $zipcode = mysql_real_escape_string($_POST['zipcode']); $update = "UPDATE $postset SET itemtitle = '$itemtitle', price = '$price', description = '$description', zipcode = '$zipcode' WHERE postid = '$postid' AND userid = '$userid';"; if (mysql_query($update)) { echo "Your post was successfully updated.<br />"; }else { echo "There was some sort of issue updating your post.<br />"; echo "Please try again or contact support.<br />"; } break; case "postset2": break; case "postset3": break; case "postset4": break; case "postset5": break; case "postset6": break; case "postset7": break; case "postset8": break; } //  Prepare variables to work with db // act on variables accordingly. if ($_POST['postset']) { $postset = mysql_real_escape_string($_GET['postset']); $postid = mysql_real_escape_string($_GET['postid']); $userid = mysql_real_escape_string($_GET['userid']); }elseif ($_GET['postset']) { $postset = mysql_real_escape_string($_GET['postset']); $postid = mysql_real_escape_string($_GET['postid']); $userid = mysql_real_escape_string($_GET['userid']); } switch ($postset) { case "postset1": $selectps1 = "SELECT * FROM $postset WHERE postid = '$postid' AND userid = '$userid';"; $queryps1 = mysql_query($selectps1); if ($row1 = mysql_fetch_array($queryps1)) { ?> <form  name="post1" id="post1" action="post4.php" method="post"> <label for="itemtitle">*Item Title:</label><br /> <input name="itemtitle" id="itemtitle" type="text" maxlength="120" value="<?php echo $row1['itemtitle']; ?>" /><br /> <label for="price">Price:</label><br /> <input name="price" id="price" type="text" maxlength="100" value="<?php echo $row1['price']; ?>" /><br /> <label for="zipcode">Zipcode:</label><br /> <input name="zipcode" id="zipcode" type="text" maxlength="30" value="<?php echo $row1['zipcode']; ?>" /><br /> <label for="description">*Description:</label><br /> <textarea name="description" id="description" rows="10" cols="30"><?php echo $row1['description']; ?></textarea><br /> <input name="postset" type="hidden" value="<?php echo $postset; ?>" /> <input name="postid" type="hidden" value="<?php echo $postid; ?>" /> <input name="userid" type="hidden" value="<?php echo $userid; ?>" /> <input name="command" type="hidden" value="yes" /> <input name="submit" id="submit" type="submit" value="submit" /> </form> <?php } break; case "postset2": $selectps2 = "SELECT * FROM $postset WHERE postid = '$postid' AND userid = '$userid';"; $queryps2 = mysql_query($selectps2); if ($row2 = mysql_fetch_array($queryps2)) { ?> <form name="post2" id="post2" action="post4.php" method="post"> <label for="itemtitle">*Item Title:</label><br /> <input name="itemtitle" id="itemtitle" type="text" maxlength="200" value="<?php echo $row2['itemtitle']; ?>" /><br /> <label for="reward">Reward:</label><br /> <input name="reward" id="reward" type="text" maxlength="120" value="<?php echo $row2['reward']; ?>" /><br /> <label for="zipcode">Zipcode:</label><br /> <input name="zipcode" id="zipcode" type="text" maxlength="30" value="<?php echo $row2['zipcode']; ?>" /><br /> <label for="datelost">Date Lost:</label><br /> <input name="datelost" id="datelost" type="text" maxlength="120" value="<?php echo $row2['datelost']; ?>" /><br /> <label for="locationlost">Location Lost:</label><br /> <input name="locationlost" id="locationlost" type="text" maxlength="120" value="<?php echo $row2['locationlost']; ?>" /><br /> <label for="description">*Description:</label><br /> <textarea name="description" id="description" rows="10" cols="30"><?php echo $_GET['description']; ?></textarea><br /> <input name="postset" type="hidden" value="<?php echo $postset; ?>" /> <input name="postid" type="hidden" value="<?php echo $postid; ?>" /> <input name="userid" type="hidden" value="<?php echo $userid; ?>" /> <input name="command" type="hidden" value="yes" /> <input name="submit" id="submit" type="submit" value="submit" /> </form> <?php } break; case "postset3": $selectps3 = "SELECT * FROM $postset WHERE postid = '$postid' AND userid = '$userid';"; $queryps3 = mysql_query($selectps3); if ($row3 = mysql_fetch_array($queryps3)) { ?> <form name="post3" id="post3" action="post4.php" method="post"> <label for="itemtitle">*Item Title:</label><br /> <input name="itemtitle" id="itemtitle" type="text" maxlength="200" value="<?php echo $row3['itemtitle']; ?>" /><br /> <label for="zipcode">Zipcode:</label><br /> <input name="zipcode" id="zipcode" type="text" maxlength="30" value="<?php echo $row3['zipcode']; ?>" /><br /> <label for="datefound">Date Found:</label><br /> <input name="datefound" id="datefound" type="text" maxlength="120" value="<?php echo $row3['datefound']; ?>" /><br /> <label for="locationfound">Location Found:</label><br /> <input name="locationfound" id="locationfound" type="text" maxlength="120" value="<?php echo $row3['locationfound']; ?>" /><br /> <label for="description">*Description:</label><br /> <textarea name="description" id="description" rows="10" cols="30"><?php echo $row3['description']; ?></textarea><br /> <input name="postset" type="hidden" value="<?php echo $postset; ?>" /> <input name="postid" type="hidden" value="<?php echo $postid; ?>" /> <input name="userid" type="hidden" value="<?php echo $userid; ?>" /> <input name="command" type="hidden" value="yes" /> <input name="submit" id="submit" type="submit" value="submit" /> </form> <?php } break; case "postset4": $selectps4 = "SELECT * FROM $postset WHERE postid = '$postid' AND userid = '$userid';"; $queryps4 = mysql_query($selectps4); if ($row4 = mysql_fetch_array($queryps4)) { ?> <form name="post4" id="post4" action="post4.php" method="post"> <label for="itemtitle">*Item Title:</label><br /> <input name="itemtitle" id="itemtitle" type="text" maxlength="200" value="<?php echo $row4['itemtitle']; ?>" /><br /> <label for="priceperunit">Price Per Unit:</label><br /> <input name="priceperunit" id="priceperunit" type="text" maxlength="120" value="<?php echo $row4['priceperunit']; ?>" /><br /> <label for="numberofunits">Number Of Units:</label><br /> <input name="numberofunits" id="numberofunits" type="text" maxlength="120" value="<?php echo $row4['numberofunits']; ?>" /><br /> <label for="zipcode">Zipcode:</label><br /> <input name="zipcode" id="zipcode" type="text" maxlength="30" value="<?php echo $row4['zipcode']; ?>" /><br /> <label for="description">*Description:</label><br /> <textarea name="description" id="description" rows="10" cols="30"><?php echo $row4['description']; ?></textarea><br /> <input name="postset" type="hidden" value="<?php echo $postset; ?>" /> <input name="postid" type="hidden" value="<?php echo $postid; ?>" /> <input name="userid" type="hidden" value="<?php echo $userid; ?>" /> <input name="command" type="hidden" value="yes" /> <input name="submit" id="submit" type="submit" value="submit" /> </form> <?php } break; case "postset5": $selectps5 = "SELECT * FROM $postset WHERE postid = '$postid' AND userid = '$userid';"; $queryps5 = mysql_query($selectps5); if ($row5 = mysql_fetch_array($queryps5)) { ?> <form name="post5" id="post5" action="post4.php" method="post"> <label for="itemtitle">*Item Title:</label><br /> <input name="itemtitle" id="itemtitle" type="text" maxlength="200" value="<?php echo $row5['itemtitle']; ?>" /><br /> <label for="wage">Wage:</label><br /> <input name="wage" id="wage" type="text" maxlength="120" value="<?php echo $row5['wage']; ?>" /><br /> <label for="zipcode">Zipcode:</label><br /> <input name="zipcode" id="zipcode" type="text" maxlength="30" value="<?php echo $row5['zipcode']; ?>" /><br /> <label for="description">*Description:</label><br /> <textarea name="description" id="description" rows="10" cols="30"><?php echo $row5['description']; ?></textarea><br /> <input name="postset" type="hidden" value="<?php echo $postset; ?>" /> <input name="postid" type="hidden" value="<?php echo $postid; ?>" /> <input name="userid" type="hidden" value="<?php echo $userid; ?>" /> <input name="command" type="hidden" value="yes" /> <input name="submit" id="submit" type="submit" value="submit" /> </form> <?php } break; case "postset6": $selectps6 = "SELECT * FROM $postset WHERE postid = '$postid' AND userid = '$userid';"; $queryps6 = mysql_query($selectps6); if ($row6 = mysql_fetch_array($queryps6)) { ?> <form name="post3" id="post3" action="post4.php" method="post"> <label for="itemtitle">*Item Title:</label><br /> <input name="itemtitle" id="itemtitle" type="text" maxlength="200" value="<?php echo $row6['itemtitle']; ?>" /><br /> <label for="wage">Wage:</label><br /> <input name="wage" id="wage" type="text" maxlength="120" value="<?php echo $row6['wage']; ?>" /><br /> <label for="hoursperweek">Hours Per Week:</label><br /> <input name="hoursperweek" id="hoursperweek" type="text" maxlength="120" value="<?php echo $row6['wage']; ?>" /><br /> <label for="zipcode">Zipcode:</label><br /> <input name="zipcode" id="zipcode" type="text" maxlength="30" value="<?php echo $row6['zipcode']; ?>" /><br /> <label for="description">*Description:</label><br /> <textarea name="description" id="description" rows="10" cols="30"><?php echo $row6['description']; ?></textarea><br /> <input name="postset" type="hidden" value="<?php echo $postset; ?>" /> <input name="postid" type="hidden" value="<?php echo $postid; ?>" /> <input name="userid" type="hidden" value="<?php echo $userid; ?>" /> <input name="command" type="hidden" value="yes" /> <input name="submit" id="submit" type="submit" value="submit" /> </form> <?php } break; case "postset7": $selectps7 = "SELECT * FROM $postset WHERE postid = '$postid' AND userid = '$userid';"; $queryps7 = mysql_query($selectps7); if ($row7 = mysql_fetch_array($queryps7)) { ?> <form name="post3" id="post3" action="post4.php" method="post"> <label for="coursenumber">Course Number:</label><br /> <input name="coursenumber" id="coursenumber" type="text" maxlength="120" value="<?php echo $row7['coursenumber']; ?>" /><br /> <label for="title">*Title:</label><br /> <input name="title" id="title" type="text" maxlength="200" value="<?php echo $row7['title']; ?>" /><br /> <label for="author">*Author:</label><br /> <input name="author" id="author" type="text" maxlength="120" value="<?php echo $row7['author']; ?>" /><br /> <label for="price">Price:</label><br /> <input name="price" id="price" type="text" maxlength="120" value="<?php echo $row7['price']; ?>" /><br /> <label for="zipcode">Zipcode:</label><br /> <input name="zipcode" id="zipcode" type="text" maxlength="30" value="<?php echo $row7['zipcode']; ?>" /><br /> <input name="postset" type="hidden" value="<?php echo $postset; ?>" /> <input name="postid" type="hidden" value="<?php echo $postid; ?>" /> <input name="userid" type="hidden" value="<?php echo $userid; ?>" /> <input name="command" type="hidden" value="yes" /> <input name="submit" id="submit" type="submit" value="submit" /> </form> <?php } break; case "postset8": $selectps8 = "SELECT * FROM $postset WHERE postid = '$postid' AND userid = '$userid';"; $queryps8 = mysql_query($selectps8); if ($row8 = mysql_fetch_array($queryps8)) { ?> <form name="post3" id="post3" action="post4.php" method="post"> <label for="coursenumber">*Course Number:</label><br /> <input name="coursenumber" id="coursenumber" type="text" maxlength="120" value="<?php echo $row8['coursenumber']; ?>" /><br /> <label for="test">Test:</label><br /> <input name="test" id="test" type="text" maxlength="200" value="<?php echo $row8['test']; ?>" /><br /> <label for="professor">Professor:</label><br /> <input name="professor" id="professor" type="text" maxlength="200" value="<?php echo $row8['professor']; ?>" /><br /> <label for="zipcode">Zipcode:</label><br /> <input name="zipcode" id="zipcode" type="text" maxlength="30" value="<?php echo $row8['zipcode']; ?>" /><br /> <input name="postset" type="hidden" value="<?php echo $postset; ?>" /> <input name="postid" type="hidden" value="<?php echo $postid; ?>" /> <input name="userid" type="hidden" value="<?php echo $userid; ?>" /> <input name="command" type="hidden" value="yes" /> <input name="submit" id="submit" type="submit" value="submit" /> </form> <?php } break; // last break } // end total switch ?>         </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]
  7. I saw a huge post on here one time, about someone who was hacked, and asking for help.  After about 20-30 people on the forum examined his code, they discovered a case switch as a vunerability, I just realized I have used case switch statements(more of as a test), for almost this entire system I have created.  This advertising system, I have most pages with case statements, based on category, sub-category.  posts, and various other thing, with like a switch case statement,a nd in between each case, hundreds of lines of programming.  Is there any vunerabilities I should watch out for, with case switch statements?
  8. I know, but with me, what I consider ajax programming, is anything that you are actively putting together the proper elements to get the concept of ajax.
  9. I need to run a select query to 8 different tables.  While still being able to differentiate what table it came from, I am letting someone edit there posts on a classified site, I need to do a giant query to gather information on all posts they have in all 8 tables.  THen still allow them an option for the post, to either delete it or edit it.  How can I set this up, like a huge query, would i still be able to allow them to edit it, or delete it if they choose too.
  10. put an extra one in there, and put it as hidden, or something someone showed me once on here, and it helped, but I forgot how, or something like that.
  11. I would be amazed to see 1400 lines of ajax programming, that must have been quite a project.
  12. It seems a little wierd though to just zip up a script, just be careful if you download it, I will download it, and virus scan it before trying to unzip it, and even then it might be too late.  It is just strange to zip a few php pages, you can just paste the code in.
  13. I have noticed when programming in general, a lot of the pages end up being well over 500+ lines of programming.  I ended up programming this one page http://www.thecampussource.com/view.php The most I ever had on one page was 875 lines of pure programming, and after I am done, it'll be well over 1000.  I have it handling a lot of different stuff from a lot of different pages.  What is the most amount of programming lines you ever had on one page before.
  14. Nobody is stupid enough to download those, they could be virus's.  Please pull the pages out, and put them in code view, or something.
  15. do you mean making it default I think it's selected="selected" or something, I think that is how you set up default, if you need it to be defaulted based on something else, use php to create that line of option.  for instance if you have a drop down menu, with say 2 options if ($whatever == "whatever") { echo "your select"; }else { echo "the other"; } so it shows what you want as default.
  16. Incorrect usage of the term "aka". Aka means "Also known as", used in reference to where something is called something, but at the same time, it is called something else.  If someone has one name, and also another, there name is whatever, also known as whatever.  You used it in a sentence that had nothing to do with the original, or urban meaning.
  17. [quote]Thanks so much that got it!!! Accept for one thing it defaults back to the original value aka in this case Agriculture instead of taking like number 2 or 3 and making it work.. any suggestions here is my code in full...[/quote] http://www.google.com/search?hl=en&q=define%3A+aka
  18. [quote author=Codeman0013 link=topic=108922.msg438789#msg438789 date=1158853937] Thanks so much that got it!!! Accept for one thing it defaults back to the original value aka in this case Agriculture instead of taking like number 2 or 3 and making it work.. any suggestions here is my code in[/quote] http://www.google.com/search?hl=en&q=define%3A+aka
  19. Ok, I will do some research on null.  And see what all it says about it.
  20. I dont' really get offended but [quote] if you don't understand why, then you need to do some reading![/quote] That was slightly more than annoying, but I suppose I can understand where your coming from.
  21. I was given the advice about null, from one of the best mysql/database people on the internet right here in this forum, named, fenway, and I doubt if you knew even a quarter of what he knows, so I think I will take his advice on this one.  He gave me advice about this awhile back, and when I finished hte system, and didn't listen to him, I am severely regretting it now, he said "null" is the best one to use(for what I was trying to do), I didn't listen to what he said, and I lost about a week worth of development time.  So I will stick with what he said from now on.
  22. I am creating a file handling script. If no file was uploaded, or they didn't try I am registering the url, and the name of the file with null for database entry like $tempfile = "null"; $tempfileurl = "null"; putting that into the database, later can I say [code]<?php while ($row = mysql_fetch_array(whatever)) {   if ($tempfile != "null") {     // do what is necessary to show the file   }else {     // act like the file was never there   } } ?>[/code] would thatr work in testing for the file??
  23. so it's actually just a bunch of small stuff, I am just worried about in general, it seems like a huge task.  it's only 4 pages, but like PAGE 1- they click a link tos tart the program page 2- they put in there desired sub-domain, username, password page 3- they choose a template, type in text for the template, and it also creates a logo for there domain name, on the template page 4- carried over to the next page, here they actually decide through paypal, payout, next step- get ipn back from paypal, create sub-domain(with his third party script), setup there account(via database work), create the page they created within the sub-domain that script created(god-knows how), plus whatever cleanup work needs to be done. next step- when they leave paypal, and come to the website again. Where they can see there domain, and access there admin.  admin- with there admin he was wanting full blown xhtml/css editing, then just have it screen out php/javascript coding.  Then I told him it would be best for just text, saved in a database, that's because I didn't know where to start on this other stuff I have 2 weeks to finish this whole thing in, big question, is this possible, is it something I can possible accomplish 2 weeks from monday.
  24. Ok I am getting ready to take on a project, but there are a lot of things I am unsure of, so I was going to ask a few questions and see if anyone new these, or ever did anything like this. I am creating a page like one that I forgot the url of. But people come to it, and sign up and it creates them a sub-domain, here are my questions. 1. How do I make it to where someone can pick a website template, and use that as something to work with.  I know how to make the content available, I could have it just stored in a database with there userid, this will allow me to allow them to change there textual content.  BUt I don't understand how to make that template itself interact with the rest of the system 2.  Wildcarded dns, I have a server that supports it, but is it easy, I normally like building my stuff from scratch, but luckily he already had a script to do it.  but don't I have to do all of this with return info from paypal.  I have to set up a paypal payment at the end, and with it, the ipn brings back information, but how do I allow the information to be able to go and create the entire domain name and everything, and how hard will this be to test. 3. The thing about this is, I have to allow them to customize there own sub-domain names via a control panel, when I allow them to login to the control panel, how do I associate them with the sub-domain, and allow them to like possibly change xhtml depending on the account type they sign up for, ex-cetera.
  25. well high as in version 5+ of php, and probably mysql version 5+, I have worked all over 4, but I might want to play with version 5 now.  As far as wildcarded dns, yes I know a lot of them allow that through the panel, I needed one that you can create tehm automatically with a php script, and I think I found one, www.bluehost.com that is the one I always used but there dedicated ip's are 40 a year compared to the normal 1000 per year, so I think this will work.
×
×
  • 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.