Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. I think he was more pointing out the fact that you had.... document.onclick = getEl(); and not.... document.onclick = getEl; Hence the function getEI was being envoked when the page loaded.
  2. It will be relatively simple to do what you want, but you need to tell us where exactly you are stuck.
  3. trq

    Sql error

    <?php $sql = " SELECT * FROM student WHERE email ='$email'"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { echo 'this email address already exists'; } else { $sql = " INSERT INTO student( student_id, email, first_name, second_name, street, town, country, postcode, password ) VALUES ( 0, '$email', '$firstname', '$surname', '$street', '$town', '$country', '$postcode', '$password' )"; if (!mysql_query($sql)) { trigger_error(mysql_error()); } } } else { trigger_error(mysql_error()); }
  4. trq

    Sql error

    mysql_num_rows() expects a result resource and returns a number. If you wanted to use... $row = mysql_num_rows($result); if($row == 0 ) { You could.
  5. Does this file 'index.php' exist within your servers document root?
  6. Its best practice not to have any public properties and have getters/setters for everything you need access to from outside of a class. PHP provides overloading which can make the process simpler.
  7. trq

    Sql error

    You need to check your query returns a record using mysql_num_rows.
  8. Either that or passed in as an argument. I didn't really look at the rest of the code, but there should be no need for any loop either. function grabpage($id, $arr) { if (in_array($id, $arr)) { return "includes/content/{$arr[$id]}.php"; } else { return "includes/content/home.php"; } } Then.... <?php $pgID = array("home", "about", "mixology", "blogs", "press", "contact"); include(grabpage($_GET['ID'], $pgID)); ?>
  9. Does this need to be done programatically? Its easy enough to do through enterprise manager otherwise.
  10. The best you can do is return an array. function deprecated() { $sql="select * from table where id=1"; $result=mysql_query($sql) or die(mysql_error()); $return = array(); while ($row=mysql_fetch_array($result)) { $return[] = $row; } return $return; }
  11. PHP would never be installed into /var/bin, in fact that directory should not exist. try /usr/bin/php
  12. Its the source directory your looking for and it could literally be anywhere. Your best off using your distributions package manager. What distro are you using and do you have shell access? There may even be a way of enabling this through cPanel, Ive not used it however.
  13. Your keys go into the .ssh/authorized_keys file NOT .ssh/known_hosts.
  14. The process is quite simple. Generate a public key on your client machine, upload it to the server machine, add it to your authorized_keys file which will be within ~/.ssh/authorized_keys
  15. Its probably not that straight forward looking at what has been posted so far. Generally though, your probably better going to a reputable web development company if you want quality. Even then, theres no guarantees. This highly depends on the design of the application. I can see from your post a file called header-menu.php, you might start there.
  16. An sql attack can completely destroy your database. There are however plenty of people around that write terrible code and palm themselves off as programmers. Allot of them would actually hang out on those freelance sites.
  17. You need to place them in html anchor tags.
  18. As you have just said /usr/local/bin/php points to the binary. You need to find the source tree. Maybe you put it within /usr/src ?
  19. Yeah, I thought that too but it takes away a little when you are using the [m][/m] tag on a function with underscores in its name.
  20. Also, those two queries ought be combined into one.
×
×
  • 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.