Search the Community
Showing results for tags 'syntax'.
-
Hello guys! I have literally started learning how to code. And I have come to the point when I got to deal with elseif syntax which is not working properly and messes up everything I have done so far. Here's the script $password = "tulip"; if ($password == "tulip") { echo '<b>Hello!</b><br> Welcome to the website Blaise!'; } else { echo '<b> The password or login is incorrect <br> Please try again </b>'; } elseif ( $password == "daisy") { echo '<b> Welcome Kate! </b>; } When I type in "daisy" nothing goes on and everything just gets stuck. Any help or explanation? Thanks
-
So I am creating php script to make my navigation for a website. I've gathered bits and pieces from books/online forums. One thing that is confusing me is what does the "?" in this line accomplishes? $currentTitle=isset($mainMenu[$currentPage]) ? $mainMenu[$currentPage] : ''; As you can imagine this is a hard question to find an answer to because of the use of ?'s in <?php. Also a little confused on the : symbol also. I am writing this script to keep track of the current page to generate a css class to be modified, which works. But then I also thought id have it generate the titles too but when i echo this.. The script goes bad. echo' <title> ',(is_empty($currentTitle) ? '' : $currentTitle.' - '),$siteTitle,' </title> ' I would be grateful for any help! Thanks in advance.
-
I’m never altogether sure when something is maybe going on but I think this time it’s just my typing it in wrong. I’m working on some Youtube Wordpress tutorials and I’m having an issue with the script finding the style.css file. Of course the script is is calling a Wordpress function but it is after all written in php. So here’s the function… function nq_styles() { wp_enqueue_style('style', get_stylesheet_uri(style.css)); } This function was working until I moved the the style.css fill up one level to its own folder. So now the file resides in css/style.css So I change dthe file path in the function to… function nq_styles() { wp_enqueue_style('style', get_stylesheet_uri(css/style.css)); } I’ve tried a couple of different structures, for example… /css/style.css or ./css/style.css or even //css/style.css and nothing seems to be working. What am I missing ? BTW I couldn't get the "Code" button to work