Avatar Image Full Name :Peter Vegas
Username : petervegas
Articles : 0
Description :
Status message :

How to redirect page using PHP with values?

Monday, January 2nd, 2012 - 0 Comment

Here is the code for simple PHP page redirect. The search engine friendly way of redirecting is the 301 redirect. 1 2 3 4 <?php Header("HTTP/1.1 301 Moved Permanently"); header( ‘Location: http://www.yoursite.com/page.html’ ) ; ?> Note that if you do not include the first Header line above, the redirect still works. But, instead of a [...]

85. Predict the output or error(s) of the following c code

Sunday, October 9th, 2011 - 4 Comments
1
2
3
4
5
6
7
 main()
{
	int i =0;j=0;
	if(i && j++)
		printf("%d..%d",i++,j);
	printf("%d..%d,i,j);
}

84. Predict the output or error(s) of the following c code

Sunday, October 9th, 2011 - 0 Comment
1
2
3
4
5
6
7
8
9
#include "stdio.h"
main()
{
	FILE *ptr;
	char i;
	ptr=fopen("zzz.c","r");
	while((i=fgetch(ptr))!=EOF)
		printf("%c",i);
}

83. Predict the output or error(s) of the following c code

Sunday, October 9th, 2011 - 0 Comment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "stdio.h"
aaa() {
	printf("hi");
}
 
bbb(){
	printf("hello");
}
 
ccc(){
	printf("bye");
}
 
main()
{
	int (*ptr[3])();
	ptr[0]=aaa;
	ptr[1]=bbb;
	ptr[2]=ccc;
	ptr[2]();
}

82. Predict the output or error(s) of the following c code

Sunday, October 9th, 2011 - 0 Comment
1
2
3
4
5
6
7
8
9
#include "stdio.h"
int one_d[]={1,2,3};
main()
{
	int *ptr; 
	ptr=one_d;
	ptr+=3;
	printf("%d",*ptr);
}

81. Predict the output or error(s) of the following c code

Sunday, October 9th, 2011 - 0 Comment
1
2
3
4
5
6
7
8
9
10
11
main(int argc, char **argv)
{
	printf("enter the character");
	getchar();
	sum(argv[1],argv[2]);
}
sum(num1,num2)
int num1,num2;
{
	return num1+num2;
}

80. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011 - 0 Comment
1
2
3
4
5
6
7
8
9
10
11
12
13
 main()
{
	char c=' ',x,convert(z);
	getc(c);
	if((c>='a') && (c<='z'))
	x=convert(c);
	printf("%c",x);
}
 
convert(z)
{
	return z-32;
}

79. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011 - 0 Comment
1
2
3
4
5
6
7
8
9
10
11
 main()
{
	char *p;
	int *q;
	long *r;
	p=q=r=0;
	p++;
	q++;
	r++;
	printf("%p...%p...%p",p,q,r);
}

78. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011 - 1 Comment
1
2
3
4
5
6
7
8
9
10
 main()
{
	int i=_l_abc(10);
 	printf("%d\n",--i);
}
 
int _l_abc(int i)
{
	return(i++);
}

77. Predict the output or error(s) of the following c code

Thursday, September 15th, 2011 - 0 Comment
1
2
3
4
5
6
7
8
9
10
11
12
struct point
{
	int x;
	int y;
};
struct point origin,*pp;
main()
{
	pp=&origin;
	printf("origin is(%d%d)\n",(*pp).x,(*pp).y);
	printf("origin is (%d%d)\n",pp->x,pp->y);
}
Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: