cancer10 47 Posting Whiz in Training

Do u know of any free javascript script that will popup as a bubble with some information on it when I click on any form element in a page?


I can show you an example of what I want:

[IMG]http://thumbnails5.imagebam.com/410/0c790e4092858.gif[/IMG]

cancer10 47 Posting Whiz in Training

I want to insert records into multiple tables at one go, I am doing this in the following way, is this the correct way of doing? If not, what is the better way?

mysql_query("insert into table1 values('abc')");
mysql_query("insert into table2 values('ttt')");
mysql_query("insert into table3 values('5t6')");
mysql_query("insert into table4 values('ghy')");
mysql_query("insert into table5 values('gfd')");

Please help


Thanx

cancer10 47 Posting Whiz in Training

I have a timestamp column in a mysql table.

Using PHP, how do I convert the timestamp format which is "YYYY-MM-DD HH:MM:SS" into a format like "March 16 2008, 08:41 am" ?


Please help

Thanx

cancer10 47 Posting Whiz in Training

Hi,

I came up with this problem last night.

I have a URL http://www.mysite.com

How do I fetch the folder name that was supplied in the URL.

For example:


http://www.mysite.com/xyz
or
http://mysite.com/myfolder
or
http://www.mysite.com/xxx


Please note that I can either use www or http://www or just http:// in my domain name but I need to fetch the folder name that was supplied in the URL.

PS:

I tried the following code, but it didnt revealed the foldername supplied

<?php
echo $_SERVER['HTTP_HOST'];
?>

Please help.


Thanx

cancer10 47 Posting Whiz in Training

I like the borders of the forums like this. Can someone tell me how to draw a border in HTML/CSS as shown in the screenshot.

[IMG]http://img91.imageshack.us/img91/3292/fireshotcapture12helloimn7.th.jpg[/IMG]

I would like to have the bordercolor as well. The following HTML does not work perfectly on all browsers :(

I mean, with

FF - The code works fine
IE - Works but displays a thicker border compared to FF
Opera - Does not show the border color

<table border=1 bordercolor="#6E94B7" cellspacing=0 cellpadding=0>
<tr><td>Hello 1</td><td>Hello 2</td><td>Hello 3</td></tr>
<tr><td>Hello 4</td><td>Hello 5</td><td>Hello 6</td></tr>
<tr><td>Hello 7</td><td>Hello 8</td><td>Hello 9</td></tr>
<tr><td>Hello 10</td><td>Hello 11</td><td>Hello 12</td></tr>
</table>

Please help

Thanx

cancer10 47 Posting Whiz in Training

what does ABS do?

cancer10 47 Posting Whiz in Training

If you have a column, of data type = INT, with the following numbers
as separate rows.
1
3
4
5
7
10


How can you write a sql statement where you can calculate the
nearest number to any give input.
Example , if the input is 9 ? (the answer is 10)
If the input is 8 (the anwer is 7)

cancer10 47 Posting Whiz in Training

Can I use the "UNSIGNED ZEROFILL" keyword while creating a new table?

If yes, how?


Thanx

cancer10 47 Posting Whiz in Training

why not try to use mysql_real_escape_string function?

here I have made one:

function antiinject($var)
{
	if (get_magic_quotes_gpc())
		{
			$var1=stripslashes($var);
		}
	else
		{
			$var1=$var;
		}
	return mysql_real_escape_string($var1);
}

Hope this helps.

Will this function prevent my users to insert php tags into the db?

Like <?php phpingo();?> etc?

cancer10 47 Posting Whiz in Training

Thanx ryan for the detailed explanation. Appreciate it.

So you think both the functions "get_magic_quotes_gpc" and "mysql_real_escape_string" are being used in all professional forums to prevent injections?

cancer10 47 Posting Whiz in Training

what does your function do?

Plz explain

cancer10 47 Posting Whiz in Training

Hi,

This is an interesting question (in my humble opinion).

I am trying to create a forum in PHP. So there is a "Post a new Thread" link, clicking on which would open a textarea field for posting a message and a textbox for the "title".

Now, I dont want ppl to sql inject queries through the textarea or the textbox field.

So I have created this function for the same.

function dbsafe($data){
$data = str_replace('select','',$data);
$data = str_replace('alter','',$data);
$data = str_replace('delete','',$data);
$data = str_replace('replace','',$data);
return $data;
}

Now, though the above function would secure my db upto some extent but the only limitation I can see is my members/visitors will not be able to use the words "select","alter","delete","replace" in their threads even though they want use them (not for sql injection purpose).


So, I had to change my dbsafe function to the following:

function dbsafe($data){
$data = str_replace('tbl_members','',$data);
$data = str_replace('tbl_login','',$data);
$data = str_replace('tbl_details','',$data);
$data = str_replace('tbl_orders','',$data);
return $data;
}

ok, so now my function would now replace my database tables if the attacker intends to destroy or misuse them using any sql statements.

Now my question is that:

1) Which one of the above 2 functions is better you think?
2) Also, in my second function, is there a way the attacker would hamper my database without using my table names?


