PHP Syntax error unexpected "," with $_POST [duplicate] - php

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 5 years ago.
I'm a PHP beginner and I have a problem: when I use this:
if(isset($_POST['doc_lang'], $_POST['doc_title'], $_POST['doc_header'], $_POST['doc_body'], $_POST['doc_footer']) AND !empty($_POST['doc_lang'], $_POST['doc_title'], $_POST['doc_header'], $_POST['doc_body'], $_POST['doc_footer']))
I have this error: Parse error: syntax error, unexpected ',' in (...)/WebDoc.php on line 3.
What is the correct syntax? Thank

You need a proper logical operator so depending what you are trying to do, it could for example be || or &&

To the best of my knowledge, empty() cannot accept multiple variables the way that isset() does.

Related

I can't get what's worng in this code it made website down [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 1 year ago.
I'm getting error in the PHP code it's a Wordpress custom theme, it made my website down.
PHP Syntax Check:
Parse error: syntax error, unexpected '$', expecting variable (T_VARIABLE) in your code on line 1
Here is the code:
$path = "/home/u921722263/domains/fallcomlegal.co/public_html/wp-content/!function($){$.easing.jswing=$.easing.swing,$.extend($.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){return(t/94256)}";
There is a Syntax errorin this part:
{return $.easing$.easing.def},
because $.easing is followed with a $ there should be a , or something else.
Try fixing this part.

Parse error: syntax error, unexpected 'foreach' (T_FOREACH), expecting ',' or ';' in C:\xampp\htdocs\policycode\sample_code\policy1.php on line 54 [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 4 years ago.
Below is the program i have created using PHP.
foreach (.$resource->getAttributeMap()->entrySet() as .$entry);
if($entrey->getkey()->equal($Resource->RESOURCE_ID_KEY))
continue;
echo".$entry->getkey(). $entry->getValue()[0]";
The program can't iterator for each. How to the solve the issue?
The actual context of the code is not clear but it has syntax errors like .(dot) preceding the variable names, not consistent variable names etc. A modified code would be :
foreach ($resource->getAttributeMap()->entrySet() as $entry){
if($entry->getkey()->equal($resource->RESOURCE_ID_KEY)){
continue;
}
echo $entry->getkey()."". $entry->getValue()[0];
}

Unexpected hyphen in namespace [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 4 years ago.
Error coming up saying
Parse error: syntax error, unexpected '-', expecting ',' or ';
alluding to
use Firebase\php-jwt\src\ExpiredException;
i pulled the file from git so not sure if it would be wise to rename the files
That is the location of the file, not the namespace.
Try this instead:
use Firebase\JWT\ExpiredException;

PHP : Parse error, syntax error [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 6 years ago.
$router->addRoutes('', ['controller'=>'Home', 'action'=>'index']);
during compilation its generate an error
Parse error: syntax error, unexpected '['
Please help.
If is not >=5.4
PHP versions <= 5.4 do not support the [] syntax for array construction. Instead you shoud use array():
$router->addRoutes('',array('controller'=>'Home', 'action'=>'index'));

php parse/syntax error - help [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
php parse/syntax error help
I keep getting a "Parse error: syntax error, unexpected ':', expecting ')' in /home/jobkill/public_html/process.php on line 8" when processing inputs from a page that redirects here. I dont know what to fix.
You cant use these backquotes, use
"
instead

Categories