|
Thanks for the detailed reply mate!
neonlight27 wrote: I think if you uploaded a sitemap and informed google of it using webmaster tools, it would index your site ok.
I have uploaded sitemap to search engines however when i checked my page on the HTTP Status Checker tool it returned me 200 OK Status - that should be obvious because the default.php existed just that the page contents are changed to show user a page not found messsage.. but i wonder how the search engine is treating this request..
also i tried modifying the header but either got a warning that header was already sent or even when the header() code was there, the page gave 200 OK status message
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|
|
You need to send headers first. I.E :
<?php
session_start();
$pageExists = false; //try changing to true
if ($pageExists == false){
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found"); //in case the above doesn't work
flush(); //send headers
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>Hello World!
</body>
</html>
<?php } ?>
Neonlight
|
|
|
|
|
thanks for the reply mate.. i would try this and come back again if required... thanks for your efforts!
cheers,
aditya
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|
|
Hats Off to you! It worked, you're a genuious!
Thanks again!
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|
|
|
|
I was given a HW assignment that I am having a lot of trouble on.
I must have missed the day the teacher explained all of this because I have nothing on this material other than google...It's not even in the text.
here is the problem
Write a C-program that does the following:
The program first creates a single pipe, using the pipe() system call. It then forks a child process
using the fork() call. The goal is to share the work of counting numbers that are multiples of 3
and 5 from the set of integers from 1-10000. The parent process executes the for-loop (from
1-10000) and takes the responsibility for counting all multiples of 5. All numbers that are not
multiple of 5 are passed through the pipe to the child process to be inspected and counted if they
are multiples of 3. Note: Only the parent process will implement the for-loop from 1-10000. After
the processes have completed their work, both, parent and child will print out a corresponding
message together with their corresponding process-id. The child then uses the pipe to send its
result to the parent. Upon reading the number of multiples of 3 from the pipe, the parent will print
out the complete response to the user (i.e., count of multiples of 3 and 5) and wait for the child to
exit properly and exit.
What happens if the child process is executing significantly slower than the parent process, i.e.,
what if the parent wants to read from the pipe while the child process has not had a chance to read
all multiples of 3 from it? Describe the problem! Describe how you simulated this problem!
What do you need to do to avoid this problem? Show your solution!
could anyone give me any ideas on how to go about solving this, and how I'm supposed to work with communicating these pipes?
|
|
|
|
|
Can anyone explain what the following regex represents?
my $s = "1";
if ($s =~ /[1-4[a-b]]/)
{
print "yes\n";
}
else
{
print "no\n";
}
The above when run using v5.10.0 runs without a problem and produces "no" for the answer.
Note I am NOT interested in answers about modifying the regex. I know that if I modified the regex to something like [1-4] it would produce yes.
I am interested in this specific regex and what it represents. My presumption is that since it doesn't produce an error nor warning that it is a valid regex. So what sort of valid regex does it represent?
|
|
|
|
|
well, as far as I can see (and my perl regex may be a bit rusty, as opposed to other regex variants/nuances) :-
[1-4 ]
is a character class, saying that it matches digits 1,2,3,4
now it gets tricky .. I didnt know you could 'nest' character classes, although it obviously compiles..
the
[a-b] 'inside' says, 'only the characters a to b'
I think it could be more simply represented as
[1-4a-b]
and I think thats how the compiler is seeing it, since the inner [, -, ] arnt not being escaped ...
.. hence afaik it matches (returns true), for a single character, that can be one of 1 or 2 or 3 or 4 or a or b (there are no modifiers eg '.' or '+' or '{n,m}' after the spec, indicating 0 or more, 1 or more, or min n, max m characters ...)
Pick up any perl manual or do a google to learn the syntax, then pull a regex apart bit by bit, its not hard ..
'g'
|
|
|
|
|
Garth J Lancaster wrote: I think it could be more simply represented as
[1-4a-b]
Which would seem logical. However running the code demonstrates that is not what it does.
The output is 'no' indicating that it did not match the value '1'.
Obviously your character class would match that.
|
|
|
|
|
jschell wrote: /[1-4[a-b]]/
[] match a single character present in the list below
- a character in the range between "1" and "4"
- the character "["
- a character in the range between "a" and "b"
match the character "]" literally
compliments of RegexBuddy
|
|
|
|
|
JimmyRopes wrote: [] match a single character present in the list below
- a character in the range between "1" and "4"
- the character "["
- a character in the range between "a" and "b"
match the character "]" literally
So it is equivalent to the following.
[1-4\[a-b]\]
That does explain it.
|
|
|
|
|
I am trying to learn some Perl. Suppose that I have a string in a Perl variable called inputLine. I know that the string starts off with a series of digits. I want to extract those digits and store them (as a string) into a variable called num. I am thinking that I can do this with Perl regular expressions. I tried, the following but it did not work:
$_ = inputLine;
num = /d+/;
I am hoping somebody here can tell me the rigth way to do this.
Thanks
Bob
|
|
|
|
|
I think you can do
if ($inputline =~ /(d+)/)
{
my ($num)=$1;
}
so, if inputline (is 1 or more digits) the result is put in match 1 since there's only 1 bracketed term in the expression .. I think $0 contains the full input string ...
'g'
|
|
|
|
|
#! /usr/bin/perl -w
$_ = "123.567isa decent number12456.3";
$num = /\d+/;
print $num;
should only produce a logical value. 1
The $num is using a MATCH operation /\d+/ which should be
written as
$num = m/\d+/;
Thanks Guys/Girls
|
|
|
|
|
hello anyone reading it
I just wana put this question about php that php (as Im still learning ) found to be very easy scripting language
even I made my own parser convert those heavy tags of html runnable thru php on IIS5.0 server with installer of php cgi of php5.1.2 so it might be possible to make at least a miniature os scipt runnable on both unix environment and wndows enviroment at command line. I repeat my question that is php so easy that a small os of php can be created like java
-Raj
|
|
|
|
|
An OS, I don't think so.
PHP is a web base language, it's not appropriate for creating an OS.
|
|
|
|
|
I think this is what you are looking for: http://gtk.php.net/
|
|
|
|
|
|
Hi,
you can create an operating system where you define your system objects (threads, memory management, interthread communication, file system, etc) and then implement them on top of the native equivalents. Any language could do that. Input/output works too, except maybe for those languages that tend to "sandbox" you (such as most Java implementations).
you can also create a virtual operating system; again most languages would be fine; what it would do is:
- offer whatever system objects you want, say threads, a memory manager, a file system, a network stack, etc.
- be implemented as a single process running on the real operating system
- not using the native threads, but rather distribute its alloted CPU cycles over the virtual threads;
- not using the native memory manager, manage its alloted memory and deal with the virtual new and free calls
etc.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi, I'm building a website and i'm new on php.
My issues are:
1). when I'm uploading images i.e. I have uploaded 4 images with 4 radio buttons. and it display the 4 thumb images with 4 radio button and when i click any thumb image it will display large image.
I want when i select a radio button the selected thumb image is make user's default image.
2). And when the thumb image is click the large image is change but not set as default image.
3). when a new user signup he would not see the other user's uploaded images at that point he see only the default image with a message" upload your images here".
4). when a register user sign up he will see his default image.
note: all the images call from database. so i want a php script with javascript code.
so please help me.
Thanks
Pratyush
|
|
|
|
|
Start coding. Post when you get stuck. No one here will code for you.
|
|
|
|
|
Why do you answer if you want to answer negative always?!
Aditya
|
|
|
|
|
No one here will code for youanyone, If you get stuck, people will help with specific problems, coming here and saying "php website" followed by "snd code urgenz" will get you MUCH more harsher responses then BOTH the ones I've submitted.
Edit: ahh I see why you've decided to post a reply here asking me why I always post negatively, you are the same troll who advertised a while back (this thread[^]) and then complained and said "delete my account", which was obviously the mature way out.
So much for never logging back in, welcome back !
|
|
|
|
|
Lol!
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|