Search found 7 matches

by Enache
Thu Apr 12, 2018 12:36 am
Forum: PHP coding => Mail
Topic: Trouble formatting "from" Header in PHP contact form
Replies: 1
Views: 255

Re: Trouble formatting "from" Header in PHP contact form

In your new code, there's this:

Code: Select all

$headers = 'From: $email' . "\r\n"
I don't know about anything else that might be wrong with your code, but $variables don't work inside strings with single quotes. Instead, try:

Code: Select all

$headers = "From: {$email}\r\n"
by Enache
Wed Apr 11, 2018 10:11 am
Forum: PHP coding => General
Topic: Why Doesn't This Run Index.html ?
Replies: 8
Views: 403

Re: Why Doesn't This Run Index.html ?

switch ($user) { echo "here we are in the php scripts"; case "diana": This was in your 1st example, but in the second "working" one you commented out that 2nd line. It would have been causing a syntax error. You might benefit from finding your PHP error log and checking it for errors when things li...
by Enache
Wed Apr 11, 2018 10:07 am
Forum: PHP coding => General
Topic: User Authentication via posting form data
Replies: 3
Views: 237

Re: User Authentication via posting form data

I guess you'd change the $_SERVER stuff to $_POST and then change the "PHP_AUTH_USER" and such to the names of the fields in your form, but I really would urge you to find another resource to learn from; there's so much wrong with the code you posted.
by Enache
Wed Apr 11, 2018 10:03 am
Forum: PHP coding => General
Topic: preg_replace issue
Replies: 1
Views: 164

Re: preg_replace issue

Could you explain again what you're trying to do? Give an example of the output you're expecting? I can see a few obvious problems with your code, but not sure what to suggest to fix it without knowing what you're trying to achieve. For example, with this: $n_line = preg_replace ( '/<.*>/', "<.*$tag...
by Enache
Tue Apr 03, 2018 1:41 pm
Forum: JavaScript
Topic: Storing each image from array into div
Replies: 2
Views: 503

Re: Storing each image from array into div

I'm half asleep so I may be misunderstanding your question, but can't you just put put div tags around the img tag in your getImg function?
by Enache
Mon Apr 02, 2018 2:30 pm
Forum: PHP coding => General
Topic: Hiding password coding in script
Replies: 2
Views: 278

Re: Hiding password coding in script

If all of this is installed locally, there's plenty of other ways for someone to circumvent your password protection anyway. Depending on what you're trying to achieve here and exactly how paranoid you are, you may benefit from either using public key cryptography or using the password to encrypt/de...
by Enache
Mon Apr 02, 2018 2:13 pm
Forum: PHP coding => Mail
Topic: Trouble with Contact Form
Replies: 2
Views: 352

Re: Trouble with Contact Form

Aye, sending mail without it being caught by a spam filter is like walking in a minefield. There's several different protocols (SPF, DKIM, etc) and each email service (Hotmail, Gmail and such) has their own specific requirements your server config must meet before they'll accept mail from you. Also,...