Jump to content

nickmccomb

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

1,367 profile views

nickmccomb's Achievements

Newbie

Newbie (2/6)

2

Reputation

  1. marcus thankyou! i think you missed out a $ sign thought, but i got it to work using: url: '<?php echo $pages->get('/logincode/')->url ?>' finally! Thank you so much. I should really have posted in here 8 hours ago although i wanted to figure it out myself, and learnt a hell of a lot by trying Thanks mate!
  2. i've also tried setting the AJAX url to: url:"<?php echo $config->urls->templates?>logincode/", to try and load it through processwire, but my AJAX call returns an error (which is set up as a javascript alert). I'm guessing AJAX doesn't understand it's in ProcessWire so it can't find the page at all when doing it this way, so trying it this way also did not work
  3. Hi guys, i've been trying to fix an issue all day and can't figure it out! i have a php page that calls another php page through AJAX. The problem is that the session variables i set in the page i call through AJAX don't stick when i go back to the calling page. I believe it may be because of the way i'm calling the page url with AJAX, which could be what makes another session once it gets to the AJAX page url:"<?php echo $config->urls->templates?>logincode.php/", the session ID's are completely different on both pages and the name of the session from the calling page is 'wire'. The name of the session on the AJAX page is called 'PHPSESSID'. So the sessions are not the same, which is why the session variables set in the AJAX page aren't available in the calling page when the AJAX page is returned to the calling page. i've tried renaming the ProcessWire session name in the config file to 'PHPSESSID', although that didn't work. When i go to the page 'logincode/' as a regular post from a form it works perfectly and has the same session ID and variables, although through AJAX the sessions on both pages are completely different. Does anyone know how to do this properly and make the session the same? Please help, it's driving me mad! see the AJAX calling code below: $.ajax({ type : 'POST', xhrFields: {withCredentials: true}, data : {'username':username, 'password':password}, url:"<?php echo $config->urls->templates?>logincode.php/", success:function(result){ if(result == "1"){ alert('Please input username and password'); } }, error:function(xhr, status, error) { alert('error'); } });
  4. Hey guys, Yeah it looks like it will require just two different roles, which i've figured out how to do. What do you guys do to communicate with the database? For example if you wanted to add a new column to a table, or a new table to the database, would you do that in phpMyAdmin, or is there a module to do this in ProcessWire? Also, what's the best way to create a user login / sign up form? Any modules out, or templates that we can import? Sorry for all the questions, i'm still a noob with ProcessWire. I have come from hand-coding PHP... It's a big change conceptually for me! One day, when i've figured it all out, i'll give back and answer noob questions! Cheers! Nick.
  5. Hi teppo, I was thinking more along the lines of adding a new column to the user database table that distinguishes what type of user they are, e.g if they are a client or a customer. This field in the database table will get set depending on whether they sign up from the client form or the customer form. Once they sign in, if they are a client they get taken to a page which populates all their details from a table i have created for clients, if they are a customer they get taken to a different page which populates all their details from a customer table. I'm thinking i need to create two types of users (Client and Customer) in ProcessWire and only give them rights to see the page they are meant to see. Although, i'm not sure if there's an easy way to set up this scenario in ProcessWire or if i have to do it with a fair bit of PHP and mySQL code instead. I'm fine with doing the code, i just thought there would be a module or an easier way to do this in ProcessWire. Thanks for the info Nick.
  6. Hey guys, I'm new to PW. I'm trying to make a website where my clients can signup/login and set up their profile. Also, their customers have to be able to signup/login and view their profile. Basically, i have clients that will login and set up their own information in the website. Details included will be something like company name address contact info product image product description price Once my clients log in and input this information their customers can go to the client's web page and view the information and purchase items. So i basically need to know how to set up the users so that: clients can sign up and input their information which will output to a web page customers can log in and see the clients information where they can purchase items is there a module that caters for this already? Does the PW database cater for this? Any information on how to do this would be greatly appreciated! Regards, Nick.
×
×
  • Create New...