Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I was wondering if you can change the colour of your print and echo text so that when it is displayed on your HTML page it's not simply in black? Cheers.
If you're doing this in html, always.
<?php echo "<span style='color:blue;'>blue text</span>"; ?>
If you're doing this in command line, it's a bit different. You'd need to create a library or find an existing one. Example: http://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/
Sure :
<?php
echo "<p style='color:blue'> Hello ! </p>";
?>
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
the image needs to echo to the page and it cant. $log_username refers to the folder the user is named after . How can i reference this code so that the image displays on the page?
<img src="users/<?php echo $log_username.$main_image;?>/>
As i can understand you are missing / so it will be like this
<img src="user/<?=$log_username. '/' . $main_image;?>"/>
this:
<img src="users/<?php echo $log_username.$main_image;?>/>
should be:
<img src="users/<?php echo $log_username.$main_image;?>" />
notice the double quote in the end.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have two different web designs(Created in PHP, HTML, CSS and JavaScript) Can I upload both and just switch them from time to time?
How do I redirect so i can choose what design will show when i open my website?
Try with this code :
if(some condition here)
header('Location:design1.php');
else if(some condition here)
header('Location:design2.php');
or you can also use include function.
if(some condition here)
include("design1.php");
else if(some condition here)
include("design2.php");
Thanks.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have some PHP that displays the users session name in the HTML and if the user is not logged in, then I would like it to display "User" instead.
Can I have an if statement in this case? I tried it myself but I got header errors.
This is what I've tried so far but each practical attempt just spits out more errors at me.
This is a different approach I have tried.
<?=$_SESSION['sess_user'] or ("User");?>!
<?php echo (isset($_SESSION['sess_user']) ? $_SESSION['sess_user'] : "User"); ?>
This will check if the session is set, if it is then echo the session, if it isn't then it will echo "User".
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am trying to link to an external site.
where as $location outputs the URL (e.g. www.siteurl.com)
How do I make the outputted url a link and not just text
Thanks
Just echo out the anchor tags
echo 'Click';
Just try below code for other external site in new tab
echo 'Link name';
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have a project in which i have to make a code in which when we click on menu bar and the option that we select in menu bar the page related to that option will display all this is to be done through my sql.Is there any way to do this task.
I don't understand exactly what you want and if there is a better way to do this, but don't put in your sql fields PHP code.
You can create a xml document instead, and use it better.PHP.net - XMLdocument