Simple captcha for oscommerce contact form
Thu, 07/24/2008 - 21:52 — sandipEmbed the captcha image by calling a php script in "contact_us.php":
<input type="text" name="verify" />
<img src="/image.php" width="60" height="20" alt="Please enter the values from this image" />
Edit contact_us.php file and exactly after the below line:
if (isset($HTTP_GET_VARS['ac tion']) && ($HTTP_GET_VARS['action 039;] == 'send')) {
place the verification code:
// Captcha check
&nbs p; $t = trim($HTTP_POST_VARS['ver ify']);
&nbs p; if ($t == "") {
&nbs p; &nbs p; &nbs p; $captcha_error = "Enter the verification code!";
&nbs p; &nbs p; &nbs p; $error = true;
&nbs p; &nbs p; &nbs p; $messageStack->add('co ntact', $captcha_error);
&nbs p; } else if (trim($_SESSION["thecode& quot;]) == "") {
&nbs p; &nbs p; &nbs p; $captcha_error = "No verification code generated!";
&nbs p; &nbs p; &nbs p; $error = true;
&nbs p; &nbs p; &nbs p; $messageStack->add('co ntact', $captcha_error);
&nbs p; } else if ($_SESSION["thecode" ] != strtoupper($t)) {
&nbs p; &nbs p; &nbs p; $captcha_error = "Invalid verification code!";
&nbs p; &nbs p; &nbs p; $error = true;
&nbs p; &nbs p; &nbs p; $messageStack->add('co ntact', $captcha_error);
&nbs p; }
&nbs p; else
&nbs p; { // End Captcha Check
Cloning oscommerce website for development
Tue, 02/12/2008 - 16:13 — wizap-
Create dev.domain.tld site in hosting control panel.
Create the database and user.
Copy over the database and files.
Update the database and user info in "includes/configure.php" and "admin/includes/configure.php"
Also update the file paths in the configure.php files.
Update the links to point to the development site:
$ for x in `grep -r www.domain.tld * -l` ; do perl -pi \
-e 's/www\.domain\.tld/dev\. domain\.tld/g' $x ; done
Change ownership of files as required.
Login in as admin and change the cache location.