[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Small and silly code!  :)

Posted on 2001-07-05
14
Medium Priority
?
187 Views
Last Modified: 2013-12-25
Hi...

I want someoen to write a very small code for me!

I just need it to work that way :)


well, the script name is code.cgi

when anyone clicks on http://www.MY-Website.com/code.cgi he/she will be redirected into another page on the same site....

now, i KNOW that there are many ways to redirect visitors from one page to another on my domain... but as i said, i need it to be done through a   .cgi file  (perl code)  :)

One more thing!

If someone clicks on
http://www.MY-Website.com/code.cgi?5545   or
http://www.MY-Website.com/code.cgi?ABCD   or
http://www.MY-Website.com/code.cgi?ANYTHING 

they ALL will be directed to the same page (that is mentioned within the code)

did you get it?  if i put ?XYZ  (or anything) after the code.cgi ... it still forwards visitor to the same page with no changes..

Well, hope this code will be easy engough for someone to write it!.

Thanks,


Sarah
0
Comment
Question by:innovator
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +2
14 Comments
 

Author Comment

by:innovator
ID: 6257344
you can post the code here os send it to sarah_mark_1999@usa.net
0
 
LVL 2

Accepted Solution

by:
shirjeel earned 640 total points
ID: 6257490
Dear innovator,


R u happy pls just tell me.

bye
0
 
LVL 3

Expert Comment

by:interiot
ID: 6257712
  #! /usr/bin/perl -w

   print "Location: /~interiot/\n\n";


Or...  print "Location: http://google.com/\n\n"; or whatever.
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
LVL 8

Expert Comment

by:bebonham
ID: 6257852
what programming language do you wish to use?


Bob
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6257853
interiot has already provided you with a perl solution.
0
 
LVL 3

Expert Comment

by:interiot
ID: 6257964
Shell:
     #! /bin/sh

     echo "Location: /~interiot/"
     echo ""


C:
     #include <stdio.h>
     int main() {
          printf("Location: /~interiot/\n\n");
     }

0
 
LVL 3

Expert Comment

by:interiot
ID: 6258250
Awk:
       #! /bin/awk BEGIN{printf("Location: /~interiot/\n\n")}



The string sent to a script after the question mark is sent via an environment variable.  Solutions posted here will likely simply ignore its contents and always print out the same redirection command.
0
 

Author Comment

by:innovator
ID: 6260589
shirjeel ... thanks for your code! you was the first one to email me the perl code!  and it worked fine :)

bebonham & interiot  thanks to both of you but shirjeel replyed faster ...

Thanks to all of you :)


Sarah
0
 
LVL 3

Expert Comment

by:interiot
ID: 6260776
shirjeel, why did you not post the code?
0
 

Expert Comment

by:teacher_mod
ID: 6260794
Without the solution posted, this thread does not contain a solution and becomes a worthless PAQ.  Therefore, if the solution is not posted. I will remove the points for it.  Points can only be awarded for questions that are solved on the site and put into the PAQ.

Shirjeel,

You will need to post the solution, or I will have to remove the point award.

Inovator,

In the future please do not encourage experts to supply solutions by email.  It is clearly against site policy and goes against community interests.

I'll continue to monitor this question, and if the code is not posted, The points will be removed.

teacher_mod
Community Support Moderator
Experts-Exchange
teacher_mod@experts-exchange.com
0
 
LVL 2

Expert Comment

by:shirjeel
ID: 6261463
ok man i will provide the solution that i mailed her ok

dont be angry ok

i will post the result

ok bye for now.

0
 
LVL 2

Expert Comment

by:shirjeel
ID: 6261630
This is the code that i sent her



use CGI;
$query = new CGI;
print $query->redirect('http://www.My_website.com');

ok bye for now.
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6261981
like

print "O";
print "h";
print " ";
print "W";
print "o";
print "w";
print "\n";

I'm impressed
certainly the best answer.
0
 

Expert Comment

by:teacher_mod
ID: 6262556
shirjeel,

I don't think anyone expressed anger. Certainly no one inteded to be offensive. There was just a request for the solution to be posted, which you have done.

Thanks,

teacher_mod
Community Support Moderator
Experts-Exchange
teacher_mod@experts-exchange.com
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question