PHP

120K

Solutions

33K

Contributors

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

Share tech news, updates, or what's on your mind.

Sign up to Post

Dear Experts,
I use PHP, I need to get a token from a link using below information.
How can I do that? Thank you

Method : GET
Authorization  Type : oauth2
Grant Type : password
Content-Type : application/x-www-form-urlencoded
RequestUrl :xxxxxxxxxxx


Service Input Parameters:

username as string
password as string
client_Id as string

Service Return Parameters:

access_token as string
token_type as string
expires_in as string

thank you in advance.
0
Introduction to Web Design
LVL 12
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Hello,  I am having problems with a WordPress plugin call WP-Job Manager, particularly trying to create a custom template for single jobs.

I have customized the default template by copying "content-job_listing.php"  from the plugin directory to  /themes/enfold/job_manager/content-job_listing.php. This works great, and is my template for all jobs. See code below.

<?php
/**
 * Single job listing.
 *
 * This template can be overridden by copying it to yourtheme/job_manager/content-single-job_listing.php.
 *
 * @see         https://wpjobmanager.com/document/template-overrides/
 * @author      Automattic
 * @package     WP Job Manager
 * @category    Template
 * @since       1.0.0
 * @version     1.28.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

?>
<div class="single_job_listing">
	
	<h2><?php the_title(); ?></h2>
		
	<div class="hide_above_mobile">
		<?php display_job_phonenumber_data(); ?>
	</div>
	
	<?php if ( $apply = get_the_job_application_method() ) :
		if ( $apply->type === 'url' ) {
	    	$application_href = $apply->url;
		} elseif ( $apply->type === 'email' ) {
	    	$application_href = sprintf( 'mailto:%1$s%2$s', $apply->email, '?subject=' . rawurlencode( $apply->subject )  );
		}
	?>
	
	<div class="application">
		<a class="application_button button" href="<?php echo $application_href; ?>" target="_blank"><?php _e( 'Apply for job', 'wp-job-manager' ); ?></a>
	</div>

	<?php endif; ?>

	<?php the_content() ?>
	<?php 

Open in new window

0
Hello, I have a website hosted at InMotion hosting an I'm having trouble making the .htaccess rules work properly. I need rules for:

1. Force https on every page
2. Force www. when not entered
3. Hide index.php, so a page looks like this https://www.gastronegocios.com/contacto instead of https://www.gastronegocios.com/index.php/contacto

I currently have this rules, but their not working properly:

RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$

RewriteEngine On

RewriteBase /
RewriteCond %{HTTPS} off

RewriteCond %{HTTP_HOST} ^gastronegocios.com [NC]
RewriteRule (.*) https://www.gastronegocios.com/$1 [R=301,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?/$0 [PT,L]

Open in new window

0
A CSS question:

Let's take the <td> tag as an example

Is it possible to make a custom css tag and use that to dictate the styling of any <td> tags inside it
ie
css page:
customtag > td
{
some condition
}
php page:
<customtag><td> text </td></customtag>

The reason for this is that I want to add a specific condition to a set of <td> tag's which already have defined css conditions defined for that particular tag in the css page in the rest of the php page
0
Trying to call to yahoo weather api which is still using oauth 1

here is the code i have

https://trycf.com/gist/819eb1b6690c890a753d2c75e2355e2d/lucee5?theme=monokai

But i am getting unauthorized for this (401)
0
Login Page - My users are registered but I receive an error message when they try to log in.


		$q = "SELECT id, username, pass FROM users WHERE email='$e' AND active = 1 ";
		
		$r = mysqli_query($db, $q) or trigger_error("Query: $q\n<br>MySQL Error: " . mysqli_error($db));
		
if (@mysqli_num_rows($r) == 1) { // A match was made.
			
			
			// Fetch the values:
list($id, $username, $pass) = mysqli_fetch_array($r, MYSQLI_NUM);
			mysqli_free_result($r);
			
			// Check the password:
			if (password_verify($p, $pass)) {
				// Store the info in the session:
				// Store the data in a session:
	
	$_SESSION['id'] = $user_id;
	$_SESSION['username'] = $username;
				
				mysqli_close($db);
				
				// Redirect the user:
				//$url = BASE_URL . 'Login.php'; // Define the URL.
				
				//ob_end_clean(); // Delete the buffer.
				//header("Location: $url");
				
				exit(); // Quit the script.
			} else {
				echo '<p class="error">Either the email address and password entered do not match those on file.</p>';
			}
		} else { // No match was made.
			echo '<p class="error">Either the email address and password entered do not match those on file.</p>';
		}
	} else { // If everything wasn't OK.
		echo '<p class="error">Please try again.</p>';
	}
	mysqli_close($db);

} // End of SUBMIT conditional.

/* PAGE CONTENT STARTS HERE! */
?>

