air_tebu Posted January 27, 2008 Share Posted January 27, 2008 hi, i'm trying to make a data link that only authorized person( reconized by session) can view the data this is link code <td><a href="" onclick="validate('You Are Not Autorized')">Delete</a></td> and this is java code function validate(txt) { if ( $_SESSION['MM_Username'] == $row_rs_MainTable['insrt_by'] ) { location.href = insert_data3.php?recordID=<?php echo $row_rs_MainTable['cust_no']; ?> } else [/td][/tr][/table] { alert(txt); } } Link to comment https://forums.phpfreaks.com/topic/88017-help-url-validation/ Share on other sites More sharing options...
phpQuestioner Posted January 27, 2008 Share Posted January 27, 2008 Javascript does not handle sessions; it can handle cookies, but not sessions. You will have to validate sessions server side. Link to comment https://forums.phpfreaks.com/topic/88017-help-url-validation/#findComment-450344 Share on other sites More sharing options...
air_tebu Posted January 27, 2008 Author Share Posted January 27, 2008 how i'm suppose to do then? i'm quite blur rite now Link to comment https://forums.phpfreaks.com/topic/88017-help-url-validation/#findComment-450346 Share on other sites More sharing options...
phpQuestioner Posted January 28, 2008 Share Posted January 28, 2008 here is a basic server side session validation using php: http://www.tizag.com/phpT/phpsessions.php Link to comment https://forums.phpfreaks.com/topic/88017-help-url-validation/#findComment-450802 Share on other sites More sharing options...
air_tebu Posted January 28, 2008 Author Share Posted January 28, 2008 hmm, how to write function in php? its look like java cant handle the session. i understand about the session in php and already validate the session. what i need to do is, compare the user that log in(session) with $row_rs_MainTable['insrt_by']. if the user session match with the record field 'insert_by', it will open new page with url parameter. if user session not match, it will alert that user not autorized. Link to comment https://forums.phpfreaks.com/topic/88017-help-url-validation/#findComment-450866 Share on other sites More sharing options...
phpQuestioner Posted January 28, 2008 Share Posted January 28, 2008 hmm, how to write function in php? its look like java cant handle the session. i understand about the session in php and already validate the session. what i need to do is, compare the user that log in(session) with $row_rs_MainTable['insrt_by']. if the user session match with the record field 'insert_by', it will open new page with url parameter. if user session not match, it will alert that user not autorized. you need to post php related questions in the php forum of this site. http://www.phpfreaks.com/forums/index.php/board,1.0.html Link to comment https://forums.phpfreaks.com/topic/88017-help-url-validation/#findComment-450951 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.