​ characters appear in code after pasteing it from jsFiddle - php

Ok here is what im doing. I am making a drop down menu which based on user selection will show the correct form. Now I am able to get it working here http://jsfiddle.net/13lackHawk/Vhbw8/ but when I apply it to an actual page it doesn't work. I don't know what im doing wrong here. It seems straight forward. Could anyone help me determine the problem? It's been bugging me for the past couple days.
Here is a live version of this.
http://panel.dev.adkgamers.com/site/scripts/forms.php

Just remove this from your script code at line 24: ​
jsFiddle sometimes injects the ​ characters at the end of the code inside it's script window. Get rid of it by manually deleting the line in question and rewrite it.
http://css-tricks.com/forums/discussion/18239/jquery-script-strange-issue/p1

Related

Forum Page Subjects Show Up With Gaps

http://www.hisseforex.com/forum/
Above link is for my forum page. It used to be normal and working but I found it showing up subject lines with a gap suddenly. I tried to upload it again to my host yet it did not work. Can I get a little help with its cause and how to solve it?
Changed my style since I could not find any better option. Thanks everyone.

Advanced Custom Fields Issue

So, there's a code that I've recycled multiple times on sites as it's well liked by my company. I am trying to update and recreate my portfolio due to my old hosting company wiping my entire file system. My fault for not having a back up, but lesson learned. Makattak.com Using this code here, I am unable to get anything to display.
A site I've used it on is here: Bowhunting.com
Here is a photo of my repeater field in ACF. I followed the same structure but still cannot get anything to display.
Can anyone offer some suggestions as far as what I am doing wrong? I've tried cutting things out, I've tried rebuilding from scratch, I just can't seem to get the loop to happen.
I am using the latest version of WordPress, and the latest purchased copy of ACF: Advanced.
I know this my sounds stupid but, did you assign the template to a page and select the page on the wordpress Reading settings?
Thanks to both Dre and Raul Cruz, I was able to find the issue.
I didn't set the Reading Settings to Home Page, static.
I revamped my code to change the_sub_field('field'); to
get_sub_field('field')
a change I made while debugging but didn't revert back
There was an issue with my syntax, and when writing the code back in, line by line, testing after each line, I was able to get what I needed back in working order
Thank you both for the help.

PHP Redirect Not Working on Script Containing SQL Queries

