-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
The From: header should always be from from the actual account on the server sending the email, in this case "me@gmail.com" since that's really where the email is being sent FROM. If they don't match, most, if not all, of the more reputable ISPs will flag it as spam or worse, just not deliver it. It could also be why google is sending you that message. There is nothing in your PHP to be able to know if it will "work fine with js validation". That's all done clientside, in the HTML, which you haven't shown us.
-
Sounds like a caching issue. Either in the browser (try force refreshing) or on the server.
-
Or leave it off entirely. It only needs to be there if submitting to a different URL. <form method='post'>
-
You must be using a plugin, as the main jQuery library does not have an autocomplete function. Is this solved or do you need more help? The only thing I left out is on your form you'd want to create an input, probably a hidden input, to store the ID so it gets sent with the form on submit. That's what $(some_other_input).val(ui.item.id); is eluding to.
-
read EXIF data from jpg/tiff files without PHP exif module
CroNiX replied to cbassett03's topic in PHP Coding Help
A quick search on github yielded this, and several others: https://github.com/lsolesen/pel -
Opinion: Multiple websites same data: Individual db's or single db?
CroNiX replied to BlueSkyIS's topic in MySQL Help
I have over 160 websites using the same codebase and same shared database. We get over 6M hits/month. No issues or "slowness". It comes down to query optimization and properly indexed fields. -
It would help to remove your error suppressing @ from mysqli_connect...big NO NO.
-
Refining MySQL Query To Look For First Letter & REGEX
CroNiX replied to kjetterman's topic in MySQL Help
or use NOT LIKE to ignore those values, in combination with LIKE -
Yes if he added an AddType handler or equiv if not Apache, but in my experience it's pretty rare. I'm assuming due to the 406 response code that it isn't set up that way.
-
file get contents with complicated (?) login first
CroNiX replied to muppet77's topic in PHP Coding Help
You send the request to the script that ajax would normally be submitting the login info to. It doesn't need to be an "ajax" request, unless they are specifically looking for the XMLHttpRequest header in which case you'd just need to add it to the CURL header to simulate an ajax request. Something like: curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Requested-With: XMLHttpRequest", "Content-Type: application/json; charset=utf-8")); -
Shouldn't saveNewsletterSignupEmailPost.html be a php script to process the data? HTML files can't do that.
-
getElementsByName() is not php, it's javascript. Personally I'd use jQuery or another javascript framework. They fix things that are broken, or missing, in various different browsers so they all work the same and you don't run into things like this.
-
Is this PDO database connection/ insertion secure from injection?
CroNiX replied to ageattack's topic in MySQL Help
It's good that you are using prepared statements. There are 2 things I would change though: 1) Store your db credentials in a separate file, and then include it on any page you use the db on. This way if the info changes, you just update one file instead of all files that you use db in. You might also just include the $link statement there too. 2) Don't output db errors to the screen, unless this is only for development server. This exposes info about your db and structure that might be useful to a malicious user. It also does the user absolutely no good to know about your db errors. Log them to a file or send an email with the error or something, and just let the user know "an error occurred" or something more generic.- 15 replies
-
- sql injection
- database
-
(and 3 more)
Tagged with:
-
There are a lot of things that can cause that mysql error (10048) if you google it. It has nothing to do with xampp. It has to do with the mysql server. Did you try rebooting your machine? It could even be a registry setting in windows dealing with TCP ports.
-
Yes. Just don't use that site. It will only teach you improper/bad habits. w3schools has nothing to do with the official w3.org.
-
Although it would be better at the top of the page like the others.
- 7 replies
-
- 2
-
- phpphp 5.2.17
- php 5.4.29
-
(and 1 more)
Tagged with:
-
Only way to do that is with javascript using AJAX.
- 3 replies
-
- commit script
- php
-
(and 2 more)
Tagged with:
-
http://www.paulirish.com/2010/the-protocol-relative-url/
-
That article you linked to says, in an edit, that it was fixed in more recent versions of mysql for AGAINST() pattern.
-
try naming it index.php instead of index.tpl. Or add a AddType handler to your apache.conf (assuming you're using apache) and allow the .tpl extension to be processed as php.
-
That would really depend on the individual coders skills, knowledge, and whether it's being coded from scratch or using some framework/library. I believe that any modern language would take about the same to develop the same thing in another modern language, but again, it depends on the coder. If you were comparing assembly language to php, that's a bit different as one is a very low level language and the other is fairly high, comparatively speaking.
-
Execute PHP code before any files using .htaccess
CroNiX replied to Slyke's topic in PHP Coding Help
You can also use a RewriteCond to check for a specific script name in the request, and only rewrite if it's that script name is the same. -
Execute PHP code before any files using .htaccess
CroNiX replied to Slyke's topic in PHP Coding Help
.htaccess also cascades, so it will affect the dir it is in and any subdirs of that dir. So it would also be possible to have another dir with php below the dir with .htaccess and .htaccess wont come into play for that request. @jazzman1 yes, I agree .htaccess can also be bypassed via CLI. My earlier comment was directed at the OP's remark about having the request processed before .htaccess, which you can't do if accessing via a http request unless .htaccess is in a different dir. Although I don't think any of these ways are really a good solution for the "git 2 factor authentication" issue. HTTP_BASIC_AUTH might be a better way to go, and you can create the htpasswd file via a php backend if it needs to be dynamic. Then they can get access by user:pass@host.com if they are authorized. -
I also wouldn't use PHP to output HTML except where necessary, like the actual creation of the <option> elements.