Solved

execute code one time

Posted on 2013-06-28
3
247 Views
Last Modified: 2013-06-28
hello there,
I have this code that its supposed to output just one hello but this is what im getting
"hello worldhello world"

preg_replace("/.*/e","eval(gzinflate(base64_decode('S03OyFdQykjNyclXKM8vyklRsgYA')));",".");

Open in new window


how can I fix it?
0
Comment
Question by:XK8ER
[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
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 39283729
The inflated string is echo "Hullo World" with an eval in front of it - is going to output Hullo World ....
0
 
LVL 1

Author Comment

by:XK8ER
ID: 39283742
yes but what can I do so it only display one "hello world"
0
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 39283839
Don't eval the string - just deflate it.

By eval'ing it you are asking php to execute what is in the string. As it includes an echo - it is going to output the echo.

Also the way you are using your preg_replace is confusing.

You say you want to output hello - but you don't have any echo statements in your code sample - you also have the input string as the second parameter - which is the replace ment parameter.
It should be

preg_replace(pattern, replacement, subject)

What are you wanting out of the preg_replace?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

628 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