Alright so I've been pouring over this code for 16+ hours and I cannot find where the issue is. Before you say anything- I know I'm prone to SQL injection and I need to setup more prepared statements; once I get the code working my next step is to work on those issues. I also know I need to add the TRUE and 303 parameter to the Header call- I'm just trying to get it running at this point.
The code worked beautifully until I began working on eliminating form submission on refresh and adding redirects at the end.
The page that is having the problem is called updateorder.php and here is a Pastie link for it: http://pastie.org/9188291
I created a page called Issue.php to funnel everyone off the page and to eliminate the possibility of any of the html code outputting. That did not help.
I removed the ?> PHP closing tag from the end since all the code is PHP and eliminate any white space possibility. That didn't help either.
The page before this has several submit buttons. This page looks at what button was pushed and runs the code when it meets the conditions of the IF.
When I submit the form using the DeleteThisOrder button, it operates perfectly.
When I submit the form using the PrintOnly button, it operates perfectly.
When I submit the form using the UpdateOnly button, but $ThisStatus <>1, it runs perfectly.
Here are the problems:
If I hit the UpdateOnly button and $ThisStatus does ==1, then it remains on this page (updateorder.php) and the screen is blank.
The exact thing happens if I use the UpdateCommit button.
Something is happening when it runs this particular section of the UpdateOnly script: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188298
And something happens when running this particular section of the UpdateCommit script: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188306
Whatever it is doing it is causing it not to redirect. The SQL code executes and does everything it is supposed to do in the database; it's updating the order, it's updating inventory- all of that executes fine- it's just not redirecting and it stalls somewhere in the script before it redirects and leaves me with a blank screen.
I've done the advanced search on the site and looked at every thing I could find using the keywords PHP, MySQL, Redirect, with no clue as to why it's not working. I've went over this code line by line to look for white space, tried using the whole website address for the redirect, added a space between the colon and the link in the header... I've tried a lot of things. I've even tried unhealthy things like banging my head on my desk, hitting my head with my palm, and pulling my hair... no results. I really appreciate your time.
Just in case- here is the code in my required db connection file: Sorry I don't have 10 reputation so it will not let me provide more links. Here is the Pastie number you can replace in the above Pastie link to see the code for this section: 9188351
By the way... as you can probably tell I'm still learning so it may not be 'beautiful code' yet but I'm working on getting there. Thanks again for your help.
When in development add error reporting to the top of your file(s)
error_reporting(E_ALL);
ini_set('display_errors', 1);
This will signal any errors if they are found in your code.
As per the error message from your comments:
To get rid of that Cannot modify header information - headers already sent... message, place
<?php session_start(); ?><?php // rest of your code... as your first lines of code while getting rid of the other one where it's at now, followed by the rest of your code. Make sure there is nothing above that, HTML etc. including any white spaces. If you still get that error message, make sure it's saved as UTF-8 without BOM. (Consult footnotes)
For the Notice: Undefined index: UpdateOnly error message, make sure your form element is named with no typos. I.e. name="UpdateOnly" --- UpdateOnly is not the same as updateonly PHP is case-sensitive.
As for your $result->free(); you mention you don't have that function, so just remove it.
Footnotes:
BOM (aka byte order mark)
For more information on this subject, visit: https://en.wikipedia.org/wiki/Byte_order_mark
For more information on error reporting, visit: http://php.net/manual/en/function.error-reporting.php

ClListView Ajax pagination sometimes not working

I have this website http://www.kdomestriha.cz/recenze-kadernicvi which basically shows list of hairdressers you searched for. When you enter one word term and search (you can try "Praha"), ajax update on pagination works perfectly fine. However if you try to enter two words (you can try Hradec Králové), pagination will refresh whole site. I am not sure, if showing all of my code helps... Does anyone have any clue what could be a cause of this strange behavior? Thanks
Since you didn't post any code, only way I got that looking your web source, and I point what wrong was in it.
If I searched by word "Praha", your web would generate following things:
<div id="Praha" class="list-view">....
After then in jQuery, you have code to access it through syntax:
$('#Praha').....
In order to achieve your own purpose, I think you used searching word as element id, it would caused the problem if you entered more one word into your filter, space character is not a valid for ID attribute in jQuery
$('#Hradec Králové').. //failed
It did not raise any error, but it wouldn't work as you expected.
If pagination is causing your site to refresh, the most likely cause is that something in the search/filter result is causing javascript error, thus causing yii to revert to full page refresh.
I'd advice that you look at your page in chrome's web inspector (cos that's what I use) after searching and confirm that the javascript isn't broken

error in ajax chat web application,index.php won't show anything

i have a problem with ajax chat, i just installed it and did the changes to the config.php file, by filling in the names of the host, database, username etc. when i go the index.php file on my browser, all i get is: This page contains the following errors:
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
and then after the message, nothing is displayed, the rest of the page is blank. this looks like an error message made by the developer of the script, because i opened the index.php file and came across:
// Show all errors:
error_reporting(E_ALL);
has anyone out there come across a similar problem, how did you fix it? like step by step, i've checked the web but there seems to be no legitimate answer. i kindly ask for assistance from anyone who can help me to fix this error, and maybe tell me why it showed up, thanks in advance. here is the url: (http: / / sourceforge . net / projects / ajax - chat /) of where to find it(remove extra spaces and brackets), incase someone may be unfamiliar with it, the readme file gives a step by step guide on how to install it. thanks in advance.

Categories