aRo` automating your e-commerce

This blog has been neglected due to the success of Solidshops.com
31May/07

how to generate php variables on the fly

this is a prette neat trick:

$variable_name = “varname”;
${$variable_name} = “this is the value”;
echo $varname;

Popularity: 1% [?]

Filed under: php No Comments
20Nov/06

Copy a picture with php

I never thought stealing , euhm copying a picture was that easy !

$imgfile = “http://www.domain.com/picture.gif”;
$newfile = “C:/webserverfolder/test.gif”;

if (!copy($imgfile, $newfile)) {
print (“failed to copy $imgfile…
\n”);
}

Popularity: 1% [?]

Filed under: php No Comments
16Jul/06

An overview of all HTTP status codes

These HTTP Status codes are returned by the server to the client software to determine the outcome of a request.

The first digit of the status code specifies one of five classes of response.

  • 1xx Informational
  • 2xx Success
  • 3xx Redirection
  • 4xx Client Error
  • 5xx Server Error

Each Status-Code is described below.

  • 200: request completed (OK)
  • 201: object created, reason = new URI
  • 202: async completion (TBS)
  • 203: partial completion
  • 204: no info to return
  • 205: request completed, but clear form
  • 206: partial GET furfilled
  • 300: server couldn’t decide what to return
  • 301: object permanently moved
  • 302: object temporarily moved
  • 303: redirection w/ new access method
  • 304: if-modified-since was not modified
  • 305: redirection to proxy, location header specifies proxy to use
  • 307: HTTP/1.1: keep same verb
  • 400: invalid syntax
  • 401: access denied
  • 402: payment required
  • 403: request forbidden
  • 404: object not found
  • 405: method is not allowed
  • 406: no response acceptable to client found
  • 407: proxy authentication required
  • 408: server timed out waiting for request
  • 409: user should resubmit with more info
  • 410: the resource is no longer available
  • 411: the server refused to accept request w/o a length
  • 412: precondition given in request failed
  • 413: request entity was too large
  • 414: request URI too long
  • 415: unsupported media type
  • 500: internal server error
  • 501: required not supported
  • 502: error response received from gateway
  • 503: temporarily overloaded
  • 504: timed out waiting for gateway
  • 505: HTTP version not supported

Popularity: 4% [?]

Filed under: asp, asp.net, php No Comments
10Mar/06

Check if its the first hit on a webpage using the session variable

session_start();
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}
?>

Popularity: 1% [?]

Filed under: php No Comments
22Feb/06

Create a function simular to the iif access function

The access function iif is very easy to check an expression and return a different value wether the expression is true or false.


function iif($expression, $returntrue, $returnfalse = '') {
    return (
$expression ? $returntrue : $returnfalse);
}
?>

Popularity: 1% [?]

Filed under: php No Comments