Shankye 36 Junior Poster

Ya sorry .. was in hurry ..

Facebook "LIKE" buttons can be placed on other third party sites, Blogs etc and visitors can click on them. Those also shows information of total people liked it and sometimes if any of our friends liked it shows thr name pics ..

Is it possible to something like that in PHP and Javascripts?? (For a newbie)

Shankye 36 Junior Poster

Hey friends .. Can anyone give me idea on how to Create a button similar to like button of facebook .. I think they use complicated API n all ..

I want it to be simple but useful ..

Can anyone help me with this please ..

Shankye 36 Junior Poster

Its accepting md5() code correctly ??

Than you need to md5() ..

Md5(b) than check whether its correct password or not

Shankye 36 Junior Poster

Yup php.net is best for online reference and all ..

I am also new to PHP and referring a book

Sams PHP and MySQL WebDevelopment 3edition by Luke..

I think its perfect book for PHP and MySql..
You can google for more books ..

and regarding ur another prob I didnt get what problem you having, Can you state it clear...

Shankye 36 Junior Poster

Pritaeas is correct ..
And i was also saying same ..

You encrypt while storing or Dont encrypt while checking(comparing)

So remove all md5()s on 16 17 n 18 and try your code may be exicuted

Shankye 36 Junior Poster

Got the solution ..

ALTER status ORDER BY date;
Shankye 36 Junior Poster

I am new to SQL ..

SELECT status FROM statuses ORDER BY date;

I know this will order by date but i want to alter the table and rearrange them by datestamp..

Is it possible to alter like that ?

Shankye 36 Junior Poster

I guess

first you print

echo $oldpassworddb."<br>";

which printing 123456
means you not using md5() while storing password into database ..

Shankye 36 Junior Poster

how do i make the textbox automatically scroll down all the way to the bottom?

thanx in advance

Shankye 36 Junior Poster

Divide number by 10 every time before going to next place ..
Try doing how Adak said ...

printf("%d",number%10) ;
number = number/10 ;
printf("%d",number%10) ;

try to do this in loop ..

Shankye 36 Junior Poster

Above code will print

5
45
345

I think using Shift operator will be a easier way for you ..

Snehamathur commented: Not easy 4 newbie +0
Shankye 36 Junior Poster

Thank you soooooo much mschroeder..
It helped a lot ...
Its really faster now..

Shankye 36 Junior Poster

Yup ...

if (file = fopen(file_name, "r"))
{
       printf("Exists");
       fclose(file);
}

Merry Christmas to u too ...

Shankye 36 Junior Poster

We are not here to give you FREE CODE ..

Shankye 36 Junior Poster

Thank you Ardav ...

I used almost similar method..

used

$string_Array = file(File_name) ;
$key = 0;

	while($strings[$key])
	{
		if( trim($strings[$key]) == $email)
		{
			header("Location: emailUsed.html");
		}
			$key++;
	 }

// continue to store email-ID in mail_list ...

Its working for now ..

Any suggestion on it?

Shankye 36 Junior Poster

Hi friends ..

I have a mailing_list file ..

I wanted to check whether the visitor entered Email already exists in file?

Is there any standard function for it ?

Shankye 36 Junior Poster

Apache 2.2.11
PHP 5.3.0
MySQL 5.1.36

http://www.wampserver.com/en/download.php

Shankye 36 Junior Poster

Thank you :)

Shankye 36 Junior Poster

But Remember difference between char '0' and mathematical '0' ..

Shankye 36 Junior Poster

It didnt help ??

if (fscanf(fp, "# %s", variable)) {
               /* It is a comment. Perform required operation */
} else {
      fscanf(fp, "%s = %s", var.first, var.second);
       // Not a comment.
}
Shankye 36 Junior Poster

oh ...

You not you directly scan data to struct as said before ??

Shankye 36 Junior Poster

Can you clearly state your problem ?

Post your code, error msg you getting .. And what actually you are trying to do?

Shankye 36 Junior Poster

Use string comparison function ..

int strcmp (const char *s1, const char *s2)

and btw

if (fscanf(fp, "# %s", variable)) {
               /* It is a comment. Perform required operation */
} else {
      fscanf(fp, "%s = %s", var.first, var.second);
       // Not a comment.
}

