
eits
Members-
Posts
72 -
Joined
-
Last visited
Never
Everything posted by eits
-
Creating a simple 'events calendar' and add event from DB
eits replied to eits's topic in Miscellaneous
Was looking for opinions on PHP calendar options - so it isn't the wrong section is it. -
Hi, I'm looking for some kind of opensource calendar which offers VERY simple functionality (basically just displays a calender in month view), in a database I have a table called duedates... if a duedate is found in the database it will display the correlating ID (called dueID) within that square. Anybody know of any opensource calender that I could modify to do the trick? All of the ones I've found so far seem to have about eight different pages which is definitely overkill for what I'd want. I'm not looking for any backend, just pull dates out of my db. Thankyou in advance !!!
-
Merge two Arrays so value from array2 goes at the end of array1
eits replied to eits's topic in PHP Coding Help
An array within an array within an array... Yes... I see whats happened sort of! Thankyou for your help, I'll need an hour or so to see if I can get this to work lol.. I'll keep you posted! Again, Many thanks! -
Merge two Arrays so value from array2 goes at the end of array1
eits replied to eits's topic in PHP Coding Help
Hi, I'm having troubles with that, but I think its because I can only display by 'name' not by anything deeper in? For example: foreach($array as $user) { echo $user['name']. "<br />"; } will print all names, but if I try to do: foreach($array as $rating) { echo $rating['rating']. "<br />"; } It doesn't? When I print_r on the array it displays like this: Array ( [0] => Array ( [Name] => SimpleXMLElement Object ( [0] => Marcus ) [0] => Array ( [Version] => SimpleXMLElement Object ( [0] => 14.03 ) [0] => Array ( [Rating] => SimpleXMLElement Object ( [0] => 17 ) ) ) ) -
Merge two Arrays so value from array2 goes at the end of array1
eits replied to eits's topic in PHP Coding Help
Hi, I create both arrays like so (within a foreach loop): $array[] = array("Name" => $name, array("Version" => $version, array("Rating" => $rating))); } Also, I am getting array_replace is an unrecognised function? Is this redundant in newer versions of PHP? -
You can get a version of XAMPP I think which'll run from USB.
-
Hi, I have two arrays: array1 = name, version, rating array2 = name, version, rating within both arrays are the same variants of name and version except the rating will be different. I am looking for a way to be able to merge these arrays and create a new array which would look like this: newarray[] = name, version, rating1, rating2 Can anybody please help???
-
A bit of both works great for me.
-
OK - this is what I want it to look like after they are merged! Array ( [0] => Array ( [Name] => Array ( [0] => SimpleXMLElement Object ( [0] => SP Press ) ) [0] => Array ( [Version] => Array ( [0] => SimpleXMLElement Object ( [0] => 14 ) ) [0] => Array ( [Array1Rating] => Array ( [0] => SimpleXMLElement Object ( [0] => 80 ) ) [0] => Array ( [Array2Rating] => Array ( [0] => SimpleXMLElement Object ( [0] => 50 ) ) ) ) ) )
-
Hi! I'm really stuck trying to work out how to merge an array like so...... I have two arrays, both have three data values (name, version, rating) in it. In each of the arrays will be data which matches (the name and version). Is there a function which would help me merge these arrays so that I could have the rating from array2 appended onto array1.. something like this: Array ( [0] => Array ( [Name] => Array ( [0] => SimpleXMLElement Object ( [0] => SP Press ) ) [0] => Array ( [Version] => Array ( [0] => SimpleXMLElement Object ( [0] => 14.00 ) ) [0] => Array ( [Array1Rating] => Array ( [0] => SimpleXMLElement Object ( [0] => Good ) ) [0] => Array ( [Array2Rating] => Array ( [0] => SimpleXMLElement Object ( [0] => Good ) ) ) ) ) ) Sorry if this isn't clear, please ask if you need any elaboration!
-
hi i'm using this function function getOptionValues($string, $first, $second) { $pattern = "/<$first(.*?)$second/"; preg_match_all($pattern, $string, $matches); print_r($matches); }
-
Hi, I'm using preg_match_all to create an array. (Each time an instance of text appears on a webpage it adds it to the array). I think what I'm ending up with is a double dimensional array. If I print_r I get this before the data I want (if I have ten items in the array, there will be 10 blanks: Array ( [0] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => [9] => [10] => ) [1] => Array ( [0] => Can anybody please tell me how I can remove these from my array?
-
Hi, I'm using the dompdf class for creating pdfs from a php page. The php page gets some dynamic data from a database depending on what the id is at the end of the page. (e.g. pdf.php?id=1). However, when I try to do this I get the following error: Warning: DOMXPath::query() [domxpath.query]: Invalid expression in D:\Websites\pdf\include\stylesheet.cls.php on line 573 Warning: DOMXPath::query() [domxpath.query]: Invalid expression in D:\Websites\pdf\include\stylesheet.cls.php on line 573 Warning: Invalid argument supplied for foreach() in D:\Websites\pdf\include\stylesheet.cls.php on line 575 However if I remove the variable at the end it makes a PDF, just not with the data that I require. I have had this working before but just cant for the life of me work out why this isn't happening, has anybody got any ideas? Thanks
-
Thankyou very much I really appreciate it - will try it in a little while. I should really take some time to learn Javascript, think 'Procrastination' is the keyword there though!
-
I have the following code which checks a disclaimer box is ticked and also checks a field (productuse) has some text in. I also have a field called custemail which I want to validate is an email address otherwise return false. Could somebody please help me add the appropriate 'else if' statement to do this, I've tried several scripts out there but just can't get them to work with this current script: <script LANGUAGE="JavaScript"> <!-- function validate(frm) { // // Check the Email field to see if any characters were entered // if (frm.productuse.value.length == 0) { alert("Please tell us why you require this product.") frm.productuse.focus() return false } else if (frm.disclaimer.checked == false) { alert("You must read the disclaimer before requesting a quote.") frm.disclaimer.focus() return false } } //--> </SCRIPT> Sorry, I'm a complete javascript n00b!
-
I'm pleased to say there has been a few visits coming from PHPFREAKS so I am happy to see there is an interest in the tool. I am hoping to have a BETA version up later this evening of a more advanced monitoring tool. I'll keep you posted as to when it has been uploaded. :-)
-
Hello guys, I've written a free keyword position application - it will check your website for the chosen keyword in the top 1000 results. You can visit it at http://www.clickfound.com. It's free and there aren't no ads so I hope its of some use.
-
Function to make sure blog comments page is nofollow
eits replied to eits's topic in PHP Coding Help
Unfortunately this is being too stringent and seems to always return false. Am I missing something simple? - And thanks for the quick response. -
Hi, I am using CURL to rip a webpage into $html. I now need to know if this page contains the nofollow tag - could anybody please explain a way of how I could do this? I did try: if(!strstr($html,'nofollow')) { return "follow"; } else { return "nofollow"; } ....but it doesn't seem to work too well and seems a bit 'hacky'. Has anybody got a better way? I thought I may just add I am trying to prevent spam not create it :-).
-
Hi, Seasons greetings etc. everybody, I hope you had a good one! I need some help please ! I have a html file in a var called $html which I have got using CURL. In this file there is a tag called <beforethis>. And just before this tag is a number (it could be 1 digit or 2). How would I go about searching through $html and finding the number just before the <beforethis> tag? I'd be REALLY greatful if anybody could help, I've tried to explain clearly but if I haven't I'll be willing to elaborate. Many Thanks
-
This is really annoying me now! PHP array from file PLEASE HELP!
eits replied to eits's topic in PHP Coding Help
FILE_IGNORE_NEW_LINES didn't seem to work I copied and pasted that code and modified return true to echo "works". But no sign of that magical word. :-( -
This is really annoying me now! PHP array from file PLEASE HELP!
eits replied to eits's topic in PHP Coding Help
OK. I'm not getting any errors. I should be able to pass 'AA' to the function and it'll check that file to see if 'AS' (or any given card) is already in the file and if it is, return a value (true / false) so that I can choose a different card otherwise two cards will be dealt. I have chopped this function up at least ten times today so yea now that is all I have. If I print_r after the $dealtcards = file.... line I get: Array ( [0] => 3S [1] => 7H [2] => AD [3] => 10S [4] => 9D [5] => 10S [6] => 5D [7] => 9C [8] => 6S [9] => 3C ) Does that help? -
I'm trying to write the backend to a card game in PHP. However, I am at the moment stumped! All I need to do is check if a value is in an array and if it is, return true. Here is my code so far: function checkcard($newcard) { $dealtcards = file("file.crd"); if (in_array($newcard, $dealtcards)) { return true; } } The file.crd is just a file with a new value on each line. e.g. 10S is 10 of spades. Can somebody shed some light on this please?
-
OK well say $data was a HTML file for example. I want the data between <h1> and </h1> to be $heading. You get the idea?
-
No when a certain word appears.