Open in new window

0
In a prior program leading up to the problem I have this code.
echo "ckd_sels array = " . implode('; ', $ckd_sels) . "<br>";
	$_SESSION['ckdsels'] = $ckd_sels;

Open in new window


In a subsequent program, to confirm it was working working with $_SESSION as an array.

ckd_sels array = ck2870-867-1; ck2877-867-1; ck2879-867-1

then, later on, I have this code:

$ns = sizeof($chkd);
	//echo "ckd_sels array = " . implode('; ', $chkd) . "<br>";
	for ($i = 0; $i < $ns; $i++) {
		// old sel & pid
		$keys = explode($chkd[$i] , "-");
		$qryu = "SELECT * from selections where pid =  " . $keys[0] . "  and ruid = " . $keys[1];
		$resu = mysqli_query($link, $qryu);
		$qryp = "Update selections set pid = " . $npid . " where pid =  " . $keys[0] . "  and ruid = " . $keys[1];
		echo "keys = " . $keys[0] . ", keys1 = " . $keys[1] . "<br>";
		$resp = mysqli_query($link, $qryp);
	}

Open in new window


which produces this:


Warning: explode(): Empty delimiter in /home/lakoshva/public_html/devdev/new_proj_wsels.php on line 26
keys = , keys1 =

Warning: explode(): Empty delimiter in /home/lakoshva/public_html/devdev/new_proj_wsels.php on line 26
keys = , keys1 =

Warning: explode(): Empty delimiter in /home/lakoshva/public_html/devdev/new_proj_wsels.php on line 26
keys = , keys1 =

This tells me I cannot use a for loop as I have.

How can I extract the individual elements from the array. Should I replace the array with "," instead of ";"?

Thanks
0
I am trying to add WooCommerce order number and order total to the head tag of thank you page. Here is my code I have in header.php

<?php if(is_wc_endpoint_url( 'order-received' )){ 
global $woocommerce;
$orderid = $woocommerce->order->get_id();
$ordertotal= $woocommerce->order->get_total();
?>
<!-- Google Code for Conversion Page -->
<script>
  gtag('event', 'conversion', {
      'send_to': 'AW-xxxxxxxxxx/abcdefgshig',
      'value': <?php echo $ordertotal; ?>,
      'currency': 'USD',
      'transaction_id': <?php echo $orderid; ?>
  });
</script>
	
<?php } ?>

Open in new window


And when I place an order just displays a blank page and if I view source it stops at  'value': ,

What am I doing wrong. Any advice is appreciated

Thanks
0
When my Magento 1.9.3 install rebuilds the cache after an image flush, not all images are included for some reason.  The images are there and have uploaded successfully, but are not being built into the cache so they don't show up on the frontend or backend.

I have:
-set memory to 2048M
-made sure images were set to "global"
-checked permissions on the server

-cleared cache, image cache, and re-indexed

 

Any thoughts?
0
 if ($sanitizedProps !== null || $sanitizedProps !== false) {
                            $varifyProperty[$postField] = $sanitizedProps;
                        } elseif($sanitizedProps == false){
                            $cusProperty[$postField] = $sanitizedProps;
                        }

Open in new window



test: false

Open in new window


So whats suspose to happen is this is within loop,  if it doesnt equel null or false than populate varifyProperty array else if the value is false than add it to cusProperty var

pretty simple, but it is adding the false values to varifyProperty and not cusProperty, what am i doing wrong ?  i did a test var to see what the last value is on the loop which is confirmed false.

