Jump to content

Suchy

Members
  • Posts

    140
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Suchy's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi guys I am having a problem with jQuery + Ajax. When a user tries to registers (a new account) + enters a username that is in MySQL + a wrong password (associated with that username), he gets this message $('#pass-reminder').click(function() { alert('Password reminder'); return false; }); ... $.ajax ({ type: "POST", url: "register.php", data: input_data, success: function(return_data) ... if(return_data == 0) { $("#submited .message").html('Our record indicate that you already have an account.<br> If you forgotten your password<span class="link"><a id="pass-reminder" href="#"> click here</a></span>'); } ... } }); For some reason the function does not get called when I click on the link, but when I place the link (<a id="pass-reminder" href="#"> click here</a></span>) anywhere on the page it works. Any workaround this ?
  2. Im having problem extending a class. <?php // Parent class class Profile { protected $id, $result, $info; protected function get_id() { return $_GET['id']; } protected get_info() { $id = $this->get_id(); $result = mysql_query("SELECT * FROM profiles WHERE id = '$id' "); return mysql_fetch_array($result); } public get_fname() { $info = $this->get_info(); return $info['fname']; } public get_lname() { $info = $this->get_info(); return $info['lname']; } } // Child class class Profile_new extends Profile { protected get_info() { $id = $this->get_id(); $result = mysql_query("SELECT * FROM new_profiles WHERE id = '$id' "); return mysql_fetch_array($result); } } // Webpage $profile = new Profile_new; $first_name = $profile->get_fname(); $last_name = $profile->get_lname(); ?> For some reason I still getting first + last names of people from the profiles table, and not from the new_profiles table. How can I fix this ?
  3. I have 2 tables, friends: and posts: anyway Im trying to get all the posts that a certain user and all of his friends have made. My query is: SELECT post, user , time FROM posts WHERE user = ( SELECT friend FROM friends WHERE user = 1 UNION SELECT user FROM friends WHERE friend = 1 ) But its not working, im getting: "Too many sub queries" error
  4. I have a people rating site and once in a while I get an email either from the cops or lawyers asking for ip address and MAC address of a someone who wrote an inappropriate comment. Collecting the ip address is no problem, but is it possible to get the mac address via php? I been searching for this and so far no luck.
  5. Instead of an url like this: places.php?state=tx&city=dallas i want a url like this: places.php/texas/dallas How can this be done? Some links to any tutorials will be very nice. Thanks
  6. I'm havving troubles filling in a dropdown list with values passed back via AJAX. function city_list (form_id, list_id) { if(httpObject.readyState == 4) { var cities = httpObject.responseText; for (i=0; i<cities.length-1; i++) { var city = cities[i].split(":"); document.form_id.list_id.options[document.form_id.list_id.options.length] = new Option (city[1] , city[0]); } } } This does not work, however when I manualy type in the form_id and the list_id it works. So if the form_id = city_form, list_id = city_names changing the line document.form_id.list_id.options[document.form_id.list_id.options.length] = new Option (city[1] , city[0]); to document.city_form.city_names.options[document.city_form.city_names.options.length] = new Option (city[1] , city[0]); it works. How can I get the first example to work, I want to pass the form and list info to the function.
  7. Suchy

    Teaching PHP

    Dont know exactly what their background is. But based on the program guide, they will have courses in CSS, intro to SQL, XML and Javascript. Plus my PHP class
  8. Hi Guys. I was asked to teach a intro to PHP course for continuing education at work. I work in IT at a college. The course will be broken down into 2hour class a week for 6 weeks. I never did this before. Any tips for me? Thanks
×
×
  • 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.