[Solved] Browser detection in PHP causes white screen [closed]

This is my first comment here sorry if its not perfect. I think its because you’re trying to echo everything at once. <?php if (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Firefox’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Chrome’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Opera’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Safari’) !== FALSE) { $str=”<script>$(document).click(function() {“; $str .= ‘ window.open(“http://google.com”, “_blank”);’; $str .= ‘ });’; … Read more

[Solved] How to echo url and database variable [closed]

You need to use dot to concate constant string with variables: echo ‘<a href=”‘.$url.'”>’.$name.'</a>’; for security reason you need to take care about propper variable escaping. Check php.net doc for htmlspecialchars and htmlentities 1 solved How to echo url and database variable [closed]

[Solved] How to echo backslash then quote? [closed]

You are adding echo to a variable $text, if this is in javascript then you should echo the value using php in your javascript – like this var test=<?php echo $test; ?>. If you are using php then you should try implementing @Guilherme Nascimento’s answer, but concatanating not adding echo to your $text variable. So … Read more

[Solved] Progress bar shows “echo is OFF” message

Your actual question of why your echos aren’t working is perfectly reasonable, and it’s an extremely common error for beginners. | is a symbol that takes the output of one command and uses it as the input of another command. In your case, you effectively have echo by itself, which will simply return the status … Read more

[Solved] How to echo random text in PHP? [closed]

$lines = array(“one”, “two”, “three”,”four”); for($i =0; i < count($lines)-1;i++){ $line = $lines[rand(0, count($lines)-1)]; $lines = array_diff($lines, array($line));//Use this to remove the index of array } i wrote this in the stack overflow chat so there might be a problem or two. though, all looks well to me. Was this what you were looking for? … Read more

[Solved] Echo an array value

Try this: $variable = $row[‘introtext’]; preg_match_all(‘/(src)=[^ ]+(\.gif|\.jpg|\.jpeg|\.png)/’,$variable, $out); print_r($out[0][0]); echo “http://mysiteurl.com/”.$out[0][0].” “; Read more about preg_match_all here 0 solved Echo an array value

[Solved] How to add link in PHP text? [closed]

Hi all you have to do is replace that code with this $website_clean = str_replace(“http://”, “”, $values->Fields[7]->Value); $website_clean = str_replace(“https://”, “”, $website_clean); echo “<div class=”col-md-3 col-sm-12″> <h6>”.$values->Fields[0]->Value.”</h6> <p class=”bottom-hline”><i class=”fa fa-map-marker”></i> “.$address.”</p> <p class=”bottom-hline”><i class=”fa fa-phone”></i> <a href=”https://stackoverflow.com/questions/63148033/tel:”.$values->Fields[6]->Value.””>”.$values->Fields[6]->Value.”</a></p> <p class=”bottom-hline”><i class=”fa fa-globe”></i> <a href=””.$values->Fields[7]->Value.”” target=”_blank”>”.$website_clean.”</a></p> <p><i class=”fa fa-envelope”></i> <a href=”mailto:”.$values->Fields[8]->Value.””>”.$values->Fields[8]->Value.”</a></p> </div>”; if($cell_count == 4){ $cell_count … Read more

[Solved] PHP not echo-ing

You cannot issue Headers after the output is already sent. echo ‘<script>alert(“Incorrect PassCode”);</script>’; header(‘Location: index.php’); // This wont work after your echo That code Won’t work. You can change that to a JavaScript redirect echo ‘<script> alert(“Incorrect PassCode”); location.href=”https://stackoverflow.com/questions/24247149/index.php”; </script>’; According to PHP Manual Remember that header() must be called before any actual output is … Read more

[Solved] PHP if/else without echo

Do you mean, how can one cleanly output many lines of HTML conditionally without having to echo each individual line? If that’s the case, something like this would do the trick: <?php if ($this->item->catid == 9) { ?> <!— put all the raw output you like here —> <?php } else { ?> <!— put … Read more

[Solved] Is there difference between echo “example” and “example” out of PHP tags? [duplicate]

For all pragmatic purposes, no, there is no relevant difference. Your script output will be “Example” in both cases. And in both cases, myCode() was executed before. In fact, the OPCodes in both cases will be the same, because PHP will echo everything outside of <?php tags. It’s basically just an implicit echo. Technically, the … Read more

[Solved] Get Session ID of a link and produce Dynamic page PHP [closed]

Then add this code on your so called something.php 1)Link 1 <a href=”https://stackoverflow.com/questions/16559631/xxx.php?link=1>Link 1 </a> 2) Link 2 <a href=”xxx.php?link=2>Link 2 </a> Then on xxx.php do this <?php if ($_GET[‘link’] == “1”) { echo “hello”; } if ($_GET[‘link’] == “2”) { echo “hi”; } ?> 2 solved Get Session ID of a link and produce … Read more

[Solved] How to make echo table with two div tag?

Just change the echo ” to echo ‘ and at last “; to ‘; ?> Below code will work <?php echo ‘<div class=”container”> <div class=”main”> <h2>User info</h2><hr/> <form id=”form1″ name=”form1″ method=”post” action=”input_form_02_qA_01.php”> <label>Name:<span>*</span></label><br /> <input type=”text” name=”nick” id=”nick” placeholder=”” required/> <label>Email address: <input type=”text” name=”email” id=”email” placeholder=”” required/> </label> <br/> <label>Age:<span>*</span></label><br /> <input type=”number” name=”age” … Read more