php's echo 'n' space in href link [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I used PHP's echo string in the WhatsApp share link, but when I share it on WhatsApp, the title space separates the trailing characters. help me.
<a class="footerbtn" href="whatsapp://send?text= *Surinder Muni* Early To Bed & Early To Rise* %0Amysite.com/?n=Good Morning">
<?php
echo $GET['n']
?>

You need to encode space (and other potencial invalid characters) when create link in WhatsApp
echo urlencode('Good morning');
In PHP for reading the $_GET['n'] value will be
echo urldecode($_GET['n']);

Related

Getting C++ As Parameter Value, Result Only C By Using Php [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
test.php?aa=c++ and echo $_GET['aa'] result only c without ++
<?php
echo $_GET['aa'];
?>
That's because the symbol for + is treated as white space by your browser or HTTP client! If you want to actually send the symbol + in your get request, please encode it first in your web browser.
You can try converting your C++ with tools such as this one https://www.w3schools.com/tags/ref_urlencode.ASP.

Regular Expression in Laravel [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Well, I Will developer a close blog in laravel, this blog needs take the name of the people who has logged!
I wanna replace for example {[userName]} for auth->user()->name()
I Will write {[userName]} in my text editor Ane show the name of user logged in my view!
i think just use str_replace
eg:
$input = "My name is [USERNAME]";
echo str_replace("[USERNAME]", auth->user()->name(), $input);

REGEX for alternate characters in PHP [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a string mystring. I have to replace the alternate characters with x so that final output is mxsxrxnx. All the alternate characters starting from 2nd position are replaced with x. I can do it with loop but is there a Regular expression for that or a better way in PHP? Please help.
Using a reset match meta-character \K you are able to do it:
.\K.
Live demo
PHP:
echo preg_replace('/.\K./', 'x', 'mystring'); // mxsxrxnx

how to protect your php code or hide it [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
hi i take look inside some php files and find that the php inside is hidden or encrypted ,it's like this
<?php
echo "<div\x20\x69d\x3d\x22s\x69deba\x72\x22>\n\t";
if(is_active_sidebar("\x72igh\x74-\x73i\x64\x65\x62a\x72-s\x69n\x67\x6ce-\x70\x61g\x65"))
{
echo "\t\t";
dynamic_sidebar("\x72\x69\x67\x68\x74-s\x69de\x62\x61r-\x73i\x6e\x67\x6ce-pa\x67e");
echo "\t";
}
echo "\n</\x64\x69v>\x20\x3c!--\x65n\x64\x20\x23s\x69\x64e\x62\x61\x72-->\n\n";
?>
or
<?php $_F=__FILE__;$_X='Pz48NXJ0IDFsNXJ0LTVycjJyJz48NCBjbDFzcz0nNGMybi1yNW0ydjUnPjwvND4gQ1VSTCBQSFAgNXg1bnQ0Mm'));?>
so what's the difference between the both and how we can do this ?
this is not crypting but encoding, the later on is about a file identifier.
It can be done by encoding/decoding text in hexadecimal instead of ascii see http://www.rapidtables.com/convert/number/hex-to-ascii.htm
or by using escaped unicode see https://r12a.github.io/apps/conversion/ <= this is your case

Call php function using html href [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am searching for some hours today and I can not find the solution.
Here is the phpfuntion inside of the html href, which uses explode php-build-function to split the email and get the chars after #.
<a href='<?php echo afterchar('#',$nazwa_uz_l); ?>'>Log in <?php afterchar('#',$nazwa_uz_l); ?></a>
While I click the link it goes to localhost/gmail.com instead of gmail.com.
What should I do?
Try like this
<a href='http://<?php echo afterchar('#',$nazwa_uz_l); ?>'>Log in <?php afterchar('#',$nazwa_uz_l); ?></a>
The URL is relative if there's no protocol (http://) leading the URL.

Categories