Please guide and help.

Need your opinion


Thanx so much …

cancer10 47 Posting Whiz in Training

I have just found an awesome video conversion tool & had to spread the word.
Check out any video converter at http://www.any-video-converter.com
I have never seen a freeware application that is this good.
So many others that charge 30 or 40 quid , you don;t need them this does the lot for free.

This software isnt free.

cancer10 47 Posting Whiz in Training

well, i am sorry for not being specific about my question.

actually i want to send a download link automatically to my customer as soon as he buys my product.

So my question would be, is there a way to tell my script that that customer has just finished with his payment and that my script would now send him the download link to his email.

cancer10 47 Posting Whiz in Training

Hi,

I am trying to make a shopping cart using paypal payment gateway.

Here is a scenario:

A customer visits my site, adds an item to the cart, clicks on the "checkout" button, he is then redirected to the paypal payment page, now would could I track if he has payed for the item?


Thanx

cancer10 47 Posting Whiz in Training

Hi,


I am new to PHP oop. I was wondering when and why should we use the following:

1) Public
2) Protected
3) Private
4) are there any other???


An example would be appreciated.

Thanx

cancer10 47 Posting Whiz in Training

Hi,

just wondering wots the difference b/w Scripting & Programming?


Thanx

cancer10 47 Posting Whiz in Training

cms1771561

what is with that number?

cancer10 47 Posting Whiz in Training

planetcms.com

already taken

cancer10 47 Posting Whiz in Training

Microsoft SQL Server Management Studio Express is free:) and from MS.:'(

It does not do everything that Enterprise manager does, but it does a lot.

For simpler interface take a look at our product dbQwikEdit, but it's not free :(

Your product seems a good one. Do you accept paypal? Coz thats the only way I can pay for this software.


Let me know thanx

cancer10 47 Posting Whiz in Training

mysql is an alternative to MS SQL Server. If you don't think so then what do you consider an alternative ? Sybase also has SQL servers. but they are not free.

What I meant by alternate of "Ms SQL Enterprise Manager" is that is there any FREE client for ms sql server by which I can access the data through the alternate client?

cancer10 47 Posting Whiz in Training

Hello,


Does anyone knows where I can find some good prototypejs tutorials. I find their official documentation very hard to understand.


Please supply me with some good links to learn prototypejs.


Thanx a ton

cancer10 47 Posting Whiz in Training

Hi,

I have 2 questions regarding the auto increment datatype in mysql.

Q1) Since we all know that if we create an auto increment column, it will start from the number '1' but is there a way we can force it to start with the number '300' and it should increment to 301 on the next new record inserted then 302 and so on?


Q2) Is there a way to make the auto increment field prefixed by 000? For example instead of making it run from the number '1' it should auto increment in this method '001' then 002 and so on?

Thanx

Fhernd commented: Good questions... The two questions are concrete and specific! +0
cancer10 47 Posting Whiz in Training

well I was asking for MS (Microsoft SQL Server) alternate and not mysql

cancer10 47 Posting Whiz in Training

If you were to make it for a web based system then which language would u prefer?

cancer10 47 Posting Whiz in Training

Hi All,

Just wondering whats the difference between a Programmer and a Developer?


Thanx

cancer10 47 Posting Whiz in Training

I am a newbie programmer and was planning Attendance software using fingerprint scanner.Can Any one suggest the best hardware and software.Database suggestions etc

thanks

hi Sunil,

Will you be developing the software for web based or desktop based?

Which language will you be using?


Thanx

cancer10 47 Posting Whiz in Training

Hello,

I was wondering if there is any altrernate to Ms SQL Enterprise Manager?

and of course a free one

Thanx

cancer10 47 Posting Whiz in Training

Hi,

I have this question in my mind and have been searching for its solution for days.

A forum (developed in PHP/Mysql) which gets 10,000 hits per day. Which of the following connection would be most appropriate for such a high traffic forum Or it does not matter which ever is being used?

mysql_connect()

or

mysql_pconnect()

Also, will it matter if the forum is not made using objects and classes?

cancer10 47 Posting Whiz in Training

Hey,

I was wondering if there is/are any drawbacks/limitations of php over other web languages?


Thanx

cancer10 47 Posting Whiz in Training

Hello,

I am new to prototypejs and know the basic funtions but want to learn more about it.

Is anyone using this?


Can you tell me a good tutorial where I can learn more functions about it?

Some useful links:
http://www.prototypejs.org/
http://24ways.org/2005/easy-ajax-with-prototype
http://www.sergiopereira.com/articles/prototype.js.html


Thanx

cancer10 47 Posting Whiz in Training

Hello,


I have heard a lot about SQL Injection. I was wondering how does an injector come to know about the table/column name when they cannot see the asp codes in a website?

Can someone explain plz?

Thanx

cancer10 47 Posting Whiz in Training
cancer10 47 Posting Whiz in Training

Hello,


