Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. $query = "SELECT * FROM calendar_messages WHERE msg_id='$id'"; Where is $id being set? I do not see it anywhere in the code?
  2. I think you have to actually link to a file not a directory. Try adding that index.php file onto the end of the $filename and see if it works.
  3. It should not be too much, but you should look at the interval you are sending them at, make sure that your PHP does not get errors trying to retrieve the data from the database. Chances are your PHP is probably throwing an error when trying to retireve some data. That is the real problem with AJAX, it is a pain to test/debug.
  4. Usually when I interviewed for a programming job, the hirer used OOP and made sure I could follow and also some basic math problems (cause let's face it if you cannot do a mean or average your behind the curve). Alot of it was hands on and I had to show him. He would then watch how I solved it and if I could follow along. That's how I got my first programming job, it was a small company (5 employees) but paid very well. So yea it depends on the company and what not. A small business you will probably learn more, a major business it is probably all in the application and what degrees you have etc.
  5. Are you using session_start on both pages?
  6. $names = ""; while ($row = mysql_fetch_array($sql_result)) { $names .= $row['value']; echo "<br />"; } You have to use the .= to add to the value of a string.
  7. Well PHP 5 is just starting to become standard and most production servers, I would say when PHP5.4.x is release they will have a non-beta PHP 6, but you will never know as it is up to the developers to decide when it is ready.
  8. Basically you have a field on your database called level. You set this when the user is created and then an admin can elevate their privelegs, say 1 is a registered and validated user, 2 is a superuser, 3 is a moderator and 4 is an admin. When the user logs in you set in session their level. Then on the page depending on the level set in session you show them the right controls and allow them access to other areas of the site. If they do not have the proper level to view that page you let them know and redirect to a good page, such as index. Hope that helps to get you going.
  9. <?php if (isset($_POST['keyword'])) { // set database server access variables: $host = "123.456.789.10"; $user = "NotMyUserName"; $pass = "NotMyPasswordEither"; $db = "MyDB"; // open connection $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!"); // select database mysql_select_db($db) or die ("Unable to select database!"); $sql = "SELECT Students.OEN, Students.LastName, Students.FirstName, Notes.Note FROM Students, Notes WHERE Students.OEN = Notes.OEN AND MATCH (Notes.Note) AGAINST (" . $_POST['keyword'] . ")"; $result = mysql_query($sql); } else { echo "<form action='SearchNotWorking.php' method='POST'>"; echo "<input type='text' name='keyword'>"; echo "<input type='submit' value='Search!'>"; echo "</form>"; } ?> One problem would have been the mysql_query, I changed it to all lower case cause php is case sensitive. The other problem was the post variable in double quote you either need to encase array variables with { and } or concat them, I switched it to the concat version.
  10. session_register Best to just use $_SESSION['username'] = $username; And do not worry about use that session_Register function. To fix your issue, you are not actually querying the gold: $queryy = "SELECT gold FROM user_stats WHERE username='$username' AND gold='$gold'"; session_register("gold"); $_SESSION['gold'] = $gold; That should be something like $queryy = mysql_query("SELECT gold FROM user_stats WHERE username='$username' AND gold='$gold'") or die(mysql_error()); $row = mysql_fetch_assoc($queryy); $_SESSION['gold'] = $row['gold'];
  11. That is for spambots...not people randomly hacking the site.
  12. Are you on a shared host? If so shared hosts are not secure at all and easily hacked.
  13. Nope, been around since the start. The reason you never encountered, is either you did not know about PHP and constants, or you never had a need for them.
  14. Ok ted_chou read up on constants in PHP please. As far as you code Pro.Luv, maybe this will help. echo "Home"; // echos "Home" echo home; // echos home, if there are no constants defined. define("home", "Test Home!", true); echo home; // echos "Test Home!" echo "home"; // this echos "home" since it is used in the context of quotes. So with constants you cannot use the " " around them to display them. You were just thinking that putting a defined variable inside of an echo with quotes it should work, it does not. constants Read up on constants in PHP. As for your chinesse error I would look up your editor and see if they have a language deal. You will have to change the page char type in order to display that.
  15. Yea, I read through it finally and saw what he was actually trying to do =) Goes to show, read first or make an ass of yourself later =)
  16. <?php class a { function a() { echo 'BOOO!'; echo "<br />"; } function hyBrid() { echo "<br /> ORIGINAL HYBRID."; } } class b extends a { function ab() { echo 'RAWR!'; echo "<br />"; } function hyBrid() { echo "Hybrid in b "; parent::hyBrid(); } function bb() { echo "BBBBBB"; echo "<br />"; } } class c extends b { function hyBrid() { echo "Hybrid in c "; parent::hyBrid(); } function bc() { echo "BCBCBC"; echo "<br />"; } } class d extends c { function hyBrid() { echo "Hybrid in d "; parent::hyBrid(); } function cd() { parent::a(); } } $classD = new d(); $classD->ab(); // echos "RAWR!" echo "<br /><br />"; $classD->bc(); echo "<br /><br />"; $classD->cd(); echo "<br /><br />"; $classD->bb(); echo "<br /><br />"; $classD->a(); echo "<br /><br />"; $classD->hyBrid(); // die(); ?> Expected output: BOOO! RAWR! BCBCBC BOOO! BBBBBB BOOO! Hybrid in d Hybrid in c Hybrid in b ORIGINAL HYBRID. So yea.... I just did that part for my own needs =) EDIT: Just tabbed the code. "When in doubt, test it out!" =)
  17. Ah my mistake then =) Would having d extend class c and class c extend class b not work, I do not with PHP OOP since it is different than most, and never tried it...think I will right now.
  18. This is a common problem when you just switched to a new domain or just installed the domain, due to the DNS records. Did that happen?
  19. Are you re-retrieving the data? Post the code that does the comment display. Chances are you are retrieving the data before you execute the query. Since there is no delID of X the query does not error out, but it is also not modifying anything.
  20. Used ini_get and it printed out 3600. But the session still doesn't last an hour. I would define that in the .htaccess file instead of ini_set to be honest.
  21. Now, I am confused. Is that not what he is wanting to do? Override the method of class a via class b? I think that was designed to allow overriding of functions inside of a class that has a parent... EDIT: I am not meaning to be rude or anything lol I am just confused =)
  22. curl_setopt($ch,CURLOPT_POSTFIELDS,array('id'=>$id,'xml'=>$xml)); That is not setting the id, where do you actually define $id = "your code" ?
  23. The question is: should it be solved at all? :: operator should in general be used for calling static methods You sure about that? From the horses mouth at: http://us.php.net/manual/en/language.oop5.paamayim-nekudotayim.php =)
  24. How are you testing that the comment was deleted?
  25. Sorry if I did not read through all the posts. But the original answer can be solved, I believe with this tidbit... <?php class b extends a { function b() { a::b(); // execute class a function b; // or parent::b(); // execute the parent class (a) function's b. } } ?> I am not 100% sure that will work, but yea.
×
×
  • 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.