• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Two great scripts! :)

hi...
I was visiting yahoo.com .... while i was searching for books (as much as i remeber), i accdently pressed the stop button (exactly after the first 3-4 search results)

Below the shown search results, i found the famouse words:
" Transfer Interrupted! "   BUT, unlike the other normal "Transfer interrupted"   this one was clickable, when i clicked on it it transfared me into internet visa site?

try it by yourself, in the search page, to see that the "Transfer Interrupted!"  are clickable!  

THE QUESTION: how did they do this? does anyone know a cgi script or so, that does this when the page viewing is "Interrupted"? Is it easy to write such a script?


The other question is about another cgi "trick"  i was visiting a site (thought i bookmarked it but i didn't :( ,  and at their front page i found this statemnt: " There are 547 visitors on this server NOW! "  to be frank, i am 100000% sure that they did not recive this number of visitors since they have launched their site!

I reloded the page and bingoooo  the number was 18 visitor only, reload again (immdeiatly) and the number was 410, the 900, then 13, then 45 etc.....  I checked their source, just to find that there are NO JAVA SCRIPT! , just a simple one-line code that says: <!--#exec cgi="/cgi-bin/numbers.cgi" -->  :)

so the trick is that they are useing a cgi script the prints a number (randomly) sellected from a group of numbers!
THE QUESTION: how did they do this? does anyone know a cgi script or so, that randomly prints a number from a givien group of numbers?
Is it easy to write such a script?
Thanks
0
windowsssss
Asked:
windowsssss
  • 6
  • 4
  • 4
  • +3
1 Solution
 
maneshrCommented:

Answer to Question 2...

To make random numbers in a given range, inclusive,  you can use Perl's rand function.

here is a small  PERL script that does the above.


#!/usr/local/bin/perl

$lower=25;
$upper=50;
$random = int( rand( $upper-$lower+1 ) ) + $lower;
print $random,"\n";
0
 
x25Commented:
Answer for Question 1:

 They didn't, a cgi is stdin/stdout language, it cannot do such thing like that, unless HTML tag is available.

 Netscape Navigator 4.x always Adds:

<PRE>
&lt;H3&gt; Transfer Intrrupted ! &lt;/H3&gt;
</PRE>

To the end of every incompleted HTML request.

 it is possible that that tag was presented in link tag (Search Results?)
or Ads (VISA?).

 x25
0
 
x25Commented:
seems EE don't process HTML.

>> ..
>> Netscape always adds:
>> <H3> Transfer Intrrupted ! </H3>
>> ..
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
smialeCommented:
To answer the first question:  you probably interrupted the transfer in the middle of an anchor that pointed to that site.  So while normally you'd display

<A HREF="adbanner">get your visa now!</A>results:...

you get:
<A HREF="adbanner">get you<H3>Transfer Interrupted!</H3>

The "Transfer Interrupted" is inserted by the browser.  But since it happened in the middle of an anchor, the message also points to that web page.

0
 
d32coderCommented:
TO make a link in Delphi, such as a clickable status bar...

Include ShellAPI in your Uses statement.

Create your text.

Set your OnClick Event for that component to a procedure.

In that procedure, use the ShellExecute command to launch the default browser to that site.

You can find help on ShellExecute parameters in the Windows SDK.



0
 
windowsssssAuthor Commented:
maneshr , thanks for your small perl script... wonted to ask you if you can work on it for some more time?
i have an idea about this script and wanted to ask if we can do it?

Thanks for your time, and thanks for the other's time
0
 
maneshrCommented:
sure i can work on the code for some more time.

i believe that your 2nd Q is answered.
however i would suggest that you wait till your 1st Q is answered too and split the points between the people who provided the answer to you.

Meanwhile, you can open a fresh questions which would pick up from where we left off here.

That way other experts can also provide input to your Q.

let me know your thoughts.
0
 
x25Commented:
So, how will get the points ? me or maneshr ?
0
 
maneshrCommented:
in case you want to split the points (as i think you might want to), you can post your query in the "Community Support" forum (http://www.experts-exchange.com/Customer_Service/Experts_Exchange/)


they can then distribute the points to the appropriate people, as per your recommendation.
0
 
windowsssssAuthor Commented:
I will split the points, between x25   ,   smiale ,    d32coder , 30 points each... thanks foe all of you.

maneshr, i will post a new question... what do you suggets as a title? :)
0
 
windowsssssAuthor Commented:
Adjusted points from 88 to 90
0
 
x25Commented:
so i guess i have no problem ..

 but i think smiale has just restated my answer in a better way, i acknowledge his efforts, but i still the one who answered it and deserve the points, not him !

 you have to be more fear, give me 50 pts, and him 10.
0
 
darinwCommented:
Reviewing question.

darinw
Customer Service
0
 
x25Commented:
No need to review ..

 i dnt  want my pointd . keep it . im "withdraw"-ing my answer ..

 im getting out of this stuped mess .
0
 
darinwCommented:
Community Support has reduced points from 90 to 45
0
 
darinwCommented:
Reducing points to one half to allow for split.

You can now accept one of the comments in this thread as an answer. To award the other Expert, you can create a new question in this topic area with a title of 'For ExpertName -- 1032769' using that Experts username.

Remember, the Accept Comment as Answer button is in the header of the comment.

darinw
Customer Service
0
 
windowsssssAuthor Commented:
Thanks for your answer.....
smiale: i have posted anotherquestion for you, please comment on it to have the other points.
the subject is : For smiale- 10327649
0
 
maneshrCommented:
"maneshr, i will post a new question... what do you suggets as a title? :)"

i would suggest you use "To make random numbers in a given range" as the title.
0
 
x25Commented:
[Edited by Community Support shortly after closing the x25 account]
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 4
  • 4
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now