Login To InderWeb ! Just Play !

Username:
Password:

UserSubmittedComments

PHP

Provide sender id in sending mails How to Add an SPF Record in Windows 2000 and Windows 2003 DNS

Make sure that your domain dns have spf Record Defined.

to get your right SPF record for hotmail go to this link:

http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/default.aspx

http://www.michaelbrumm.com/spfwindowsdns/

running php file from linux shell vi editor and command line php for non http based files

for creating and executing a php file from ssh you need to PHP installed as binary (CGI) and add something like at top of shell script

[root:inderweb.com]!/usr/bin/php -q

.This is to tell the shell interprator(kernal) that we are using php from bin directory for executing lines of code in script.To get started with a simple php code in shell do following steps:-

  • Open shell prompt and go to your directory . e.g [root:inderweb.com ~]

jCalendar: A jQuery Based Calendar Goes The Drupal Way for date type fields jstools drupal5

Jscalender module come with Jstools package in drupal 5 you can
download drupal jstools package from the drupal.org site.Jscalender
uses the jsCalendar javascript library, like using a special CSS class
called via #attribute in the form element array to convert textfields
into jcalendar enabled.



The jcalendar module uses hook_form_alter() to look for textfields with
the add-jcalendar class, I had to use something different than
jcalendar which is used later on the generated form elements by the
jQuery code.

phonebook example in php mysql insert delete confirm basic demo

This is a very basic example of php/mysql.We used to make use of mysql database and a php file for getting this done.To run this code you can first create database as provided in sql here and after creating database run this code.Make modifications as you want to do in it.

<html>
<head>
    <title>Phone Book Example</title>
</head>
<body bgcolor="#f6f6f6" style="font-family:arial">
<marquee behavior="alternate">

Preventing MySQL Injection attacks with good PHP code- Using PHP for preventing MySQL injection attacks on your site

A Mysql injection is attack tried by site visitors/users to
get/damage data in databases by taking benefit from poor programming of
websites.An injection attack occurs when a visitor to your site types
something into a form input with the purpose of changing the outcome of
your MySQL query. For example, at a login screen someone may try this
type of attack to gain access to a secure area of the website.

If your query to check the username and password entered by the user was this:

log in mysql from command prompt windows to access database and change passwords grant privialiges

First of all you should know  how you can add users in mysql databases:-

  • Using CREATE USER and/or GRANT commands
  • Inserting a new record into the mysql.user table

First let's see how to use the CREATE USER command:-

     CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']

e.g   

Installing php4 and php5 on windows and linux and apache and iis server

How
to Install PHP 5.0 on Windows XP Pro


  1. Once you download the PHP
    zip file
    ( the Windows Binaries Zip Package),
    unzip it to c:\php.

    • To unzip using WinZip

304 code in response not modified

10.3.5 304 Not Modified

If the client has performed a conditional GET request and access is
allowed, but the document has not been modified, the server SHOULD
respond with this status code. The 304 response MUST NOT contain a
message-body, and thus is always terminated by the first empty line
after the header fields.

The response MUST include the following header fields:

How to Include an External JavaScript File in a html or php page?

It is recommended to make java script file separate from main code file(HTML file).It will make your site much faster.You can include a java script file in many ways and few of them are listed here. To include an external JavaScript file in a file, use the script tag.

<script src="../filename.js"></script>

Getting fields from mysql table using code file drupal,mysql,php

Many times it is needed to get the structure of table in PHP file or drupal module.There may be conditions that you dont have got admin user name and passwords for cpanel/phpmyadmin.In such cases you must have idea how to know the structure using a small PHP code.you can get connection info for mysql from code files or if you are using ftp it is sure that u can run a SQl query from code file.So below is the simple script for getting table info

Simple PHP Mysql

$table_name="node"; $sql=sprintf("SHOW COLUMNS FROM %s",$table_name); $$rs=mysql_query($sql);
Syndicate content

Popular Tags

tags in Web Links