0

Php Buddies,

Why do you reckon the following script is unable to replace the 'https://' or the 'http://' words with 'http://mymydomain.com' ?
It is able to replace the words 'www.' with 'http://mymydomain.com', though.

Open 2 tabs in your browser where one opens to the page where you are running the following script in your wamp/xampp and the other tab should open direct to [url]http://ebay.com[/url] for your experiment.

Running the script in your wamp/xampp and hovering your mouse over "fashion" link on ebay would show you 'http//mymydomain.com/tracker.php?ebay.com/global/fashion' and that is proof 'www.' got replaced.
You may confirm this cross checking both tabs by hovering your mouse over the mentioned links.
Now, in the (non xampp/wamp) tab, hover your mouse over the links "register", "sign in", etc. and you will see they start with 'https://'. Then finally, in the other tab (xampp/wamp), hover your mouse over these same links and you'd see the 'https://' have not been replaced with 'http://mymydomain.com'.
Why is that ?
Why is the str_replace failing on these 2 occasions to replace the 'http://' and the 'https://' to 'http://mymydomain.com' ?

Edited by UI

2
Contributors
2
Replies
22
Views
3 Months
Discussion Span
Last Post by UI
-1

rProfitt,

I've fixed the code but with a little hiccup. Took me 2hrs to fix it! Will try ridding the hiccup after I wake-up and then reveal the fix. In the meanwhile, it's my bed time. No good working now and make mistakes with a sleepy head. Stay tuned, my friend. Let's see what brings the next night! ...
You will see how innovative I can become in a very tight corner.
Thanks for all your helpS so far!
You won't regret it! Here's my challenge to myself ...
The final code would be a life saver for the world!

And, don't forget:
http://forums.devshed.com/php-development-5/str_replace-properly-curl-978268.html

Infact, my same threads used to be on 10 forums. But some were unresponsive or hardly any members and so dropped to 6. Then to 4. Now to about 3.
And so, rprofitt, it's no big deal about the link you're showing. You only managed to pull up 1 link and I revealed another 1. That remains 2 more to go. Look for the other 2. (We are playing hide and seek, aren't we ?).

Edited by UI

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.