PHP

118K

Solutions

126

Articles & Videos

32K

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

Hello Experts,

I would like to know if the is a authentication library within Laravel Framwork can support the following requirements? If so, what is it?

any immediate help is highly appreciated.
-regards

> - Application to prevent the re-use of the last 4 passwords.
> - After 5 failed login attempts to the application, further login attempts will remain locked until the affected account is unlocked by an administrator.
> - Password aging set to no more than 90 days, after that they should be reset.
> - Unused accounts should be disabled after one year of inactivity so that they may not be used to access the application.
> - After 5 failed login attempts to the application, further login attempts will be made impossible until the affected account is unlocked by an administrator.
0
Secure Your WordPress Site: 5 Essential Approaches
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Hello,
I'm using Prestashop 1.7

I need to trigger an email to be sent each time the action is true, here is the code that I have:

 public function setAwaitingButton($echo, $tr)
    {
        $url = self::$currentIndex.'&token='.$this->token.'&view'.$this->table.'&id_seller='.(int) $tr['id_seller'].'&id_cart='.(int) $tr['id_cart'].'&releasepayment=1';
        $action = $this->l('Awaiting payment validation period');
        if ($tr['pending_amount'] > 0) {
            if ($tr['is_order_shipped']) {
                $shippedDate = strtotime($tr['shipped_date']);
                $currentDate = strtotime(date('Y-m-d H:i:s'));
                $remainingDays =  $currentDate - $shippedDate;
                $daysleft = round((($remainingDays/24)/60)/60);
                if ($daysleft > Configuration::get('MANGOPAY_ADMIN_TIME_HOLD')) {
                    $disabled = '';
                    $action = $this->l('Release payment to seller');
       I believe the mail send action must be injected at this line?            
                } else {
                    $disabled = 'disabled="disabled"';
                }
            } else {
                $disabled = 'disabled="disabled"';
            }
        } else {
            $disabled = 'disabled="disabled"';
            $action = $this->l('Transfered Successfully');
        }
       

I need the mail::send syntax so the email can be sent to a gmail account

Thanks Experts
0
Hi,

I presume this question / answer will be different for each bank... however... does anyone know if it is possible to obtain your bank balance from your account and display it in a php application?

Thanks in advance for your help.
0
Please I need any alternative solution to how to edit and save an entry on a typical profile page data. Below is my current code which works fine until when the text entry on any of my field contains an apostrophe. So in the code below, I'm using the text entry as the ID for the input element. Anything I click on the edit button to edit the entry, this line of my code brings up an editable field of the text -
document.getElementById(nameid).innerHTML = "<input type='text' value='" + name + "' id='" + txtnameid + "'>";

Open in new window

But instead of having the full text of - I'm a photographer in the editable field, I will only see the first letter of the string which is letter I
The remaining text don't show up, and when i click on the save button, I get the error - Uncaught TypeError: Cannot read property 'value' of null at save3 (functions.js:502)
This is because of the apostrophe in my text which I'm using as my input ID.
Is there any other way I can write this code that won't involve using text input as my ID? Thanks all.

<?php
$aboutme = 'I'm a photographer';
echo '<div id="name3<?php echo $aboutme; ?>"><?php echo $aboutme; ?> </div>';
echo '<input type="button" id="<?php echo $aboutme; ?>" name="<?php echo $aboutme; ?>" value="Edit" onclick="edit3(this.id)">';
echo '<input type="button" id="save3<?php echo $aboutme; ?>" class="saveBtn" name="<?php echo $aboutme; ?>" value="Save" style="visibility:hidden" onclick="save3(this.name);">';
?>

Open in new window


JavaScript
Function for edit button
function edit3(id) {
    nameid = "name3" + id;
    txtnameid = "txtname" + id;
    var name = document.getElementById(nameid).innerHTML;
    document.getElementById(nameid).innerHTML = "<input type='text' value='" + name + "' id='" + txtnameid + "'>";

    updateid = "save3" + id;
    
    document.getElementById(id).style.visibility = "hidden";
    document.getElementById(updateid).style.visibility = "visible";
    
}

Open in new window


Function for save button


Open in new window

0
Hello,
the XML returned through  certain application  APIs regarding some persons is the following:

<users total_record_count="1">
<user link="http://somelink.com">
<primary_id>PTRFBN65E13L483Q</primary_id>
<first_name>Fabiano</first_name>
<last_name>PETRONE</last_name>
<gender desc="Male">MALE</gender>
<password/>
<status desc="Active">ACTIVE</status>
</user>
</users>

Open in new window


calling these  APIs using PHP curl inside a file (say user.php):

<?
$ch = curl_init();
$url = 'http://somelink.com';
$queryParams = '?' . urlencode('limit') . '=' . urlencode('10') . '&' . urlencode('offset') . '=' . urlencode('0') . '&' . urlencode('q') . '=' . urlencode('primary_id~PTRFBN65E13L483Q') . '&' . urlencode('apikey') . '=' . urlencode('l7xx08bb6c218cb54cc9bfae5aab76c67a19');
curl_setopt($ch, CURLOPT_URL, $url . $queryParams);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>

Open in new window


gives me the desired results on the browser, but without any separator:
PTRFBN65E13L483QFabianoPETRONEMALEACTIVE
How can I format the resulting data?
I.E. may I "pipe" the content of $response in an array and then sutably format every member?
Thanks a lot in advance for the reply,
Fabiano
0
I've got a browser based writing tool i'm putting together and need the ability to click a "save" button that then takes the innerHTML content of a content-filled div and saves it into a MySQL table with a unique ID so it can be recalled at a later date.

I've been having trouble grabbing the innerHTML of the div and passing it to the PHP save process (save.php)...is GET/POST the best way to do this, or no?
0
<?php

$EmployeeID = "";
if(isset($_POST['EmployeeID'])){
    $EmployeeID = $_POST['EmployeeID'];
 } 

$FirstName = "";
if(isset($_POST['FirstName'])){
    $FirstName = $_POST['FirstName'];
 } 

$MiddleName = "";
if(isset($_POST['MiddleName'])){
    $MiddleName = $_POST['MiddleName'];
 } 

$LastName = "";
if(isset($_POST['LastName'])){
    $LastName = $_POST['LastName'];
 } 

$FatherName = "";
if(isset($_POST['FatherName'])){
    $FatherName = $_POST['FatherName'];
 } 

$SpouseName = "";
if(isset($_POST['SpouseName'])){
    $SpouseName = $_POST['SpouseName'];
 } 

$MotherName = "";
if(isset($_POST['MotherName'])){
    $MotherName = $_POST['MotherName'];
 } 
 
 $DOBMonth = "";
if(isset($_POST['DOBMonth'])){
    $DOBMonth = $_POST['DOBMonth'];
 } 

$DOBDay = "";
if(isset($_POST['DOBDay'])){
    $DOBDay = $_POST['DOBDay'];
 } 

$DOBYear = "";
if(isset($_POST['DOBYear'])){
    $DOBYear = $_POST['DOBYear'];
 } 

$DateOfBirth="{$DOBMonth}-{$DOBDay}-{$DOBYear}";


$Age = "";
if(isset($_POST['Age'])){
    $Age = $_POST['Age'];
 } 

$BloodGroup = "";
if(isset($_POST['BloodGroup'])){
    $BloodGroup = $_POST['BloodGroup'];
 } 

$MaritalStatus = "";
if(isset($_POST['MaritalStatus'])){
    $MaritalStatus = $_POST['MaritalStatus'];
 } 

$Gender = "";
if(isset($_POST['Gender'])){
    $Gender = $_POST['Gender'];
 } 
 
 $EducationDetails = "";
if(isset($_POST['EducationDetails'])){
    $EducationDetails = $_POST['EducationDetails'];
 } 

 $ContactNumber= "";

Open in new window

0
for loop is not working for me in php i tried a lot for this can any one please check my code.i need send education details like qualifiction,years,university,percent into php table
for($i=1;$i<=4;$i++){

$qa="Qualification"+$i;

$Qualification = "";
if(isset($_POST['Qualification1'+$i])){
    $Qualification = $_POST['Qualification'.$i];
 }  
 echo"-----------";
echo $Qualification;
$Years= "";
if(isset($_POST['Years'+$i])){
    $Years = $_POST['Years'+$i];
 } 

$University = "";
if(isset($_POST['University'+$i])){
    $University = $_POST['University'+$i];
 } 

$Percentage = "";
if(isset($_POST['Percentage'+$i])){
    $Percentage = $_POST['Percentage'+$i];
 } 

echo"222222222";
echo $Qualification;
if($Qualification != null){
    echo "333333333";

 $qry = "INSERT INTO emp_qualification(EmployeeID,Qualification,Years,University,Percentage)
        VALUES('$EmployeeID','$Qualification','$Years','$University','$Percentage')";

        if ($conn->query($qry)==TRUE){
        echo " qulaification details added successfully";
    }
    else 
        echo "<br/> not added.";

}
}

Open in new window

0
<?php

$EmployeeID = "";
if(isset($_POST['EmployeeID'])){
    $EmployeeID = $_POST['EmployeeID'];
 }

$FirstName = "";
if(isset($_POST['FirstName'])){
    $FirstName = $_POST['FirstName'];
 }

$MiddleName = "";
if(isset($_POST['MiddleName'])){
    $MiddleName = $_POST['MiddleName'];
 }

$LastName = "";
if(isset($_POST['LastName'])){
    $LastName = $_POST['LastName'];
 }

$FatherName = "";
if(isset($_POST['FatherName'])){
    $FatherName = $_POST['FatherName'];
 }

$SpouseName = "";
if(isset($_POST['SpouseName'])){
    $SpouseName = $_POST['SpouseName'];
 }

$MotherName = "";
if(isset($_POST['MotherName'])){
    $MotherName = $_POST['MotherName'];
 }
 
 $DOBMonth = "";
if(isset($_POST['DOBMonth'])){
    $DOBMonth = $_POST['DOBMonth'];
 }

$DOBDay = "";
if(isset($_POST['DOBDay'])){
    $DOBDay = $_POST['DOBDay'];
 }

$DOBYear = "";
if(isset($_POST['DOBYear'])){
    $DOBYear = $_POST['DOBYear'];
 }

$DateOfBirth="{$DOBMonth}-{$DOBDay}-{$DOBYear}";


$Age = "";
if(isset($_POST['Age'])){
    $Age = $_POST['Age'];
 }

$BloodGroup = "";
if(isset($_POST['BloodGroup'])){
    $BloodGroup = $_POST['BloodGroup'];
 }

$MaritalStatus = "";
if(isset($_POST['MaritalStatus'])){
    $MaritalStatus = $_POST['MaritalStatus'];
 }

$Gender = "";
if(isset($_POST['Gender'])){
    $Gender = $_POST['Gender'];
 }
 
 $EducationDetails = "";
if(isset($_POST['EducationDetails'])){
    $EducationDetails = …
0
I did tutorial located here:, what i would like to do is add edit functionality, i would like to have an edit button and be able to edit record, the tutorial did no cover this, i have researched but i just cant wrap my head around it, i am new to codeigniter as you can tell.

here is my controller:
<?php

class Site extends CI_Controller
{

	function index()
	{

		$data = array();
		
		if($query = $this->site_model->get_records())
		{
			$data['records'] = $query;
		} 
		//$this->load->library('table');
		$this->load->view('options_view',$data);
	}

	function create()
	{
		$data = array(
			'title' => $this->input->post('title'),
			'content' => $this->input->post('content')
			);

		$this->site_model->add_record($data);		
		$this->index();
	}

	function update()
	{
		$data = array (
			'title' => 'My NEW UPDATED title',
			'content' => 'NEW UPDATED content; UPDATED'
			);
		$this->site_model->update_record($data);
	}

	

	 function delete()
	 {
	 	$this->site_model->delete_row();
	 	$this->index();
	 }

}

?>

Open in new window


Here is my model:
<?php

class Site_model extends CI_Model {

	function get_records()
	{
		 $query = $this->db->get('assets');
		 return $query->result();
		// $query = $this->db->query('SELECT * FROM assets');
	    //echo $this->table->generate($query);

	}


	function add_record($data)
	{
		$this->db->insert('assets', $data);
		return;
	}

	function update_record($data)
	{
		$this->db->where('id', 3);
		$this->db->update('assets', $data);
	}


	 function delete_row()
       {
	  	$this->db->where('id', $this->uri->segment(3));
	  	$this->db->delete('assets');

	   }


}

Open in new window


Here is my view:

Open in new window

0
Enroll in June's Course of the Month
LVL 9
Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

I place  these instructions at the beginning of my PHP code -

error_reporting(E_ALL);
ini_set('display_errors', TRUE);

if I run actual PHP code and there is an error I get a 500 internal server error instead of the actual line numbers in the code where the error occurred.

Is there something in php.ini that needs to be set also?

Michael
0
Hi Experts

Could you point how to configure MySQL to workaround the 'max_connections_per_hour'  error?

mysqli::real_connect(): (42000/1226): user 'root' has exceeded the 'max_connections_per_hour' resource (current value: 50)

Open in new window


Thanks in advance!
0
<?php

$EmployeeID = "";
if(isset($_POST['EmployeeID'])){
    $EmployeeID = $_POST['EmployeeID'];
 }

$FirstName = "";
if(isset($_POST['FirstName'])){
    $FirstName = $_POST['FirstName'];
 }

$MiddleName = "";
if(isset($_POST['MiddleName'])){
    $MiddleName = $_POST['MiddleName'];
 }

$LastName = "";
if(isset($_POST['LastName'])){
    $LastName = $_POST['LastName'];
 }

$FatherName = "";
if(isset($_POST['FatherName'])){
    $FatherName = $_POST['FatherName'];
 }

$SpouseName = "";
if(isset($_POST['SpouseName'])){
    $SpouseName = $_POST['SpouseName'];
 }

$MotherName = "";
if(isset($_POST['MotherName'])){
    $MotherName = $_POST['MotherName'];
 }
 
 $DOBMonth = "";
if(isset($_POST['DOBMonth'])){
    $DOBMonth = $_POST['DOBMonth'];
 }

$DOBDay = "";
if(isset($_POST['DOBDay'])){
    $DOBDay = $_POST['DOBDay'];
 }

$DOBYear = "";
if(isset($_POST['DOBYear'])){
    $DOBYear = $_POST['DOBYear'];
 }

$DateOfBirth="{$DOBMonth}-{$DOBDay}-{$DOBYear}";


$Age = "";
if(isset($_POST['Age'])){
    $Age = $_POST['Age'];
 }

$BloodGroup = "";
if(isset($_POST['BloodGroup'])){
    $BloodGroup = $_POST['BloodGroup'];
 }

$MaritalStatus = "";
if(isset($_POST['MaritalStatus'])){
    $MaritalStatus = $_POST['MaritalStatus'];
 }

$Gender = "";
if(isset($_POST['Gender'])){
    $Gender = $_POST['Gender'];
 }
 
 $EducationDetails = "";
if(isset($_POST['EducationDetails'])){
    $EducationDetails = …
0
hai... i wrote a code in html but i don't know how to write this code in php...can any tell me how to write a code in php with an example...this tabular form should be connected to my database...

EducationDetails:<br>
<table style="width:100%" "padding: 12px 20px">
  <tr>
    <th>Qualification</th>
    <th>Years</th> 
    <th>University</th>
    <th>Percentage</th>
  </tr>

  <tr>
    <td><input type=name="Qualification1"></td>
    <td><input type=name="Years1"></td>
    <td><input type=name="University1"></td>
    <td><input type=name="Percentage1"></td>
  </tr>

  <tr>
    <td><input type=name="Qualification2"></td>
    <td><input type=name="Years2"></td>
    <td><input type=name="University2"></td>
    <td><input type=name="Percentage2"></td>
  </tr>

   <tr>
    <td><input type=name="Qualification3"></td>
    <td><input type=name="Years3"></td>
    <td><input type=name="University3"></td>
    <td><input type=name="Percentage3"></td>
  </tr>

<tr>
    <td><input type==name="Qualification4"></td>
    <td><input type=name="Years4"></td>
    <td><input type=name="University4"></td>
    <td><input type=name="Percentage4"></td>
  </tr>

<tr>
    <td><input type=name="Qualification5"></td>
    <td><input type=name="Years5"></td>
    <td><input type=name="University5"></td>
    <td><input type=name="Percentage5"></td>
  </tr>

</table>
<br>
<br>

Open in new window

0
Hello,

I have developed some webservices that need to be called from various sources. These sources are devices that are connected using remot3.it and so have random proxy urls. So adding an 'Access-Control-Allow-Origin' header to the php scripts is not possible. How can I bypass this error "No 'Access-Control-Allow-Origin' header is present on the requested resource" when calling these scripts?

Please provide some solution. Thanks in advance.
0
I am running PHP 7.1.1.
I have downloaded 7.1.6 zip.
Do I extract it to the folder that contains 7.1.1 which in this case is IIS Express/PHP/ ?
And how do I go about accomplishing upgrading to the new version ?

Michael
0
I have a few wordress sites on my VPS server and have noticed a sudden increase in the number of downtimes for the past few days. On checking it out, I noticed that a certain common process of my (two) wordpress sites hosted under the server are hogging up all the CPU memory. The process name is "php5-cgi" and multiple processes with the same name are simultaneously running even if there is no traffic coming in to the sites.

What could be the reason for this?

Regards,
Andrew
0
Hi Guys,
I'm having a little problem getting a javascript to function when using it with multipart/form-data.
I only want the validation performed on the "Save Password" submit not the "CANCEL" submit.
So what's wrong with this script? How can it be fixed?
Thanks,
Sas
<?php
echo"<HTML>
<HEAD>
<script language='javascript' type='text/javascript'>
<!--
function Validate()
{
if      ( SAVEorCANCEL.eMail.value=='')   {alert('Your eMail address is required.');return false;}
else if ( SAVEorCANCEL.password.value=='')   {alert('A password is required.');return false;}
}
-->
</script>
</HEAD><BODY>Validate Test<BR/>
<form name='SAVEorCANCEL' enctype='multipart/form-data' method='post' id='SAVEorCANCEL'   >

<textarea class='transparent' name='p_pin'  id='p_pin'  wrap='physical'></textarea>
<BR/> 
<input type='submit' name='SAVE'   value='Save Password' 
onSubmit=\"return Validate(this)\"
onclick='SAVEorCANCEL.action=\"Password_upDate.php\" '>

<input type='submit' name='CANCEL'  value='CANCEL'  
onclick='SAVEorCANCEL.action=\"MainMenu.php\"; '>
</form>
</BODY>
</HTML>
";
?>

Open in new window

0
I wrote a program to monitor an email and grab the content and attachments like a ticket system. For the most part it is working great. I ran into an issue getting the attachment from mac mail and not sure what I am doing wrong.

I am using the imap php functions:

$test = imap_fetchbody($inbox, $email_number, 1);

this command returns the data but I am not able to encode it properly. I then issue this command next but I get no results.

$test2 = base64_decode($test);

The value of $test looks like this:


--Apple-Mail=_E9B92D68-AFCB-4019-AE1D-12DC06C5E477 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii yes again

here is a file

--Apple-Mail=_E9B92D68-AFCB-4019-AE1D-12DC06C5E477 Content-Disposition: attachment; filename=carhartl-jquery-cookie-v1.4.1-0-g7f88a4e.zip Content-Type: application/zip; x-unix-mode=0644; name="carhartl-jquery-cookie-v1.4.1-0-g7f88a4e.zip" Content-Transfer-Encoding: base64 UEsDBAoAAAAAAOdom0QAAAAAAAAAAAAAAAAfAAkAY2FyaGFydGwtanF1ZXJ5LWNvb2tpZS05MmI3 NzE1L1VUBQABc2NdU1BLAwQKAAAAAADnaJtEJW3tHSgAAAAoAAAAKQAJAGNhcmhhcnRsLWpxdWVy eS1jb29raWUtOTJiNzcxNS8uZ2l0aWdub3JlVVQFAAFzY11Tbm9kZV9tb2R1bGVzCmJ1aWxkCi5z aXplY2FjaGUuanNvbgoqLmxvZ1BLAwQKAAAACADnaJtEGK4L93IAAADtAAAAKAAJAGNhcmhhcnRs LWpxdWVyeS1jb29raWUtOTJiNzcxNS8uanNoaW50cmNVVAUAAXNjXVNVjsENwjAMRc/2FChnJmAL RkjbTxVkJa2DKVXV3UsOCFc+vfcsyxtT6Eqt4XZ5qeHaUMtSoc70prI6xtzmJLKJePGZ/AG8k68Z Sx8nL0rU0bHlAQ/Ho5QuSntyY6LwjSnj3yk87wZdvVHMlvS3xLTzzgdQSwMECgAAAAgA52ibRHjL 

Open in new window

0
Technology Partners: We Want Your Opinion!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

The plan is that when the form is submitted, the owner receives an email containing the user info and all form values, and the user receives an email thanking them and showing the info they entered into the form they submitted.

However, the user email is sending correctly, but the owner is getting a copy of both.

I thought $email would only go only to the user who submitted the form, and $to_email would only send the submitted values to the owner. However, it also sends the owner both.

<?php
session_start();

  if($_SESSION['captcha']['code'] != $_POST["captcha"]){
	  die('<div style="font-size: 2em; width: 60%; margin: 140px auto">We\'re sorry, but you did not enter the security code correctly.  Please click the back button on your browser and try again.</div>');
	}
// Information to be modified
$to_email = "owner@company.com"; // email address to which the form data will be sent
$subject = "Hourly Quote Request"; // subject of the email that is sent$thanks_page = "#"; // path to the thank you page following successful form submission
$thanks_page = "confirm.html";
$contact_page = "#"; // path to the HTML contact page where the form appears

$first_name = strip_tags($_POST["contact_first_name"]);
$last_name = strip_tags($_POST["contact_last_name"]);
$phone = strip_tags($_POST["contact_phone"]);
$email = strip_tags($_POST["contact_email"]);
$date = strip_tags($_POST["Date"]);
$move_from = strip_tags($_POST["move_from"]);
$move_to = 

Open in new window

0
I need to write a rule in my apache htaccess file to redirect:

/insurance-plans/year/schools/international-student-plans-2015?s=136&l=5000
to:
http://%{SERVER_NAME}/insurance-plans/year/schools/international-student-plans-2017?s=136&l=7000

The rule I wrote is as follows, but it does nothing:

RewriteRule ^insurance-plans\/year\/schools\/international-student-plans-2015?s=136&l=5000$		http://%{SERVER_NAME}/insurance-plans/year/schools/international-student-plans-2017?s=136&l=7000	[R=301,L,NC,NE]

Open in new window


I'd be grateful if someone would show me the correct htaccess code to implement my redirect.

Thanks,
Jon
0
Hi

I am running a PHP script that generate a list of variables, merges them into a email template and sends it through Manrdill Mailchimp's transactional email system).

The process might loop for several thousand iterations to generate all the emails that need sending.

The script that I am using:

//generate data for all records
while($row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC)){
//populate some additional tables with info for each record
//merge each record into the email template
//send email
//update record to show that it has been emailed
}

This runs through all the records then snds the emails/updates the table etc. Depending on the number of records, this can take quite some time to process.

I have extended the PHP timeout and max-memory size to cope, but would prefer a better solution.

Would the ob_start() / ob_get_clean()  functions help by processing each record individually and not storing everything up in memory, potentially over loading the buffer/memory and then outputting everything.

If someone can advise if this is a good idea or not and how I should implement it, I'd be very grateful.

Thank you in advance
0
hai...in phpmyadmin data base table my DOB is coming in adding foramt...did i need to change the type...???

my code in php format:

 $DOBMonth = false;
if(isset($_POST['DOBMonth'])){
    $DOBMonth = $_POST['DOBMonth'];
 }

$DOBDay = false;
if(isset($_POST['DOBDay'])){
    $DOBDay = $_POST['DOBDay'];
 }

$DOBYear = false;
if(isset($_POST['DOBYear'])){
    $DOBYear = $_POST['DOBYear'];
 }


$DateOfBirth=$DOBMonth+"/"+$DOBDay+"/"+$DOBYear;
0
With the following code in place:

 <?php echo $form->dropDownListRow($model, 'specialty_id', DoctorSpecialty::listOptions()); ?>

How would I limit the possible choices to just two of four?  I can't delete the other two from the table because they are used in the database in other places.
0
How can i show my url path in my body tag
If i am on a page example.com/abhinav
How can i show "abhinav" in<body>You are at "abhinav"</body>

and i also want a form action type code when i write in it like my name and click submit so it opens url.com/myname
i mean just whatever i write in form action that shows me in my url after slash
0

PHP

118K

Solutions

126

Articles & Videos

32K

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.