Jump to content

Is there a prompt box in PHP?


rohithreddyk

Recommended Posts

hi..im building a website based on PHP as part of my curriculum..it is for an academic department.. first page contains a list of courses offered(as hyperlinks)...each course contains an access key.. When student clicks on any course new page lists all the assignments given for that course. when student clicks on assignment new page displays assignment problem and a "view grades & key " button..when student clicks on view grade button he should be prompted for accesskey...

 

at present im doing it using javascript..

 

I have a hidden variable(ackey) in the form..$ackey is obtained from databse using a query

<input type="hidden" value="<?php print($ackey);?>" name="ackey" id="ackey">

 

and in javascript..

 

function checkkey(){

    var accesskey=document.getElementById('ackey').value;

    var access=prompt("Please enter access Key","");

    if(accesskey==access){

      return true;

    }

    else{

        alert('Wrong access key');

        return false;

    }

}

 

 

so as per now all is well..........but i hav read many places that javascript is not that secure and it can be easily compromised...so I am wondering if there is any way to do this without using javascript...and the requirement is clear.."there should be a prompt box"

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/159634-is-there-a-prompt-box-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.