Title: Code giving weird error
Last modified: June 25, 2018

---

# Code giving weird error

 *  [sonuyos](https://wordpress.org/support/users/sonuyos/)
 * (@sonuyos)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/code-giving-weird-error/)
 * I have this block of codes that was running earlier fine but now giving strange
   error.
 *     ```
       [insert_php]
       function g($pn) {
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_URL, "snthostings.com/billing/get_stocked_product.php?box=" . $pn);
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       $output = curl_exec($ch);
       curl_close($ch);
       return "/billing/cart.php?" . $output;
       }
       [/insert_php]
       ```
   
 * `[insert_php]print(g('SnTRDP%20-%2010GB%20-%20NORMAL%20-%20BROWSER%20ANONYMITY'));[/
   insert_php]`
 * Initially what this code used to do was fetch link from cart.php depending on
   what order is available, but now it is giving weird ” (Quotation marks) all over
   the page.
 * Whats wrong? I dont understand, please help
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcode-giving-weird-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [webcraftic](https://wordpress.org/support/users/webcraftic/)
 * (@webcraftic)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/code-giving-weird-error/#post-10436074)
 * Hi,
 * This strange code, just spaces. Your code still works, there’s nothing wrong 
   with that.
 * `SnTRDP - 10GB - NORMAL - BROWSER ANONYMITY`
 * Please show the screenshot, I do not quite understand how it coded the page?
 * Best regards, Alex
 *  Thread Starter [sonuyos](https://wordpress.org/support/users/sonuyos/)
 * (@sonuyos)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/code-giving-weird-error/#post-10436079)
 * Hello Alex
 * Thanks for reply.
 * I was getting this weird error (?).
    [https://prnt.sc/jz3ruy](https://prnt.sc/jz3ruy)
 * I had to restore my old backup to fix my website.
 *  Plugin Author [webcraftic](https://wordpress.org/support/users/webcraftic/)
 * (@webcraftic)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/code-giving-weird-error/#post-10436133)
 * Why you do not want to use snippets, the WordPress editor is not suitable for
   inserting code, because it can convert and encode characters. Also this code 
   is difficult to edit.
 * I can show an example that the snippet editor does not code the spaces and there
   should not be a similar problem with it.
 * ![](https://i0.wp.com/dl3.joxi.net/drive/2018/06/26/0027/1778/1804018/18/f827e6b4e0.
   png)
 * If you have difficulties with placing snippets, I can help you figure out how
   to implement the work for your case.
 * Best regards, Alex
 *  Thread Starter [sonuyos](https://wordpress.org/support/users/sonuyos/)
 * (@sonuyos)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/code-giving-weird-error/#post-10436211)
 * It’s more complex than that.
 * There are 4 order links. 4 diff curl to fetch the available order form.
 * I am honestly not sure how it would work.
 * And I am too scared to upgrade to 2.0.6.
 * What if it starts giving me that error again?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Code giving weird error’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3475630)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [sonuyos](https://wordpress.org/support/users/sonuyos/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/code-giving-weird-error/#post-10436211)
 * Status: not resolved