any hints ?
1
Become a Certified Penetration Testing Engineer
LVL 12
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

I have set 2 custom cookies to be saved when user clicks a button that runs the script to save the cookies.

The issue is that I need these to be saved through HTTPS because I am using them on a store locator page, and need a secured connection to allow for location detection to happen properly.

When I do not add TRUE for secure connection and leave code as shown below, the cookies save just fine when running through HTTP.

setcookie('lat', $_POST['lat'], time()+62208000, '/', $_SERVER['HTTP_HOST']);
setcookie('lng', $_POST['lng'], time()+62208000, '/', $_SERVER['HTTP_HOST']);

Open in new window

However, when I try to add TRUE for secure connection as shown below, it does not work properly with HTTPS running:

setcookie('lat', $_POST['lat'], time()+62208000, '/', $_SERVER['HTTP_HOST'], TRUE);
setcookie('lng', $_POST['lng'], time()+62208000, '/', $_SERVER['HTTP_HOST'], TRUE);

Open in new window


I have tried including httponly as either TRUE or FALSE as well, but nothing seems to have worked.

If anyone could give any tip about getting this resolved, I would appreciate it!

Thank you!
0
Hello Experts!

Please I want the ENTER KEY to perform the same function as the Submit button in the code below.

I've tried this:
$('.chat_message').keypress(function (e) {
	 var key = e.which;
	 if(key == 13)  // the enter key code
	  {
	    var to_user_id = $(this).attr('id');
        var chat_message = $('#chat_message_'+to_user_id).val();
        if (chat_message == ""){
            toastr.error("Your message is empty");
            return false;
         }
        var to_username = $('#to_username_'+to_user_id).val();
        $.ajax({
            url:"../controllers/insert_chat",
            method:"POST",
            data:{to_username:to_username, to_user_id:to_user_id, chat_message:chat_message},
            success:function(data)
            {
                $('#chat_message_'+to_user_id).val('');
                $('#chat_history_'+to_user_id).html(data);
            }
        })
	    return false;  
	  }
	});

Open in new window

Each time I press ENTER KEY, the page reloads and bootstrap modal disappears.

modal_content += '<input name="chat_message_'+to_user_id+'" id="chat_message_'+to_user_id+'" placeholder="Type your message here ..." type="text" class="form-control chat_message" autocomplete="off"><span class="input-group-btn"><button name="send_chat" id="'+to_user_id+'" class="btn btn-sm btn-info no-radius send_chat" type="button"><i class="ace-icon fa fa-share"></i>Send</button></span></div></div>';

Open in new window


AJAX:
$(document).on('click', '.send_chat', function(){
        var to_user_id = $(this).attr('id');
        var chat_message = $('#chat_message_'+to_user_id).val();
        if (chat_message == ""){
            toastr.error("Your message is empty");
            return false;
         }
        var to_username = $('#to_username_'+to_user_id).val();
        $.ajax({
            url:"../../insert_chat",
            method:"POST",
            data:{to_username:to_username, to_user_id:to_user_id, chat_message:chat_message},
            success:function(data)
            {
                $('#chat_message_'+to_user_id).val('');
                $('#chat_history_'+to_user_id).html(data);
            }
        })
    });

Open in new window