I want to setup a server @ my office for testing my websites which uses Classic ASP/SQL Server 2005/IIS etc.

The operating system we would like to have is Windows 2003 server.

Due to my low budget I would like to go for an assembled one. So I need some nice hardware configuration to setup this server. Eg: 2 GB Ram, dual screen monitor etc


Can you post some nice configuration?

Thanx in advance.

cancer10 47 Posting Whiz in Training

Hello,

If you have used phpmyadmin, you might have noticed while creating a table there are few optional fields asked by phpmyadmin along with the table name

like

tablename | Datatype | Length | Default etc etc


Not my question is how do you make use of this Default field?

I know it puts a value when inserting a data into the mysql database, but suppose I have a table with some values into it, can I restore the default value in my table with the current values?

if yes how?

Plz Help,

Thanx

cancer10 47 Posting Whiz in Training

hello,

I am starting an online service which will be providing free remotely hosted CMS.

I am stuck with a nice and attractive name for my service.


Can you guys suggest any?


Eg:

turbocms.com
procms.com
ecms.com

All above are already booked domain names


Thanx

cancer10 47 Posting Whiz in Training

Well, im trying to get user profiles to be in a virtual directory e.g:
http://mydomain.com/profiles.php?user=test and i want to get it to display something like http://test.mydomain.com, could someone please post me the EXACT full .htaccess file for that example please?
Thanks

cancer10 47 Posting Whiz in Training

How do I make a paragraph sentence Case (first alphabet of each word capital) in CSS?

Thanx for your help.

cancer10 47 Posting Whiz in Training

Hello,

I want to learn perl and I have installed Apache 2.0.53, Perl 5.8.8 and MySql 4.1

I have configured apache for perl and successfully running the "Hello World" program.

I want to know, how to configure perl for mysql.

Your help is appreciated.


Thanx

cancer10 47 Posting Whiz in Training

Hello,

I run multiple domains/sites on my linux and windows server. I know there is a php.ini files that comes with the php installation package. But I have heard that there is a way to create a local php.ini file for each domain.

Does anyone knows how to create local php.ini files for each domain. Is there a special setting i need to do to make it run?


Thanx for your help

PS - I use cPanel on my linux server and Plesk on my windows server.

cancer10 47 Posting Whiz in Training

Which one is the easiest to install?

cancer10 47 Posting Whiz in Training

and how about restoring the db?

cancer10 47 Posting Whiz in Training

Hi

Does anyone know what is the simplest way to backup a database using the mysqldump function in php?


I have googled a lot and the codes i have found are very hard to understand and most of them does not work.

Thanx in advance for your help.

cancer10 47 Posting Whiz in Training

Hey All,

I am a linux newbie and I come from a windows background.

I want to install linux on my pc and start learning it. Can you tell me which version of linux could suite me the most, keeping in mind that I m just a starter.

I heard a lot about CentOS, is it good for me or do you have any other versions to be suggested.


Thanx

cancer10 47 Posting Whiz in Training

How do I restrict all php sites (which are located on my server) not to consume more than a specified amount of CPU?

FYI, I run Linux CentOS 4.4 with Apache

Thanx

cancer10 47 Posting Whiz in Training

ok thanx for your help.

Another question - I have created a new user account from the control panel. How do I make this new account so that they cannot see my Installed programs under Start > All Programs


Thanx

cancer10 47 Posting Whiz in Training

Hi,

I have windows XP installed on my office computer.

I have created a seperate logon account coz I do not want my colleagues to use my login info to access the computer.


So my question is how do I assign roles to this new user?


I want to disable all admin functions like install a software, create new users etc.

PS:

1) I am using win xp Pro 2002.
2) The Guest account does not work for some reasons.


Thanx

cancer10 47 Posting Whiz in Training

Hey


Does anyone knows how do I replace a " (double quote) in a string with nothing

I tried the following but does not work

$message = str_replace(""","",$_REQUEST['txtMessage']);
or
$message = str_replace("""","",$_REQUEST['txtMessage']);
or
$message = str_replace("\"","",$_REQUEST['txtMessage']);

Plz help

Thanx

cancer10 47 Posting Whiz in Training

Hi,

I was wondering if the BCC in the header accepts multiple recipient as in the example below?

$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com,someone@example.com,someone2@example.com,someone3@example.com,someone4@example.com,' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
cancer10 47 Posting Whiz in Training

Hello,

I am trying to send an email through php using the mail() function but getting the following error:

Warning: mail() [function.mail]: SMTP server response: my-server-name-here [my-ip-address-here] is currently not 550-permitted to relay through this server. Perhaps you have not logged into 550-the pop/imap server in the last 30 minutes or do not have SMTP 550 Authentication turned on in your email client.

My PHP Code is:

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

FYI: I am running this code on windows 2003 server and i can send email using Horde.

What I am guessing is I need to add smtp authentication in my php code, so If you can tell me what is the syntax that can help me.

Does anyone know how to overcome this problem?


Thanx