Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
$uid = mysql_real_escape_string($_SESSION['username']);
$url = "https://blockchain.info/merchant/$guid/new_address?password=$main_password&second_password=$second_password&label=$uid";
if (isset($_POST['amount'])){
$_SESSION['USD_amount'] = $_POST['amount'];
$_SESSION['BTC_amount'] = number_format($_SESSION['USD_amount']/$rate, 8, '.', '');
$temp = _curl($url, '', '');
$_SESSION['BTC_Address'] = get_string_between($temp, 'address":"', '"');
}
I have curl the latest version installed but it doesn't seem to fix the problem.
Any suggestion ?
Curl is initiated with, for example:
$ch = curl_init($url);
there's no function called _curl()
Suggested reading:
http://php.net/manual/en/book.curl.php
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I am trying to pass a simple php value to html but I cannot format it in the right way. How can I do this?
<?php
$html = '
<img src="'$val'.svg" alt="15"> //Does not work
';
$val = 5;
?>
You would try to format it this way:
<?php
$val = 5;
$html = "<img src='${val}.svg' alt='15'> ";
?>
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I'm retrieving the postal code by using -
<?php $pstcde = file_get_contents('https://ipapi.co/'.$_SERVER['REMOTE_ADDR'] . '/postal/'); ?>
It works great but if the postal code is not found, it says, "None". I can't find a way to disable the message.
You can empty the variable if the respond is None. With a simple check.
<?php
$pstcde = file_get_contents('https://ipapi.co/'.$_SERVER['REMOTE_ADDR'] . '/postal/');
if($pstcde === "None")
$pstcde = ""; //Empty string. Or you can use unset($pstcde); if you want to unset the variable.
?>
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
Kindly help correct the code below:
PHP Strict Standards: Only variables should be passed by reference in /home/xxxxxx/public_html/app/mods/Controller/Menu.php on line 15
The code is as below:
public function __call($function, $parameters){
$categoria = strtolower(str_replace('Action',NULL,$function));
$platillo = strtolower(array_pop( array_flip($_GET)));//line 15
Thank you in advance
array_pop requires a reference to a variable. A reference means it has to be a variable - i.e. you can do:
$x = ["a", "b"];
array_pop($x);
but not
array_pop(["a","b"]);
So, to fix your issue, you would do:
$flipped_get = array_flip($_GET);
$platillo = strtolower(array_pop($flipped_get));//line 15
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
Im newbie in php im learning it since some weeks ago but i didnt understand one thing.
I have a
$url = "http://example.com/";
define('LOCATION', '<?php echo $url; ?>');
but it is not working. I didnt understand why "define" term cannot read
<?php
$url = "http://example.com/";
define('LOCATION', $url);
1.You are alreay in php tag,so no need of any extra php tag.
2.And when assigning value to a variable , we never use echo in php . Its used to display value in html only.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
This is my page url
http://myaliveidea.com/news/news/readmore/56/%20When%20Harry%20and%20Sally%20met%20New%20York%20City
but i want my page url like this
http://myaliveidea.com/news/news/readmore/59/When-Harry-and-Sally-met-New-York- City
the solution of this question is
<?php
$url = str_replace(' ','-',$sport['title']);
$url = str_replace(":",'',$url);
$url = str_replace("'",'',$url);
?>
<?php echo $sport_top['title'];?>
Use urldecode();
$url = urldecode($url);
then replace spaces(' ') by - using str_replace();