0
MySQL form POST to database.  When INSERT INTO query is performed on what seems are random basis (or perhaps it is based on content of the data POSTed from the text area on the from, the data saved to the field in the database sometimes has duplicate information.  For example, if there are multiple sentences, a portion of one of the sentences will be duplicated in the paragraph of text.  Not sure what would cause something like this.  When using the form we can edit and try to save the same text several times, usually it will eventually save correctly.  I have several other application/database pairs on the same web/mysql server and don't seem to experience this issue.  So I am assuming the problem is coming from this specific website.

Here are some code snippets:

from the PHP form:

<div id="workOrderForm">
                  
                                                   
                              <form name="workOrderForm" method="post"  action="formdata.php">
               
                                       <div class="formLable">Client Code:</div>
                                       <input name="clientCode" type="text" class="formFiller" onkeypress="return disableEnterKey(event)" option value="<?php echo $result['clientCode'];?> "  />
                                    
                                    <div id="emailLable">Email:</div>
                                       <input name="email" type="text" id="emailFiller" onkeypress="return disableEnterKey(event)" option value="<?php echo $result['email'];?>" />
                                                                        
                                    <div class="formLable">Company Name:</div>
                                       <input name="companyName" type="text" class="formFiller" onkeypress="return …
0
I have Windows OS 7 and i am running NGINX, php 7.3 and MAria DB 10.3. I am trying to connect to mysqli from php and i get the error, which is actually a warning but nothing works.

mysqli::__construct(): (HY000/2002): An attempt was made to access a socket in a way forbidden by its access permissions
I am trying to connect using a socket named 'MariaDB'. Can anybody help?

This is my.ini file.

[mysqld]
datadir=C:/Program Files/MariaDB 10.3/data
skip-networking
named-pipe=ON
socket=MariaDB
port=3306
innodb_buffer_pool_size=1007M
character-set-server=utf8
[client]
socket=MariaDB
protocol=pipe
plugin-dir=C:/Program Files/MariaDB 10.3/lib/plugin
0
DataTables warning: table id=data-table - Requested unknown parameter 'Practice skills' for row 0, column 5. For more information about this error, please see http://datatables.net/tn/4
Upload2.html
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Import CSV File into Jquery Datatables using PHP Ajax</title>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>  
  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <style>
  .box
  {
   max-width:600px;
   width:75%;
   margin: 0 auto;;
  }
  </style>
    </head>
    <body>
	<div class="container">
   <br />
    <h3 align="center">Mark distribution Sheet</h3>
   <h3 align="center">Introduction to Mobile Application</h3>
   <br />
<form action="import2.php" method="post" enctype="multipart/form-data">
<div class="col-md-3">
     <br />
     <label>Add More Data</label>
    </div> 
	<div class="col-md-4">  
            <input 

Open in new window

0
Hi,  I'm creating a PHP and MySQL web application for a client. I'm a fairly new web developer.
Is there a way to add page titles and meta tags dynamically? It's a small application. I'm not using a Framework.
I saw a couple of possible solutions on google, but am not sure what the easiest and most efficient way of doing it would be.

Possible Solution #1, add variables in my header.php page and then on each respective page for example about, contact etc... add those variables above the include statement.
Here is my header.php code:

?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="<?php echo $meta_description; ?>">
	<meta name="author" content="Ryan Sacks">
	<link rel="icon" href="img/favicon.ico">
	
	<title><?php echo $page_title; ?></title>
	
	<!-- Bootstrap core CSS -->
	<link href="css/bootstrap.min.css" rel="stylesheet">
	
	<!-- Font Awesome Icons -->
	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
	
	<!-- Custom CSS -->
	<link href="css/style.css?v=<?php echo time(); ?>" rel="stylesheet">
	
	<!-- Google Fonts -->
	<link href="https://fonts.googleapis.com/css?family=Oswald:300,400,500" rel="stylesheet">
	<link 

Open in new window

0
i have create a report.html  i need an extra page on report.html is that possible
0
i wanna to create an auto generated report that able to write content ,insert result analysis  is there any example of source code to wrote in php or html
basic_html.doc
0
Upload1.html
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Import CSV File into Jquery Datatables using PHP Ajax</title>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>  
  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <style>
  .box
  {
   max-width:600px;
   width:75%;
   margin: 0 auto;;
  }
  </style>
    </head>
    <body>
	<div class="container">
   <br />
    <h3 align="center">Mark distribution Sheet</h3>
   <h3 align="center">Cisco Discovery 1</h3>
   <br />
<form action="import1.php" method="post" enctype="multipart/form-data">
<div class="col-md-3">
     <br />
     <label>Add More Data</label>
    </div> 
	<div class="col-md-4">  
            <input type="file" name="csv_file">
			</div>  
	<div class="col-md-5">
            <input type="submit" value="Upload">
			</div>  
			<div style="scrollleft"></div>
			<div style="clear:both></div>

        </form>
	<br />
   

Open in new window

0
Learn Ruby Fundamentals
LVL 12
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

import.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);


