Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6066549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:30:46+00:00 2026-05-23T09:30:46+00:00

I’m trying to translate a block of Classic ASP (vbScript) into PHP. I’ve made

  • 0

I’m trying to translate a block of Classic ASP (vbScript) into PHP. I’ve made an honest attempt, but my translation doesn’t appear to be correct. Could anybody help me out?

First, the vbScript Code:

szTemp = Request.ServerVariables("URL")
aryCrumbs = Split(szTemp,"/")
iMax = Ubound(aryCrumbs)

szCrumbPath = "http://" & Request.ServerVariables("SERVER_NAME")
szTemp = "<a href=""" & szCrumbPath & """ style=""color:#600;"">Home</a>"

For i = 0 To iMax -2
szCrumbPath = szCrumbPath & "/" & aryCrumbs(i)
szTemp = szTemp & "  &gt; <a href=""" & szCrumbPath & """ style=""color:#600;"">" & CleanUp(aryCrumbs(i)) & "</a>"    'Note: The &gt; in this line refers to a server request variable. 
Next

GetCrumbsArticleCategoryLevel = szTemp & "<span style=""color:#600;"">  &gt; " & CleanUp(aryCrumbs(i)) & "</span>"

And here’s my attempt at translation into PHP:

$szTemp = $_SERVER["PATH_INFO"];    // Get current URL path (doesn't include www)
$aryCrumbs = explode("/",$szTemp);  // Split path name by slashes into an array
$iMax = count($aryCrumbs);          // Count array.
$szCrumbPath = "http://". $_SERVER["HTTP_HOST"];      // Add on http to web server name
$szTemp = '<a href="' . $szCrumbPath . '" style=&quot;color:#600;&quot;>Home</a>'; 

for ($i=0; $i<=($iMax-2); $i++) {

$szCrumbPath = $szCrumbPath . "/" . $aryCrumbs[$i];
$szTemp = $szTemp ." &gt; <a href=&quot;" . $szCrumbPath . "&quot; style=&quot;color:#600;&quot;". ">" . CleanUp($aryCrumbs[$i]) . "</a>";
}

$GetCrumbsArticleCategoryLevel = $szTemp."<span style=&quot;color:#600;&quot;>&gt; ".CleanUp($aryCrumbs[$i])."</span>";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:30:46+00:00Added an answer on May 23, 2026 at 9:30 am

    In PHP in order to get a ” you need to delimit it with \, so ” becomes \”

    Example:

    $szTemp = "<a href=\"" . $szCrumbPath . "\" style=\"color: #600\">Home</a>";
    

    Translation

    I assumed that you were using Request.ServerVariables(“gt”), which in PHP the equivelent is $_SERVER, otherwise for Request.Form use $_POST or $_GET for Request.QueryString.

    Make sure if the user can change the values that you html encode using htmlspecialchars() function, otherwise you leave things open for a Cross Site Scripting attack [XSS]

    $szTemp = $_SERVER['REQUEST_URI'];
    $aryCrumbs = explode("/", $szTemp);
    $iMax = count($aryCrumbs);
    
    $szCrumbPath = "http://". $_SERVER["HTTP_HOST"];
    $szTemp = "<a href=\"" . $szCrumbPath . "\" style=\"color: #600\">Home</a>";
    
    for ($i=0; $i <= ($iMax - 2); $i++) {
        $szCrumbPath = $szCrumbPath . "/" . $aryCrumbs[$i];
        $szTemp = $szTemp . " &gt; <a href=\"" . $szCrumbPath . "\" style=\"color: #600;\">" . CleanUp($aryCrumbs[$i]) . "</a>"; //The htmlspecialchars prevents a XSS attack
    }
    $GetCrumbsArticleCategoryLevel = $szTemp . "<span style=\"color:#600\"> &gt; " . CleanUp($aryCrumbs[$i]) . "</span>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm trying to create an if statement in PHP that prevents a single post
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I would like to count the length of a string with PHP. The string
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.