For fuck sake, kill me
What is the error here
$->Body = 'From: ' . $fields['name'] . ' (. $fields['email'] .)<p>' . $fields['message'] . '</p>';
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting variable (T_VARIABLE) or '{' or '$' in C:\xampp\htdocs\libs\contact.php on line 38
Notice: Undefined index: errors in C:\xampp\htdocs\libs\index.php on line 5
require_once 'phpmailer/PHPMailerAutoload.php';
Just fucking kill me, can anyone help. Fuck PHP, fuck it all.
I know it says no help but this is the only place I can turn to
>>53376087
>expecting variable
>>53376087
You can blame PHP for many things, but not your stupidity.
>>53376102
I seriously can't see where I'm so bad at php
>>53376110
Only if I could, never done php before. I can't see where the problem is, I think I'm missing a variable but fucking hell just end me
>>53376120
>Only if I could, never done php before. I can't see where the problem is, I think I'm missing a variable but fucking hell just end me
I've written PHP maybe once in my life 10 years ago and I can see where the error is just fine.
Like I said, don't blame PHP for your own incompetence.
>>53376153
Not even going to lie, I'm not good at this. How can you see the error? I'm working on the undefined index right now.
I'm still learning...everything, to think I have to do a login next.
>>53376153
I thought I saw the error, I do not.
I thought it was not enclosing it in operators
>>53376206
>I thought I saw the error, I do not.
$->Body
shoud be
$objectName -> Body
>>53376153
I SEE THE PROBLEM
OH FUCK HOW DIDN'T I SEE IT
>>53376227
Thank you, I'd actually repay you if there was a way, got steam?
>>53376241
No need ;)
>>53376263
Thank you so much for your help, I owe you
>>53376180
>How can you see the error?Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting variable (T_VARIABLE) or '{' or '$' in C:\xampp\htdocs\libs\contact.php on line 38
>Parse error: syntax error, unexpected '->', expecting variable
>Unexpected ->
>$->Body = 'From: ' ...
Can't you read even basic compiler errors?
>>53376273
btw, you should use
htmlspecialchars() for displaying any text that could have some special characters like <>'"&. If you not, your page will break.
for example:
htmlspecialchars($fields['message'])
https://secure.php.net/manual/en/function.htmlspecialchars.php
>>53376329
I was stressed out, I'm dealing with a whole new problem now. I'm new to all of this and I'm trying to get stuck in by using PHP/ SQL/ASP.NET
So I figured I'd try a basic contact form, I found this tutorial from "CodeCourse"
https://www.youtube.com/watch?v=FtWD_ZH9lnE
Everything doesn't work
>>53376362$m->Body = 'From: ' . $fields['name'] . '. $fields['email'] . '<p>' . ' $fields['message'] . '</p
Is that why I'm getting "syntax error, unexpected 'email' (T_STRING)"?
In the email I'm guessing it should be ""
Maybe, just maybe, if you read the fucking error message and used that brain of yours even slightly you would figure out what the error is. Here, let me define a couple words for you:
Unexpected: something is there that shouldn't be
Expecting: Something should be there that shouldn't be.
Logical conclusion: Something needs to be replaced with something else. And it TELLS YOU EXACTLY WHAT THAT IS! If you can't figure that out from the error message you shouldn't be programming.
>>53376367
You can't make satire this good
>>53376398
try now$object -> Body = 'From: ' . $fields['name'] . ' (' . $fields['email'] . ')<p>' . $fields['message'] . '</p>';
or$object -> Body = 'From: {$fields['name']} ({$fields['email']})<p>{$fields['message']}</p>';
>>53376398
And this is why you use syntax highlighting.