Find Jobs
Hire Freelancers

Problem with String

$10-30 USD

Completed
Posted about 10 years ago

$10-30 USD

Paid on delivery
I have a code that you can see below. The problem is that the $desktop and $mobile has in them ' and ", which creates a problem when they are put together in $content. I need to create a piece of code that will make the $desktop and $mobile inserted without any problems when in content. Right now, when there is ' , it thinks that's the end of the string and goes to mobile. it has to insert all of it. So some kind of trick that will protect ' and " within those two, but still insert them as they are shown. Here is an example of the $desktop <div class="bpb-p11m-body"> <div class="bpb-p11m-top">Breaking Performance Barriers</div> <div class="bpb-p11m-image"></div> <div class="bpb-p11m-body-text"> <div class="bpb-p11m-text">A real man was the provider and protector. A real man was ‘”the man.” He was adding value.</div> <div class="bpb-p11m-text">That was my attitude, and it seemed to pay off. Every summer of my youth, I worked hard on my aunt and uncle’s ranch: buckin’ hay bales, driving truck, building fence.</div> <div class="bpb-p11m-text">I loved hard work. Besides, it kept me in shape for sports. Hard work and athletic accomplishment were signs of manhood—coming of age. I was adding value. </div> <div class="bpb-p11m-text">Championship trophies and business accomplishments measured our worth—taught us discipline and goal orientation. I was tough. Ambitious. My life was laid out before me, clear and straight. I was adding value.</div> </div> </div> The entire code: $pageid = $_GET['pageid']; //page id $css = get_post_meta($pageid,'fsmg_css_root',true); // getting url for css $desktop = get_post_meta($pageid,'ecpt_enterhtmlcode_desktop',true); // code for desktop $mobile = get_post_meta($pageid,'ecpt_enterhtmlcode_mobile',true); //code for mobile $content = '[desktop]<div style="position:absolute; top:0; left:0; width:100%; height:100%; background-color:#fff;">'.$dektop.'</div>[/desktop][mobile]<div style="position:aboslute; top:0; left:0; width:100%; height:100%;">'.$mobile.'</div>[/mobile]'; //final code for page editor ?> <!-- some info while they are waiting --> <h1 style="margin-top:50px; text-align:center;">Magazine preview is being generated. Please wait....</h1> <center><img src="[login to view URL]" style="margin:auto; width:50px;"></center> <!-- Form submits the data --> <form style="display:none;" action="[login to view URL]" method="post"> <input type="hidden" name="content" value='<?php echo $content; ?>' /> <input type="hidden" name="css_url" value="<?php echo $css; ?>" /> <input type="submit" class="submit" value="Submit" /> </form> <script src="//[login to view URL]"></script> <script> //auto submit of form setTimeout(function() { jQuery('.submit').trigger('click'); },300); </script>
Project ID: 5558325

About the project

4 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
A proposal has not yet been provided
$15 USD in 1 day
4.8 (32 reviews)
5.0
5.0
4 freelancers are bidding on average $28 USD for this job
User Avatar
Hi, I'm ready to fix that right now. just award the project to start. will provide in the next ~1hour. thanks.
$30 USD in 1 day
4.8 (100 reviews)
6.6
6.6
User Avatar
Hello, I can help you, contct me please ;) we can fix this now if you want regards
$30 USD in 1 day
4.8 (16 reviews)
5.4
5.4
User Avatar
Aucune proposition n'a encore été fournie.
$35 USD in 0 day
5.0 (26 reviews)
4.6
4.6

About the client

Flag of UNITED STATES
Newport Beach, United States
4.9
30
Payment method verified
Member since May 30, 2010

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.