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';
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
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 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>";
?>
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 want to redirect the page if the user is using mobile from
https://example.com
to
https://example.com/mobile/.
please suggest me php or .htaccess code
http://mobiledetect.net/
Using this you can check quite easily whether it is mobile or not.
include 'Mobile_Detect.php';
$detect = new Mobile_Detect();
// Check for any mobile device.
if ($detect->isMobile())
header('Location: https://example.com/mobile');
else
// other content for desktop
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
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 9 years ago.
Improve this question
I want to post a message/image on facebook created page.I have created the functionality in my website admin section to upload image,add contents but need to know how can i post directly from website to my facebook page .
I have created a website in php.
It is easy to post pictures and status in FB using PHP. See the below link..
https://developers.facebook.com/docs/reference/php