Hi, I have both TP and SMF installed just fine. I was wondering if TP modifies the cookie of a user to be different than it would if TP was not installed?
I'm doing lots of integration at my site and i'm primarily an Asp.net guy because it was a smooth transition from windows programming to it rather than php. So anyway, I really only need to get the user's information in just a few cases like when they place an order. My membership is being handled by SMF.
Anyway, what i need is basically a way to get the user's information on an order page. All I really need is the user's name or ID, or anything else unique to that user. I was thinking the best route would be either to do it via extracting the user's info from their SMF cookie, or passing the info to an asp.net page in either the header or query string.
Then I'd use that information to SQL the smf database to get the other things i need. So, if someone could help me find out how SMF is storing cookie information that'd be great.
The second plan was to use a link at the forums , probably using TP's php block. I could then send a query string in the link to the order page. I'd much rather have a separate link though from a non-forums page.
any help appreciated,
Thanks
TP uses SMF login/logout process. IT shouldn't be modified. As for how all the information is stored and uses you should ask at SMF.
Ok thanks, how about this one: If i use the php block to make a link with the user's name in the querystring how hard would that be?
if it's easy maybe a quick example? something like
www.mydomain.com/index.aspx?username=Bob
I can can do research on this and learn more php, so if it pisses you off then don't answer lol
Depends on what you're trying to do. If you want it to display a certain user name you can just manually input the members name into the URL. But are you trying to automate anything? I need more of an idea of what and why you're trying to do.
Ya what i want is automated and different for whoever is looking at the link. I figured this would be doable in the php block. And Ideally it would not require any sql commands.
So if Bob were looking at the php block in the forums then the link would be
<A href="www. mydomain. com/orders.aspx? username= Bob> Click Here to Order. </A>
And if it were Mary signed in to the forums then it would be:
<A href="www. mydomain. com/orders.aspx?username=Mary >Click Here to Order. </A>
Some of these lines look different than what is originally posted.
So, this would be easy if for instance the php code in the php block had access to a variable that stored the user's name in it, that i do not know about. I could also use the user's ID if that's more available, or anything else that's unique.
The php code for this would be something like:
<a href="www.yourdomain.com/orders.aspx?username='.$user_info['name'].'">Click here to Order</a>
This assumes you have done everything right on your part so that you're including SMF's php code into your asp page.
I think I confused ya. I am using the php box block for this, but it was going to link to an asp.net page of mine which would read the query string. This code didnt work for the php box.
Also, i'm pretty sure that you cant mix php and asp.net in the same webpage, but i could be wrong. Anyway I'm checking out some php box code snippets right now, I think i can learn a lot from them.
I gotta say i love the blocks! especially php box.
Thanks
ok, this works great in a php box:
global $user_info;
$link = 'http://www.mydomain.com/orders.aspx?username='.$user_info['username'].';pwd='.$user_info['passwd'];
echo '<a href="'.$link.'">Click here to Order</a>';
When the user goes to the link the link page can read both the user's name and hashed password from the query string. Then you can SQL the SMF database to verify that the account is valid.
The password is already hashed in the $user_info['passwd'] so you don't even need to hash it when comparing. I may add some extra characters to the $user_info['passwd'] however and take them out in my aspx page - just for extra comfort.
I came up with this by looking at some block code examples and your example and realizing $user_info is the key. Then looked at Load.php to find all possible $user_info information.