this may help you neglect commented line(#) but you may add another line to neglect blank line also ..

Shankye 36 Junior Poster

Use in a loop and scan everything u want ..

If you dont scan LHS how u 'll get to know what u scanned name or age?

If you dont want LHS, just discard it after scanning..

Shankye 36 Junior Poster

But we have both char = char and char = int lines ...

Is it not better if he uses both char and than convert to int wherever necessary ..

struct read_file {
        char first[100];
        char second[100];
} var;

fscanf(fp, "%s = %s", var.first, var.second);
myk45 commented: Agreed +1
Shankye 36 Junior Poster

Array of doubles,
4 subjects and 20 students so total number of elements will be 80..

double Marks[80];

And for scanning use another loop inside while

while(student_num < 20)
{
     for(int i=0; i<4; i++)
     {
        // Scan "students_num"th students "i"th marks ..
      }
}
Shankye 36 Junior Poster

Hello friends ..

I wanted a feedback form for my small site...
Its pure HTML and i dont know anything about PHP ..

I got a script which mails the form contents to the admin..

Here is the code

mail( "$webmaster_email", "Feedback Form Results",
  $comments, "From: $email_address" );

Is it safe to use mail() like this??

Shankye 36 Junior Poster

If you have to read numbers of all 20 students thr is no need of scanning student_num. So remove that line and initialise student_num to 0.

student_num = 0;

and better to read all numbers in one loop than use another loop to print them all at once..

And if you have knowledge of how to use structs it will be easier for you to scan four numbers and later on you can do anything you want them with.

You know anything about structures in C???

Shankye 36 Junior Poster

Its ok friend ..

Hope your problem solved now ..

Shankye 36 Junior Poster

Problem with exit()

exit(0);

Use { } may take few seconds more to type but they help

Check this now

#include<stdio.h>
main()
{
int a,b,c,sum=0,i;
printf("enter the numbers");
scanf("%d%d%d",&a,&b,&c);
sum=a+b+c;
for(i=sum;i<=sum ;i--)
{
        if(i==a || i==b || i==c)
        {
        printf("%d the greatest",i);
        exit(0);
        }
}
}

looks so neat and easy to understand

Shankye 36 Junior Poster

Did you tried to compile it??

in First line only you have so many mistakes ..

sum = o

It showed be

sum = 0

remove ` after i..

Use { } correctly

and in

printf("%d blah blah");

what you are printing ????
i ?? sum ???

Make this changes compile it,
if got error copy paste that code..

Shankye 36 Junior Poster

enclose within CODE tag

Shankye 36 Junior Poster

I agree with hsetaknev ..

Take the good part from everything ..

Shankye 36 Junior Poster
Shankye 36 Junior Poster

WTFFFF,.. Green color not showing up in my comments.. X(

Shankye 36 Junior Poster

Toooooooooo Cool .. Super cool...

Mera
Bharath
Mahan

Shankye 36 Junior Poster

Toooooooooo Cool .. Super cool...

Mera
Bharath
Mahan

:) :) :) :)

Shankye 36 Junior Poster

@Sean
So sweet of you .. But this community is not being sweet to others..

I had voted down for posting FULL SOURCE CODE ..

Shankye 36 Junior Poster

@Sean
Its C thread ..

Shankye 36 Junior Poster

Thank you :)

If problem solved mark this thread solved ..

Happy programming :)

Shankye 36 Junior Poster

@Jason

conio.h it is not part of the C standard library,

clrscr also not standard function ..

And he not doing any magic, just giving his work to system..

Shankye 36 Junior Poster

You want to show how to shutdown ??????????????????????

Shankye 36 Junior Poster

Experts are toooo busy to read full thread ..

Oh i didnt knew thr is scanf function :D

He said he couldnt use it and wanted some other way ..

vedro-compota commented: you are right)))))))))) +1
Shankye 36 Junior Poster

@Trentacle
He casting to int directly dude how he will get correct int value??


@Vedro

You can do like this, (with some Portability issues ;) )

n = getchar()-'0';

Something good will come out ;) :D

Shankye 36 Junior Poster

Thank you :)

Shankye 36 Junior Poster

Hello everyone ..

Im learning PHP on my own ..
I installed Apache on Windows XP and trying install PHP, tried both installer and manual way but its not working :(

PHP scrips getting downloaded ..

Can any one give me a good link for step by step installation ?

Shankye 36 Junior Poster

NULL is a macro defined in <stddef.h> for the null pointer.

Its not '/0' its '\0'

'\0' is defined to be a null character, a character with all bits set to zero.Used as end of string.

Shankye 36 Junior Poster

Welcome n hope your problem solved ..

Shankye 36 Junior Poster

I used this C++ code for a virus which i did in C..

It was a self replicating Virus, for which i need to close hide the Window

Here is the code

void hide()
{
      typedef HWND (WINAPI *tGetConsoleWindow)(void);
  tGetConsoleWindow pGetConsoleWindow = 0;
  HINSTANCE handle =  ::LoadLibrary("Kernel32.dll");
  if ( handle ) 
    pGetConsoleWindow = (tGetConsoleWindow)::GetProcAddress(handle, "GetConsoleWindow");     
  if ( pGetConsoleWindow ) 
  {
    HWND hwnd = pGetConsoleWindow();
    ::ShowWindow(hwnd,SW_HIDE);
  }
  if ( handle )
    ::FreeLibrary(handle);
    
}
Shankye 36 Junior Poster

Pleasure :)