Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. I can't guarantee anything as I dont know your db field names or know what your quote_smart() function does, but you can try this where your comment is in the code: <?php $checkref = "SELECT login FROM $tbl_members WHERE login = ".quote_smart($referral).""; $check_ref = @mysql_query($check2,$connection) or die("Couldn't execute referral check query."); if(mysql_num_rows($check_ref) < 1)){ $login_err = "The referral name you used is not in the database."; $error = "1"; }
  2. The problem is in these lines: <?php $Susername2 = $this->dbuser; $Spassword2 = $this->dbpass; $Shostname2 = $this->dbhost; $Sdatabase2 = $this->dbase; $this refers to the current object (class) that you are working in. It cannot be called from outside a class, which you are doing. I assume that you have instantiated a class somewhere ($myvar = new classname()), most likely some database class. You need to pass that object to your function logLogin(). And then within logLogin() you need to use the reference ($myvar) instead of $this. so somewhere you are doing something like this: $db = new DB(); when you call your function then you need to do this: logLogin($db) and also change your logLogin() function to this: $Susername2 = $db->dbuser; $Spassword2 = $db->dbpass; $Shostname2 = $db->dbhost; $Sdatabase2 = $db->dbase; The names will all be different ($db) and will be whatever you set earlier in your code which wasn't posted, so I can't give specific advise.
  3. You just need session_start() at the top of every page so it will carry the session data from one page to the next. Anything else on that page (HTML/whatever) wouldn't affect anything.
  4. You're doing more than you have to. <?php $checke = "SELECT * FROM $tbl_members WHERE email = ".quote_smart($email).""; $check_e = @mysql_query($checke,$connection) or die("Couldn't execute email check query."); if(mysql_num_rows($check_e) > 0){ //tells you how many results were returned from your query echo 'email already in use'; } else { echo 'email is not used'; } So for your question, you would just <?php if(mysql_num_rows($check_e) > 0){ //...continue } else { echo 'We are sorry, that user name does not exist.'; }
  5. camelCase for functions CamelCase starting with capital letter for classes lower_case with underscore for variables Why? Just_easier_to_understand_things_at_a_glance
  6. Cant you just make a link to the file? <a href="someotherserver.com/somepath/thefile.pdf">Download PDF</a>
  7. http://www.w3.org/Style/Examples/007/center
  8. Hard to say with no code posted, but you can try enabling quiet mode: */20 * * * * -q /usr/bin/wget http://list.domain.ca/admin/consume.php >/dev/null
  9. function getHashFromURL(url){ var pos=str.indexOf('#'); return (pos!=-1) ? url.substr(pos+1) : ''; }
  10. Ah, even easier... var hash = document.location.hash;
  11. Little helper function I have used: <?php //return url hash or empty string function getHash($url){ $pos=strpos($url, "#"); return ($pos !== false) ? substr($url, $pos+1) : ""; }
  12. If you were so k-rad l337 then you would know the answer. Quit being a poser.
  13. Since it was your site, I knew that without checking The darker colors work better, but I would also change the 1) #latest h2 2) images/categories.png darker as well.
  14. Nobody is going to read through that. Please repost using the code tags...its the '#' symbol in the toolbar.
  15. The white text against the light grey background is hard to read on my setup. I think you need more contrasting colors there.
  16. Have you hooked the USB into your pc to see what happens?
  17. how can 'the government' own an international entity? If the usa was unplugged from the internet, there would still be an internet. It has progresses way beyond that...
  18. So have it normal, if the user clicks the edit button it generates the query and creates the new table with a form in it using the retrieved values. This can be done with php, although it will take longer and have more code. It really would be easiest to use 'edit in place' javascript as the changes could be done in the client browser and not require the server.
  19. Then you could just run a query against your database and parse the results into your form. <table> <tr> <td><input type="text" value="<?php echo $row['welcome_text']; ?>" size="8"></td> <td><input type="text" value="<?php echo $row['goodbye_text']; ?>" size="8"></td> </tr> </table>
  20. Are your 'hello' and 'goodbye' values coming from a database or are they hard coded in HTML?
  21. Yes, javascript. Do some googling for 'edit in place'.
  22. SELECT field1, field2 FROM table WHERE id = 12 AND field1 IS NOT NULL AND field2 IS NOT NULL;
  23. PHP only outputs what you tell it to. PHP has nothing to do with browsers. The only thing that differs from browser to browser is how it interprets your HTML and CSS. As DarkWater stated, the problem is probably in your HTML output but we can't know for sure without looking at your code (obviously).
×
×
  • 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.