Solved

How do I get a web URL formatted correctly in a string?

Posted on 2009-04-01
6
216 Views
Last Modified: 2012-05-06
It keeps cutting it off the url at about the <?php echo ltrim when displayed in the <a href=<?php echo $url ?>>
if (substr($misc,0,1) == 'g')

	$url = 'org.php?id=<?php echo ltrim($misc,"g")?>&amp;ts=<?php echo $time?>&amp;h=<?php echo md5($misc.$time.$secret); ?>';

	else

	$url='pro.php?id=<?php echo ltrim($misc,"u")?>&amp;ts=<?php echo $time?>&amp;h=<?php echo md5($misc.$time.$secret); ?>';

Open in new window

0
Comment
Question by:chrisjmears
  • 4
  • 2
6 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24044442
Show us a sample of what you want it to say, please.  Thanks, ~Ray
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 24044468

// MAYBE LIKE THIS?

   $url  = 'org.php?id=';

   $url .= ltrim($misc,"g");

   $url .= '&ts=';

   $url .= $time;

   $url .= '&h=';

   $url .= md5($misc.$time.$secret);
 

// SEE THE RESULT

   print_r($url);

Open in new window

0
 

Author Comment

by:chrisjmears
ID: 24044567
Perfect thanks!
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24044682
Great!  I always find that simple statements are easier to write and debug compared to compound statements.  This usually leads to two responses.  One is from new programmers. They say, "but that's so simple..."  The other is from experienced programmers.  They say, "Very clear..."  Either way, I save a lot of time debugging!

;-)

Ray
0
 

Author Comment

by:chrisjmears
ID: 24044735
I like your style! Easy is better! thanks again!
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24044743
Roger that!  

Best regards, ~Ray
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now