Skip to content

Tag: php

How to add anchor tag to a URL from text input

I want to be able to take user inputted text in a comment field and check for URL type expression, and if it exists, add an anchor tag (to url) when the comment is displayed. I am using PHP on the server-side, and Javascript (with jQuery) on client, so should I wait to check for URL until right before it

Blind SQL Injection using acunetix

I’m using acunetix to test my website. The problem is with this script http://boedesign.com/blog/2007/02/18/ajax-star-rating/ acunetix doesn’t show any message, but when I test for blind SQL I can get values like in the rating_id mysql column, I want to only allow numbers in there, so I made a lit…

What are the differences between ADOdb and PDO in PHP?

Both seem to try making it simpler using a database in PHP. Both seem to provide an abstraction over different database types like MySQL, SQLite, etc. What are the differences between both ADOdb and PDO? Answer PDO is standard in PHP as of version 5.1. (It is also available with a PECL extension in PHP 5.0) M…

Sending SMS from PHP [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago. How to send an SMS f…

Convert command line cURL to PHP cURL

I’ve never done any curl before so am in need of some help. I’ve tried to work this out from examples but cannot get my head around it! I have a curl command that I can successfully run from a linux(ubuntu) command line that puts a file to a wiki through an api. I would need to incorporate this cu…

PHP remove HTTP header

Something, I think Apache, adds these HTTP headers to all responses generated by PHP scripts: Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 This works ok for actual dynamic pages, but I have some page that, while generated by PHP, are most…

PHP comments: # vs. //

Lately I’ve been using # instead of // for doing single line comments inside my code. However, I see most of the people prefer //. Is there a particular reason for preferring them instead of #? Performance? File weight? Anything? Answer It doesn’t change a single thing, I’d say ; it’s …