Adsense
Popular Posts
- Code update from PHP 7.4 to PHP 8.1 - PhpSpreadsheet
- MySQL workbench -"Could not decrypt password cache"
- Code update from PHP 7.4 to PHP 8.1 - Worksheet/Iterator.php
- Rendering HTML tags inside textarea
- axios handle blob type data
- Unix Utils and wget in Windows
- Setup vi syntax for PHP
- increase mysql query speed
- EXCEL return to the next line in the same cell
- git svn conversion
Wednesday, February 5, 2014
PHP: transfer long data to url variable
In the following example, I have a pubmed abstract stored in $choppeddata and I want to transfer to a url variable in a popup up windows. Later I can use $_GET to obtain the value. PHP function urlencode is used to deal with space and non-alphanumeric characters properly.
code
<?php
$chosenperson = 2255;
$choppeddata = "1: Park YJ, Woo M, Kieffer TJ, Hakem R, Safikhan N, Yang F, Ao Z, Warnock GL, Marzban L. The role of caspase-8 in amyloid-induced beta cell death in human and mouse islets. Diabetologia. 2014 Jan 19. [Epub ahead of print] PubMed PMID: 24442508."
$puburldata=urlencode($choppeddata);
?>
<a class="txt-button" onclick="javascript:void window.open('test.php?person=<?php print $chosenperson; ?>&pubabstract=<?php print $puburldata; ?>','child','width=900,height=500,resizable=false,left=0,top=0' );return false;">To add a new pubmed, please click this link and fill in its details</a>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment