Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > osTicket 1.6.x > Mods and Customizations

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-26-2012, 02:36 PM
ZeroEffect ZeroEffect is offline
Member
 
Join Date: Sep 2011
Posts: 43
Post Client page user name and email cookie

While I know cookies are very basic. I have worked with them in Java script a bit. I have not worked with them in PHP. In fact I know little about PHP but I am finding this challenge fun.

I have found examples of how to set and retrieve data from a cookie using PHP but I am not sure where to put the code. when a client creates a new ticket from the post.php page I see some check but not the data being processed. in the open.inc.php file I see the form created and I can add the following code to read the data from the cookie. and the next line to set a cookie.

Code:
<input type="text" name="email" size="25" value="<?php echo isset($_COOKIE('myemail'))? $_COOKIE('myemail') : " " ?>">

setcookie('myemail',$txt);
Problem is based on the code all ready there, it does a check if the user is logged in.

Code:
            <?if ($thisclient && ($email=$thisclient->getEmail())) {
                ?>
                <input type="hidden" name="email" size="25" value="<?=$email?>"><?=$email?>
            <?}else {?>             
                <input type="text" name="email" size="25" value="<?=$info['email']?>">
            <?}?>
Could some one give me a hand in guiding me to a solution? All I want is the user with out logging in to check a ticket to have a cookie populate the name and email text boxes when they go to enter a new ticket.

Thanks

ZeroEffect
Reply With Quote


Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:15 PM.