Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. change your query to this : SELECT name, score FROM members ORDER BY name ASC, score DESC asssming you primarily want to alphabetize your members first and then order by score, if you just want to purely order by score alone then just use SELECT name, score FROM members ORDER BY score DESC and PLEASE use code tags!!
  2. hmm, nothing jumping out from the code you have there, except that you have malformed the first option in each select....oh and for some reason included the ID field in your insert statement against all good judgment. Try this, it should be a bit easier to read and debug : $form = "<select name=\"day\">\n <option selected=\"selected\" value=\"no_valid\">Select</option>\n "; $day=1; while($day<32) { $form .= "<option value=\"{$day}\">{$day}</option> "; $day++; } $form .= "</select>\n \n <select name=\"month\">\n <option selected=\"selected\" value=\"no_valid\">Select</option>\n "; $month = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "Novermber", "December"); foreach ($month as $key) { $form .= "<option value=\"{$key}\">{$key}</option>\n "; } $form .= "</select>\n \n <select name=\"year\">\n <option selected=\"selected\" value=\"no_valid\">Select</option>\n "; $year=1901; while($year<2012 && $year > 1900) { $form .= "<option value=\"{$year}\"><{$year}</option>\n "; $year++; } $form .= "</select> \n"; echo $form; adding the value of "no_valid" lets you validate the dropdown options, however you do know that this is going to let people choose the 31st of any month, even those that only have 30 or 28 days? I personaly find it easier to just have people type the date, in the format that they are most comfortable with, and then validate the input against an actual date.
  3. first of all, you would only run mysql_real_escape_string() once on a variable, not twice as you are doing second of all, mysql_real_escape_string() is, as the name suggests, only any use at sanitising strings, so it's useless against integers. third of all, you should take the +$i out of the square brackets for the $_POST array call finaly this is not an efficent way to do things, you may want to think about a different approach - you should never run queries inside of loops
  4. drop all the lines that have session_register on them, you also don't have the values in the post array untill after the form is submitted, so the $_SESSION['...'] = $_POST['...'] lines should actualy be throwing up notices/warnings to the effect that $_POST[...] is not initialised or is an invalid index. the $_POST array will take the values to the next page, it's there that you would assign them to the $_SESSION array if you want to take them to a third page.
  5. let's see the full form code
  6. now your just being pedantic I only ment that a single query string should be run against the database, yeas it's two queries, or rather one query and a sub query, but I know you know that I know you know what I ment
  7. Don't run queries within loops a single query is all you need $sql = "SELECT id, date, info FROM announce WHERE id not in (SELECT aid from ackannounce WHERE uid = '$uid')"
  8. that's the wrong opperator for a comparison, It's maybe not the actual problem, but it's sure gonna be one if it isn't.
  9. Just out of curiosity - what's the weather like on that planet your living on? Most of the people who have advised you here have actual proffesional experiance managing systems and applications hundreds if not thousands of times more complex than the basic program you are having such trouble with, and yet you know better? These same people are the ones that have to go in and fix the kind of crap design you are insisting on writing, and you expect them to go and encourage someone new to do it all over again? I could write you a single query that would lookup all your tables at once and give you the results you want with my eyes shut, standing on one leg on a rainy day - but I'm not going to encourage you to do something that is fundimentaly wrong.
  10. Solved it, I just put a header(Location: ...) after the curl_exec(), without echoing the return, and jumped right over to the remote site, still riding on the session cookie that curl returned from the login. Exectly the result I was looking to achieve, just wish I thought of it sooner (especialy as now it seems so damn obvious).
  11. unless it's a multipart mail, then you can have a different content type for each part - I know that's not the point you are making, but just to keep it all clear.
  12. It's for a sort of unified login system. Our end users do not tend to be overly computer litterate. Our suppliers have created a portal that our users can use to log in and order stuff, each portal is different with spcific delivery details and the such. The idea was that, instead of each end user having to have a shortcut set uip on the computer, and have the login information passed to them for them to either forget repetedly or write down in some obvious format that I would just stick a link in the intranet site that would launch the remote site and log them into it without them ever needing to know or worry about the details. As everything is run internaly through an MPLs I have already automated the identification of end users on the intranet by local IP address, so they never need to "log in" so to speak. I would be just as happy (infact, probably even happier) having the link open the remote site in a new window/tab - as long as the login was still taken care of. It's a basic post form so there is probably a couple of ways to do it, but cURL is the only thing that I have touched on that can. I thought that I might be able to bundle the info into a header() call, but that only seems to allow for url encoded data, like get, not post. the CSS didn't display at all untill I put in the str_replace() to add the target url into the $pageFull paths, but I have to assume that the js is linking to an external file that's probably using the same relative addressing to load the images and perform this KeepAlive. If you know anything that will solve this I'm open to suggestions.
  13. obvious, tried and tested approach is to have a single user table TBL_USER uid fistName lastName email password groupID address1 address2 address3 address4 post/zipcode telephoneMain telephoneSecond telephoneMobile ...other user info as required one groups table TBL_GROUPS groupID groupName groupType accessLevel ...other relivent group level information If your group relates to a corp client then the address info can be moved into that, so can the telephone info, adding an optional extension feild to the user table if it's applicable. It's not quantum displacement theory.
  14. yeah - this is what I have so far : $ch = curl_init(); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_COOKIESESSION, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, '/temp/curlJar.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, '/temp/curlJar.txt'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$login); curl_setopt($ch, CURLOPT_URL, "http://targeturl.com/targetLoginPage/LogOn?ReturnUrl=%2f"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $page = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); $pageFull = str_replace('"/', '"http://targeturl.com/', $page); echo $pageFull; using the str_replace workaround most of the css is coming up properly, but the java and some images are still causing a problem, I'm getting java alerts up to the efect of "Target page not found [404] URL /Home/KeepAlive" These are using the target sites CSS for styling, so I'm thinking it's something to do with telling the curl page what it's webroot is supposed to be - as I just demonstarted on that other post, directory stettings aren't my strong suit
  15. yeah, thought that was it Barand, and keeping it simple is never a bad thing. I just thought that it was the discount price, not the ARP, that had to hit within the price watch ranges. To be honest this cURL problem I'm having is pickling my brain :'( So'm i'm gonna take a back seat for a while.
  16. well without actualy getting a look at what you are doing - nothing I can do, sorry.
  17. "/" refferences the domain root "./" refferences the current directory "../" refferences the direct parent directory so, take for example the site example.com has 3 directories in it's web root - html, scripts and images html has no directories in it images has 2 directories in it - bground and buttons script has 3 directories in it - css, php and js php has 2 directories in it - includes and templates to get from myScript.php in the php directory to the must_Include.php in the includes directory you would use one of the following : include './includes/must_Include.php'; include '../php/includes/must_include.php'; include '/script/php/includes/must_include.php'; obviously, the second option is kind of silly, but should still work.
  18. This is a perfect example of when a heredoc statement should be used : $form = <<<FORM_TXT <form name="box" method="post" action="homework.php"> Name: <input type="text" name="updatename"><br> Shout:<input type="text" size="150" name="updateshout"><br> <input type="hidden" name="updateid" value="{$_GET['updateid']}"> <input type="submit" name="button" value="Submit"> </form> FORM_TXT; echo $form; Another thing, you should probably be validating that $_GET['updateid'], or else people could just manualy enter any ID they wanted to change into the url and load the update form for that id....
  19. it's unlikely that anything from an update would cause the code to just not work. there would be an error/notice/warning about it on the page at the verry least. Let's see the code and we'll be better able to find the problem.
  20. I think there may bee some confussion as to what a cookie is and does. Cookies are stored, normaly, on the end users computer and cached within the browser. They are passed in the page headers, they arn't visible by default in the body of the page. What exactly are you trying to do?
  21. @sam, watchlist should get the prodID from pp_prod and every entry in the product table should have a unique prodID, that's why it was made as a primary key. If the features are different between products then the product is different and it goes in as a different item. You need to have unique identifiers for each record in order to maintain and query the data successfully. wishlist should use the prodID to refference the product from prod, If you duplicate the prodID in prod then bad things will happen. @barand, Liking the query you posted, It looks to me that you are using the ARP (which I ment to be Actual Retail Price) rather than calculating the discount price, is that right?
  22. Hi guys, I'm having a go at making a curl link that auto logs into another remote site. I managed to get the login part sorted after about a day of searching by using the CURLOPT_FOLLOWLOCATION and CURLOPT_COOKIEJAR settings to handle the session and the redirect after login, but I can't get the remote sites css and jquery paths to resolve as the cURL page keeps trying to use the reffrerential paths to the scripts with my server here, where obviously they don't exist. I have tried setting the CURLOPT_REFERER and CURLOPT_AUTOREFERER values but it's not made any difference, and from what I can read they arn't anything to do with my problem. I havn't used cURL for anything productive before so I'm not really femiliar with it. What am I missing that will let me tell the page to load the css and jquery using the remote server domain rather than my local one?
  23. no problem, everyone starts somewhere. I got (and still get) a lot of help and info from this site so try to give back where I can.
  24. given this started after a server move, any chance the paths are now different from the original setup?
  25. Being a data junky, I don't like it when people actualy delete things. Is there a reason you can be sure that no one will ever want to refference that data again? Any way you could be convinced to archive rather than delete?
×
×
  • 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.