ShoeLace1291 Posted May 15, 2008 Share Posted May 15, 2008 I have a function that translates arrays in a template into PHP code. For example: USER_NAME would appear as whatever $_SESSION['username'] is equal to. What would the correct syntax be if I wanted to use $_PHP['SERVER_SELF']; in the array? $serverself = $_PHP['SERVER_SELF']; does not work, so I was thinking something along the lines of $serverself = <?php echo $_PHP['SERVER_SELF']; ?>; but I don't know what the correct syntax for that would be. Link to comment https://forums.phpfreaks.com/topic/105702-helpdont-know-what-to-call-it/ Share on other sites More sharing options...
redarrow Posted May 15, 2008 Share Posted May 15, 2008 you can set them all your self in the array names you want.... there you go a complete list to play with you can use a array or you can define() them http://uk.php.net/manual/en/reserved.variables.server.php $self=$_SERVER['PHP_SELF']; Link to comment https://forums.phpfreaks.com/topic/105702-helpdont-know-what-to-call-it/#findComment-541567 Share on other sites More sharing options...
ShoeLace1291 Posted May 15, 2008 Author Share Posted May 15, 2008 Doh* that's why it didn't work... Link to comment https://forums.phpfreaks.com/topic/105702-helpdont-know-what-to-call-it/#findComment-541568 Share on other sites More sharing options...
ShoeLace1291 Posted May 15, 2008 Author Share Posted May 15, 2008 uh, sorry but when i look at my source for my form, it still displays as $_SEVER['PHP_SELF']; Link to comment https://forums.phpfreaks.com/topic/105702-helpdont-know-what-to-call-it/#findComment-541577 Share on other sites More sharing options...
redarrow Posted May 15, 2008 Share Posted May 15, 2008 less insults does work duh* define way <?php define("SELF",$_SERVER['PHP_SELF']); define("ADDRESS",$_SERVER['REMOTE_ADDR']); echo ADDRESS; <br> echo SELF; ?> Link to comment https://forums.phpfreaks.com/topic/105702-helpdont-know-what-to-call-it/#findComment-541586 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.