-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
Too much like math's for me, but I'm sure the man himself will be able to help you out fairly soon.
-
you can add it as a data- attribute to the li item: foreach ($list as $rs) { $nome = str_replace($_POST['keyword'], '<b>'.$_POST['keyword'].'</b>', $rs['nome']); $iduser = $rs['idutilizador']; $stringOut = <<<STROUT <li data-id="{$iduser}" onclick="set_item('{$rs['nome']})'>{$nome}</li> STROUT; echo $stringOut;
-
Please help with database query -- PHP Beginner
Muddy_Funster replied to PNMorrison's topic in PHP Coding Help
I guessed I'd miss the mark, like I said I don't do much with dates in PHP so didn't know that creating the date object from string format wouldn't convert the original formatting as well. I just assumed it would because it seemed like the most likely reason to do it at all. My apologies. -
Nested Json to PHP Array for csv export
Muddy_Funster replied to reldridge's topic in PHP Coding Help
you could look at the php socket_ function list, that's where I would start. -
Help me with Wordpress MYSQL Query Data Posting
Muddy_Funster replied to axepex's topic in PHP Coding Help
Best of luck, I hope you get the solution you're after - but please remember: just because someone on the internet is willing to charge you for something does not mean that it will be at all good. There are a lot of blagger's out there so never pay (at least never pay in full) until you have the code. I personally recommend the use of the freelance board on here because I've been a member here for years and know that the vast majority of senior posters are both honest and highly skilled programmers, so there's a good chance you will get a solid bit of code with a quick turn around (that said you are just vulnerable to scammers as anywhere else). -
Please help with database query -- PHP Beginner
Muddy_Funster replied to PNMorrison's topic in PHP Coding Help
alright, this is making my head spin and taking way longer than it really should. I've added a little bit of code that probably won't work as is because I do very little with dates in PHP but should limit the display of the events div to only happen when there is a valid date (one after the 2nd of January 1970 - so I hope you're not planning an historical site or anything to do with flux-capacitor's) <?php defined('C5_EXECUTE') or die("Access Denied."); //echo $description; //echo $backgroundImage->src; //echo $background_color $pDate = DateTime::createFromFormat("F dS Y", $date); $cDate = DateTime::createFromFormat("F dS Y", 'January 2nd 1970'); if($cDate > $pDate){ ?> <div class="content_wrap white events"> <h5>Events</h5> <p class="alpha"><strong><?php echo Loader::helper('truncate')->softTrim($title, 50); ?></strong></p> <div class="event_details"> <time><?php echo $date;?></time> <address><?php echo $venue;?></address> </div> <a href="<?php echo $path;?>" class="beta absolute">Book your free place </a> </div> <?php } ?> -
Sorry, I don't understand what you're saying here. I don't really want all the code, but it's becoming apparent that the problem most likely lies with a part of the code that you haven't identified. As such, to allow us to have a chance at finding it we need to have visibility of it all (for example, you have cut the top off the decision logic that applies to the behaviour of the page in relation to the variables in question and don't think that's a problem. In short, the problem does not lie in the code that you have posted already (at least not solely) so we need to see more. As a beginner you shouldn't want solutions that you don't understand from other people to fix problems you couldn't properly identify - you should want people to help you to understand the problem and create your own solution to it once you have learned where it went wrong - which is exactly what mac_gyver the other people of this board are going to be: those people who can help you learn and grow. If you just want someone to do it for you you want the freelance board where you can recruit someone to do the task for you.
-
need to check an array for matching combinations
Muddy_Funster replied to severndigital's topic in PHP Coding Help
Why are the contents of the array so generic and variable? -
It could be that you want to check for empty() rather than / as well as isset().
-
Help me with Wordpress MYSQL Query Data Posting
Muddy_Funster replied to axepex's topic in PHP Coding Help
I don't have much time to commit outside my 8 to 6 day job I'm afraid, so while I can offer help on coding issues I can't give certainty of being able to complete a commision in a reasonable time scale. If you're happy to pay then post your request in the freelance boards, where people go to pick up such things (or maybe PM a staff member and ask for this thread to be moved there). -
Nested Json to PHP Array for csv export
Muddy_Funster replied to reldridge's topic in PHP Coding Help
The <root/> sets the top level container on the xml, it can be anything you need it to be such as "<?xml version="1.0" encoding="UTF-8" standalone="no" ?><document/>" should give you a cXML valid document object (can't vouch for the children obviously...). Also, you'll see that the values and keys are swapped, array_flip() should sort that out for you. -
So looking at the problem logically (because we don't have all the code) The issue happens on page reload/refresh and only effects checkboxes that have been checked. Therefor the issue is with if(isset(...)) checks (or perhaps a lack there of) and relates to how you render the previously entered form information to the page. I suspect you have some logic that takes the checked boxes and adds them to the form for persistence? So that whatever get's checked stays checked after the form is submitted or page refreshed? But what you are doing is rendering the element every time in addition to the previous full form elements. Instead of this you should be using it to alter the existing elements to being "checked". Chances of seeing the rest of the code?
-
I would advise against that, there is no need to fragment the data across tables in this instance. Each login is (or at the very least should) only be for a single person, so it makes more sense to have the information about that individual in the same table.
-
Nested Json to PHP Array for csv export
Muddy_Funster replied to reldridge's topic in PHP Coding Help
If it takes in xml you're laughing, use simpleXML with the PHP to create a full XML object to push straight through: as much as I hate the site, stackoverflow has a nice example of this :here: -
I don't want to sound nasty, but duplicate form elements on page refresh is the least of your problems. What have you tried so far to fix it? Did you piss some code from the start of the files.php because it seems to be starting with an elseif which makes no sense.
-
Nested Json to PHP Array for csv export
Muddy_Funster replied to reldridge's topic in PHP Coding Help
ahh, so how about just scripting the app to insert directly into the fulfillment db and cut out the middle man? You could take the data, open a connection to the fulfillment db and insert directly into the tables there. making this into a CSV means that there is going to be a lot of redundant data in the file - such as everything in the top level items array like email address and total cost, vendor id etc. will need to be entered for every order line. -
Please help with database query -- PHP Beginner
Muddy_Funster replied to PNMorrison's topic in PHP Coding Help
ok, can you post up the full view file that you took the original code snippet from in the first post, the documentation on the proEvents for concrete5 is all but useless. -
Nested Json to PHP Array for csv export
Muddy_Funster replied to reldridge's topic in PHP Coding Help
You will need at least one more but, depending on what you're doing with the CSV you could get away with using implode() for some of it too. how much info do you need in the CSV? I assume you don't need things like thumbnails, so what's the CSV designed to do? -
remove malicious php from image uploads with IMagick
Muddy_Funster replied to bonecone's topic in PHP Coding Help
I'm really not understanding what you want to happen here. You want to upload images and then present them to the browser as images, but not have the browser recognise them as images so that it doesn't present the "view image" option in the context menu? Is that right? The "view image" is a function of the browser, it's there as a feature, if you want to block that then just use some JS to rewrite the right click function on the page or, if you are concerned about people disabling JS then make a transparent overlay div to block the mouse from interacting with the image in the browser's viewport. Maybe if you explained what you're actually trying to do here it would help us understand what you are saying? -
Help me with Wordpress MYSQL Query Data Posting
Muddy_Funster replied to axepex's topic in PHP Coding Help
I don't know wordpress so didn't know from looking that the variable was a global since it appears to be just another variable. Assuming that the get_currentuserinfo() has been called (either from within the WP code or manually) previous to the snippet posted in the OP you can disregard me altogether -
You can't achieve what you are trying to do with just CSS alone. You are trying to alter the style of a parent element and CSS doesn't have a parent selector. You could maybe get away with creating an underlay element after the input using absolute positioning and change that using a sibling selector javascript using jquery would be far cleaner.
-
That completely depends on what you are coding for. If it's web facing then I would say that what is more important is that, regardless of how you do it, you need to be able to provide a site that will be fully functional regardless of display size. This can either be done by a percentage sized container and adaptive child objects, or by having a series of fixed pixel views and an adaptive presentation based on viewport. it is becoming more common to use the latter option, creating a set of display templates at fixed width and presenting the content dynamically using the appropriate template based on a series of checks on viewport and browser. This gives more control over content like images and menus so that the layout is tailored specifically for the size of screen it is being viewed on. A similar process can be achieved using a percentage container and dynamically rendering the child elements using css values, this impacts page load time however, as the initial container has to be rendered first in order to get the values for the conditional rendering of the children.
-
Don't think you can nest script tags within script tags, and you shouldn't need to anyway. Also, comments in html are different to javascript comments and the fact you have dropped some html comments (lines with <!-- ... -->) inside the top level script tags is probably upsetting the parser. To comment in javascript use two forward slashes (//) to comment to the right of them on a single line, and use /* ... */ to comment a block on a single or multiple lines. So strip out the second <script> tag and change the comments from html comments to javascript comments and see how that goes.
-
This isn't really the proper section for this post, so people are likely to pass it by. There's not enough info there to offer much help with design I'm afraid. We would need to know more about the context of the project. Can users be course providers and / or advisors and / or something other than either of these? Is it possible for a course provider to also be an advisor? can an advisor be associated with multiple course providers and / or vice versa? Can a user belong to multiple course providers and / or advisors? etc. If you can give us an accurate brief we will help where we can.
-
I'm not sure what tutorails you have been looking up, but this line: $(this)({ is wrong. use of $(this) in jquery references the current object, in this case your button, it's not an ajax call. you need to change it to $.ajax({ Also, when using jquery to bind events to existing DOM elements you should use "on" to do it. $('#BtnInserisci').on('click', function(){ ... see :here: