faces3 Posted April 18, 2013 Share Posted April 18, 2013 File1: <?php $home['1']='home/1.php' $home['2']='home/2.php' ?> File2: <?php Include File1.php <a href="<?php echo $home['1']; ?>">home 1</a> ?> Whats wrong is that simple script? Can someone help me little bit Link to comment https://forums.phpfreaks.com/topic/277121-link-filename-get-another-file/ Share on other sites More sharing options...
computermax2328 Posted April 18, 2013 Share Posted April 18, 2013 Well to start off, idk if you just forgot to paste them in but in file1.php home/1.php and home/2.php dont have semicolons at the end. It should be... <?php $home['1']='home/1.php'; $home['2']='home/2.php'; ?> Second, not really sure why you have a / between "home" and 1. Just name the file home1.php. Also, just name your variables $home1 and $home2. Correct me someone if I am wrong, but I am pretty sure the 1 and 2 are only used after a variable to identify them in a common array. Correction: multidimensional array, not common array Link to comment https://forums.phpfreaks.com/topic/277121-link-filename-get-another-file/#findComment-1425666 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.