if ( ! empty($_FILES['csv_file']['name']) ) {

    $file_data = fopen($_FILES['csv_file']['name'], 'r');
    fgetcsv($file_data);

    while($row = fgetcsv($file_data) ) {
      
        if( count($row)>15):
            //now you know you have at least 16 element
            $data[] = array(
			'student_id'  => $row[0],
            'name'  => $row[1],
            'Sem'  => $row[2],
            'sec'  => $row[3],
			 'Chapter_Exam'  => $row[4],
			  'Practice skill'  => $row[5],
			   'Assignment'  => $row[6],
			   'Final_Exam'  => $row[7],
			   'Total'  => $row[8],
			   'Grade'  => $row[9],
			   'C01'  => $row[10],
			   'C02'  => $row[11],
			   'C03'  => $row[12],
			   'C04'  => $row[13],
			   'C05'  => $row[14],
			    'Status'  => $row[15]
				);
        endif;
		};

    echo json_encode($data);

Open in new window


upload2.html
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Import CSV File into Jquery Datatables using PHP Ajax</title>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
  <script 

Open in new window

1
Upload2.html
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Import CSV File into Jquery Datatables using PHP Ajax</title>
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>  
  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <style>
  .box
  {
   max-width:600px;
   width:90%;
   margin: 0 auto;;
  }
  </style>
    </head>
    <body>
      <?php include ("db.php");?>
      <div class="container">
   <br />
   <h3 align="center">Mark distribution Sheet</h3>
   <h3 align="center">Cisco Discovery 1</h3>
   <br />
<form action="import2.php" method="post" enctype="multipart/form-data">
<div class="col-md-3">
     <br />
     <label>Add More Data</label>
    </div>
      <div class="col-md-4">  
            <input type="file" name="csv_file">
                  </div>  
      <div class="col-md-5">
            <input type="submit" value="Upload">
                  </div>  
                  <div …
0
is there any hits or example of auto generate report which include word and chart in php,html in order to allow lecturer edit,delete the data in word
0
Upload.html
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Import CSV File into Jquery Datatables using PHP Ajax</title>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
  <script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>  
  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  <style>
  .box
  {
   max-width:600px;
   width:100%;
   margin: 0 auto;;
  }
  </style>
    </head>
    <body>
	<div class="container">
   <br />
   <h3 align="center">Mark distribution Sheet</h3>
   <h3 align="center">Cisco Discovery 1</h3>
   <br />
<form action="import.php" method="post" enctype="multipart/form-data">
<div class="col-md-3">
     <br />
     <label>Add More Data</label>
    </div> 
	<div class="col-md-4">  
            <input type="file" name="csv_file">
			</div>  
	<div class="col-md-5">
            <input type="submit" value="Upload">
			</div>  
        </form>
	<br />
   <br />
   <div class="table-responsive" >
    <table 

Open in new window

0
A program from laravel is sending Mail via smtp lotus notes, content of the body that includes image doesn't display the image at clients email, anyone had the same issue?
0
Need to consume a SOAP webservice with an SSL Certificate, we have the certificate and is in PEM format, all attempts to connect to the endpoint say, we've looked everywhere online and can't find the solution to this and the documentation on PHP and OpenSSL is... complex...

Error: SoapFault exception: [HTTP] Could not connect to host in

Open in new window


If we comment out the $localCert we can connect to it, the PHP version running is:

[root@smpp StartNotification]# php -v
PHP 7.0.3 (cli) (built: Feb  4 2016 20:50:17) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
[root@smpp StartNotification]#

Open in new window

    $localCert = "file.pem";
    $opciones= array( 
        "local_cert" => $localCert,
        "trace" => 1,


        "exceptions"=>1,
        "features" => SOAP_SINGLE_ELEMENT_ARRAYS,

        "stream_context"=>stream_context_create(array(
            "ssl"=>array(
                'ciphers' => 'DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA',
                'verify_peer' => false,
                'verify_peer_name' => false, 
                "ca_file"=>$localCert,
                'allow_self_signed' => false //can fiddle with this one.
            )
            )
        )

    ); 

Open in new window

0

PHP

120K

Solutions

33K

Contributors

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.