I wanted to make a script in a webpage that checkes in another website for a special word and then makes a link to that wesbite with the word. If that word is not in that website then there should be no link and if there is then it should create that link automatically. Can somebody help me? I wanted the code in Javascript.
Thank You!I know you can do this with php. But if you want it done with javascript, why did you post in the server side forum?Oops, sorry! Can you tell me then how to do it in php?Originally posted by 85882
I wanted to make a script in a webpage that checkes in another website for a special word and then makes a link to that wesbite with the word. If that word is not in that website then there should be no link and if there is then it should create that link automatically. Can somebody help me? I wanted the code in Javascript.
Thank You!
It's sounds like you're tryig to build some sort of search utility to search other pages online?
If that's so, you're gonna need something much more heavy duty than javascript.
In that sense, you are in the right section.
Javascript is considered a Client Side Language because it runs off the user's web browser and not the server that executes the web page.
Server Side languages you may want to look into:
PHP
ASP
PERL
CGI
ColdFusion
ASP.NET
Those would get you started in the right track.More specifically, in php you'll need to use the fopen function, and reg exp's.Originally posted by Josh
More specifically, in php you'll need to use the fwrite function, and reg exp's.
why fwrite?he doesn't need to edit the file he opens....D'oh :doh: meant fopen!
*going to edit*Originally posted by Josh
D'oh :doh: meant fopen!
it happens....Originally posted by Josh
More specifically, in php you'll need to use the fopen function, and reg exp's.
How do you do that?Well it's somewhat complicated, and you'll have to use a thorough reg expression to find what you want. I'll see if I can find a tutorial or something about it.
But here's a tutorial on reg expressions.
<!-- m --><a class="postlink" href="http://weblogtoolscollection.com/regex/regex.phpatchually">http://weblogtoolscollection.com/regex/ ... patchually</a><!-- m --> you can use strpos...
<!-- m --><a class="postlink" href="http://php.net/strpos">http://php.net/strpos</a><!-- m -->
<!-- m --><a class="postlink" href="http://php.net/fopenTry">http://php.net/fopenTry</a><!-- m --> something like this...
<?php
$theurl = "http://www.theurlhere.com"
If(!($fp = fopen($theurl, "r"))) {
echo "N/A";
exit;
}
$contents = fread($fp, 1000000);
fclose($fp);
$pattern = "(?)";
if (eregi($pattern, $contents, $temp))
{
echo"$temp";
}
?>
But I donno how to do regexp's
Thank You!I know you can do this with php. But if you want it done with javascript, why did you post in the server side forum?Oops, sorry! Can you tell me then how to do it in php?Originally posted by 85882
I wanted to make a script in a webpage that checkes in another website for a special word and then makes a link to that wesbite with the word. If that word is not in that website then there should be no link and if there is then it should create that link automatically. Can somebody help me? I wanted the code in Javascript.
Thank You!
It's sounds like you're tryig to build some sort of search utility to search other pages online?
If that's so, you're gonna need something much more heavy duty than javascript.
In that sense, you are in the right section.
Javascript is considered a Client Side Language because it runs off the user's web browser and not the server that executes the web page.
Server Side languages you may want to look into:
PHP
ASP
PERL
CGI
ColdFusion
ASP.NET
Those would get you started in the right track.More specifically, in php you'll need to use the fopen function, and reg exp's.Originally posted by Josh
More specifically, in php you'll need to use the fwrite function, and reg exp's.
why fwrite?he doesn't need to edit the file he opens....D'oh :doh: meant fopen!
*going to edit*Originally posted by Josh
D'oh :doh: meant fopen!
it happens....Originally posted by Josh
More specifically, in php you'll need to use the fopen function, and reg exp's.
How do you do that?Well it's somewhat complicated, and you'll have to use a thorough reg expression to find what you want. I'll see if I can find a tutorial or something about it.
But here's a tutorial on reg expressions.
<!-- m --><a class="postlink" href="http://weblogtoolscollection.com/regex/regex.phpatchually">http://weblogtoolscollection.com/regex/ ... patchually</a><!-- m --> you can use strpos...
<!-- m --><a class="postlink" href="http://php.net/strpos">http://php.net/strpos</a><!-- m -->
<!-- m --><a class="postlink" href="http://php.net/fopenTry">http://php.net/fopenTry</a><!-- m --> something like this...
<?php
$theurl = "http://www.theurlhere.com"
If(!($fp = fopen($theurl, "r"))) {
echo "N/A";
exit;
}
$contents = fread($fp, 1000000);
fclose($fp);
$pattern = "(?)";
if (eregi($pattern, $contents, $temp))
{
echo"$temp";
}
?>
But I donno how to do regexp's