Go Back   CodingForums.com > Search Forums

Before you post, read our: Rules & Posting Guidelines

Showing results 1 to 25 of 80
Search took 0.21 seconds.
Search: Posts Made By: MarkR
Forum: PHP 11-06-2012, 11:37 AM
Replies: 3
Views: 357
Posted By MarkR
Are you using any form of local caching? There is...

Are you using any form of local caching? There is no reason why common queries can't be cached for a few hours if results are unlikely to change for a long duration of time.
Forum: PHP 10-26-2012, 05:07 PM
Replies: 5
Views: 443
Posted By MarkR
Have a look at the way WordPress themes...

Have a look at the way WordPress themes (http://codex.wordpress.org/Using_Themes) work. Every installation of WordPress will have the same framework, but only the theme and plugins are usually...
Forum: PHP 10-26-2012, 05:01 PM
Replies: 2
Views: 272
Posted By MarkR
You need to sanatise your data, look at using...

You need to sanatise your data, look at using real-escape-string() (http://php.net/manual/en/mysqli.real-escape-string.php) or even better use prepared statements...
Forum: PHP 09-11-2012, 05:33 PM
Replies: 12
Views: 959
Posted By MarkR
I know this is dead, but I'd like to clarify my...

I know this is dead, but I'd like to clarify my point, assuming op is legit and not out to scam some login credentials.

My post was based around damage limitation and building a system which...
Forum: PHP 09-07-2012, 01:56 PM
Replies: 19
Views: 968
Posted By MarkR
http://php.net/manual/en/function.mysql-select-db....

http://php.net/manual/en/function.mysql-select-db.php

Although you should really be using mysqli instead.

Also reference your connection resource when running the query:


$link =...
Forum: PHP 09-07-2012, 01:28 PM
Replies: 12
Views: 959
Posted By MarkR
To build on tangoforce's concerns, the way I'd...

To build on tangoforce's concerns, the way I'd suggest you do it is have your standard authentication system which logs users into your site, using a good password hashing system such as phpass...
Forum: MySQL 09-05-2012, 05:53 PM
Replies: 5
Views: 539
Posted By MarkR
PHPMyAdmin imports make me want to shoot myself,...

PHPMyAdmin imports make me want to shoot myself, if your database allows remote connections use a light weight tool such as HeidiSQL (http://www.heidisql.com/) for manual backups and restorations.
...
Forum: MySQL 09-05-2012, 05:47 PM
Replies: 6
Views: 800
Posted By MarkR
AVG() will return the average of all the results...

AVG() will return the average of all the results in that field so will therefore only return 1 row.

If you want to get multiple results use the group by clause to group the data:

SELECT...
Forum: PHP 08-22-2012, 01:00 PM
Replies: 2
Views: 287
Posted By MarkR
When you use the division operator you need to...

When you use the division operator you need to check you are passing numbers > 0:



if($count > 0 && $this->params->get('num_columns', 2) > 0)
$rows = ceil($count /...
Forum: PHP 08-20-2012, 10:43 AM
Replies: 1
Views: 237
Posted By MarkR
Order id in your target table is a primary key...

Order id in your target table is a primary key and must be unique, you must be trying to insert another row with a primary key which already exists.
Forum: PHP 08-20-2012, 10:40 AM
Replies: 5
Views: 446
Posted By MarkR
I use something similar to the algorithm shown...

I use something similar to the algorithm shown here:

http://www.movable-type.co.uk/scripts/latlong.html

I just store the coordinate information for each business in a database table, translate...
Forum: PHP 08-17-2012, 01:13 PM
Replies: 7
Views: 897
Posted By MarkR
Look at fopen(), fread(), str_explode() and...

Look at fopen(), fread(), str_explode() and mysqli.

You can use fopen/fread to open your file and read it line by line, str_explode to grab your csv elements in each line as an array, and mysqli...
Forum: PHP 08-17-2012, 01:09 PM
Replies: 2
Views: 475
Posted By MarkR
Where are you struggling? Also using session...

Where are you struggling?

Also using session data with the global array $_SESSION might be a better way to go. It'll be easier and you don't have to worry about database connections until you...
Forum: PHP 08-15-2012, 12:08 PM
Replies: 4
Views: 289
Posted By MarkR
Are you sure $con =...

Are you sure $con = mysql_connect("localhost","socialbo_admin","lol123"); connects properly?

try this to see if a problem opening a connection has occured:



$con =...
Forum: PHP 08-13-2012, 02:15 PM
Replies: 3
Views: 257
Posted By MarkR
MailChimp give you a free allowance of 2000...

MailChimp give you a free allowance of 2000 subscribers with 12,000 emails a month so if you're hitting limits it's the way to go.

Otherwise if you're limited by rate and are not capped, you'd be...
Forum: PHP 08-13-2012, 02:10 PM
Replies: 3
Views: 369
Posted By MarkR
As they must all be submitted as forms, you'll...

As they must all be submitted as forms, you'll have to create all the forms like you have already, store the IDs of all those forms as an select value for each option

eg:



<select>
...
Forum: Apache configuration 08-09-2012, 12:28 PM
Replies: 6
Views: 1,811
Posted By MarkR
It depends if you want the world to see your...

It depends if you want the world to see your creations or not.

If only you want to see them, do it locally with something like WAMP or XAMPP (if you're a windows user).

If you want the world to...
Forum: PHP 08-09-2012, 12:18 PM
Replies: 7
Views: 1,080
Posted By MarkR
Could also use regex: $ptn =...

Could also use regex:



$ptn = "@/people/*@";
$str = "/people";
preg_match($ptn, $str, $matches);


I'm a bit of a regex noob so I wouldn't take it at face value.
Forum: PHP 08-09-2012, 11:56 AM
Replies: 1
Views: 242
Posted By MarkR
No doubt this is some how possible, but it seems...

No doubt this is some how possible, but it seems like a very obscure and difficult way to authenticate users.

You'd be better off authenticating users using PHP utilising the PHP SDK for Facebook...
Forum: PHP 08-06-2012, 10:53 AM
Replies: 4
Views: 664
Posted By MarkR
header('Content-type: image/jpg'); ...

header('Content-type: image/jpg');
readfile($fullpathtoimg);



Make sure you adjust the header content type depending on the image type.
Forum: PHP 08-06-2012, 10:47 AM
Replies: 2
Views: 338
Posted By MarkR
What do you have so far? Have you investigated...

What do you have so far? Have you investigated PHP's prepared statements and methods of interacting with the MYSQL database?
Forum: PHP 08-03-2012, 12:16 PM
Replies: 10
Views: 1,453
Posted By MarkR
if you are going to test for proxies that way you...

if you are going to test for proxies that way you probably want to at least cache a list of proxies you get positive hits back from pinging port 80 and make that comparison first. Creating a...
Forum: PHP 08-02-2012, 01:56 PM
Replies: 10
Views: 1,453
Posted By MarkR
You won't be able to detect proxies that don't...

You won't be able to detect proxies that don't forward any of those headers. The only way to be certain is maintain a blacklist, there is probably some kicking about for the popular proxies.
...
Forum: PHP 08-01-2012, 01:30 PM
Replies: 9
Views: 616
Posted By MarkR
Generate a random string/hash and associate it...

Generate a random string/hash and associate it with a user ID in your database, save that as your cookie. You don't want to save any identifiable information in the cookie what so ever that can be...
Forum: PHP 07-31-2012, 11:02 AM
Replies: 2
Views: 316
Posted By MarkR
Easiest way would be to generate a random number...

Easiest way would be to generate a random number and do it on a 'dice role'



if ( mt_rand ( 1 , 5 ) == 5 )
display_advert();
else
do_something_else();
Showing results 1 to 25 of 80

 
Forum Jump

All times are GMT +1. The time now is 07:01 PM.