peeler1967 Posted October 26, 2012 Share Posted October 26, 2012 presently I have this <link rel="stylesheet" type="text/css" href="<?php echo get_bloginfo('stylesheet_directory');?>/admin/layouts/<?php echo $data['alt_stylesheet'];" /> but it is not showing the $data['alt_stylesheet']; If I put the echo $data['alt_stylesheet']; is a single line it shows the data but in the link line it won't what am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/ Share on other sites More sharing options...
Jessica Posted October 26, 2012 Share Posted October 26, 2012 You never ended your PHP after echo'ing it. You should have a fatal error. Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1387988 Share on other sites More sharing options...
peeler1967 Posted October 26, 2012 Author Share Posted October 26, 2012 actually I do apologize but I did close the php <link rel="stylesheet" type="text/css" href="<?php echo get_bloginfo('stylesheet_directory');?>/admin/layouts/<?php echo $data['alt_stylesheet']; ?>" /> It's been a very long day and forgot to type that when posing my question. Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1387993 Share on other sites More sharing options...
Jessica Posted October 26, 2012 Share Posted October 26, 2012 (edited) How about you just copy and paste the ACTUAL code then, so you don't make more mistakes? Run a print_r($data); - what do you get? Also, do this instead: <?php $directory = get_bloginfo('stylesheet_directory'); echo '<link rel="stylesheet" type="text/css" href="'.$directory.'/admin/layouts/'.$data['alt_stylesheet'].'" />'; ?> Easier to read. Edited October 26, 2012 by Jessica Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1387998 Share on other sites More sharing options...
peeler1967 Posted October 26, 2012 Author Share Posted October 26, 2012 style.css is what I get if I go in and change the style to white .css it shows white.css Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1388000 Share on other sites More sharing options...
peeler1967 Posted October 26, 2012 Author Share Posted October 26, 2012 if this helps at all here is where I make the option choices $of_options[] = array( "name" => "Theme Stylesheet", "desc" => "Select your themes alternative color scheme.", "id" => "alt_stylesheet", "std" => "style.css", "type" => "select", "options" => $alt_stylesheets); Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1388006 Share on other sites More sharing options...
Jessica Posted October 26, 2012 Share Posted October 26, 2012 That code has absolutely nothing to do with the other code. You also didn't answer my question or say if you changed it to match my suggestion. Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1388008 Share on other sites More sharing options...
peeler1967 Posted October 26, 2012 Author Share Posted October 26, 2012 I tried your suggestion and it still doesn't show the the 'alt_stylesheet' part. if I go below the header into the body of the page and echo the alt_stylesheet it prints it on the screen just fine. Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1388011 Share on other sites More sharing options...
Jessica Posted October 26, 2012 Share Posted October 26, 2012 (edited) Try rebooting it. Edited October 26, 2012 by Jessica Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1388017 Share on other sites More sharing options...
peeler1967 Posted October 26, 2012 Author Share Posted October 26, 2012 it may be highly irregular, but I moved that code from the header to the body and it works perfectly. Not sure what's up with the header aspect but i got it to work. Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1388018 Share on other sites More sharing options...
PFMaBiSmAd Posted October 26, 2012 Share Posted October 26, 2012 You probably have a variable scope problem, either due to pasting together a page using include statement with URL's instead of file system paths or you are using functions to output content and they don't have access to the variables. Posting your code, less any database connection details, from the start of your main file through to the echo statement that doesn't work would be the quickest way of getting a solution. Quote Link to comment https://forums.phpfreaks.com/topic/269947-help-with-getting-some-php-to-show-in-a-link/#findComment-1388020 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.