Jump to content

Drongo_III

Members
  • Posts

    579
  • Joined

  • Last visited

Everything posted by Drongo_III

  1. Sorry didn't spot that. I really should read posts properly before posting! I just ran your code without including the header or footer and with a session usname set at the top. It worked fine. Is there more php in your header or footer? And are you sure the username sessions is getting set?
  2. Hi mate For a start this line looks dodgy. You have an opening curly bracket but no closing bracket <?php if ($username){?>
  3. I think we should all reply regularly to make sure it stays at the top of the list Glad its not just me that makes these mistakes haha
  4. Hi Mate It looks amazing. One thing i would point out is the "pages" drop down. What happens when the user has 10 top level pages? I can see that getting big! Also not big on the scrolling text on the dashboard landing page. It's jittery and unclear. Otherwise i really like it!
  5. Well that function will count the occurances of each array item. So if you have an array of the basket items you can do a count on the array items. Then if they occur more than once you can set the count as the quantity. Sorry i didn't read through your code that closely but it seemed like a possible solution...
  6. Not entirely sure what your array looks like but using $dupes = array_count_values($array); This counts all the occurances of each value and returns an array. The returned array has the original value as the key and the number of occurances as the value. So with a bit of logic you should be able to use those values in your display Hope that helps!
  7. Hi mate I reckon this should put you on the write track http://www.php.net/manual/en/function.imagegrabwindow.php Drongo
  8. Hi How far along are you with this? Firstly does that query return anything? Plus in your function you are returning the value but that won't make it appear unless you echo your function or print_r your array.
  9. This might get you on the right track... http://php.net/manual/en/function.shell-exec.php
  10. Last answer was probably best but you can break a string at a particular delimter using explode() function $str = "this/is/my/str"; $myarray = explode('/', $str); print_r($myarray); That will produce an array with each value being whatever is between the slashes.
  11. Are you just trying to print the entire array? You can't print or echo an array - only individual array values. To get the whole array use print_r($Name_of_Array);
  12. Yeah it's a nice lookin' site in firefox I would probably try fix the main errors too cos that might repair a multitude of issues and with luck will spring everythnig back into life.
  13. I think you'd be quicker to start over! That's a mess.
  14. Hi Guys I have been banging my head trying to get this to work. I am just trying to iframe content from my Amazon S3 bucket into a facebook page via the facebook app. When i do it off my server it works fine. When i do it via the bucket i get an "method not allowed" error. I read around a lot and a few posts say it's because facebook uses the GET method whereas Amazon S3 uses the POST method to transfer data. The thing is i chose amazon because i could acess content through both http and https but i don't know how to get facebook to play ball with amazon S3 and i don't really want to spend money on a ssl certificate for my server for such a simple thing. Does anyone know of a work around ? Any yes, i feel it's important to serve both http and https as a lot of people use the secure privacy setting and won't get to see the content if it's not https. What i want to achieve is so simple and yet again the facebook makes it impossibly hard! HATE FACEBOOK!
  15. Thank Req that all makes a LOT more sense now
  16. Thanks Req! That makes a lot more sense to me now. So if i wanted to point a client's domain to my server using my nameservers, but they already have mx records setup and working. What's the best way to ensure there's no disruption to their emails? Should i simply setup the zone file on my server (mx records and all) before i point the name servers? Or is there no way to really avoid disruption?
  17. You can do this by echoing them. e.g. to echo the value for "result" echo $arr[WHMCSAPI][RESULT];
  18. Hi guys I wonder if someone can help me understand something. I know a little about nameserves and dns but only enough to get by. Here's the odd thing... When I purchase a domain on 123-reg.co.uk and point it at my server using my nameservers I can still access the dns records (on the 123 reg control panel). I have to point the A record at 123 reg but besides that i can still set mx records etc from 123 reg. All good. However, if i setup a domain on go daddy and point it using my name servers (at my server) it ceases to allow me to access any of the dns info. So i can't set the mx record etc. in go daddy and instead i have to edit a zone file on my own server to set these records. So my question is why would the two services act so differently and is this simply down to the way they setup domains? I would really like to understand this
  19. You would probably need to start a session to track the user if you wanted to do that. Then have some logic to determine the page visited before the form page. At least that would be my first guess at how to do it. You'd essentially just keep overwriting the same session variable for every page unless the user is on the form page where it would pull the page variable instead of overwriting it- which would at that point be set to the last page visited. Although someone might suggest a better way of doing it.
  20. You could change header location on the page that processes your form data. So once it's done all of the processing (and assuming it doesn't output anything to the page) do: <?php header('Location: http//www.YourFormPageLink.com'); ?> And that'll redirect them anywhere you want. Alternatively if you don't know precisely what page they originated from then you could grab the url of the form page and set it as part a session variable or post it with the form. Then use that data in your header location to send them back to that link.
  21. If your images originate from an array how about: <?php //Do you array count to get number of values and set this to count $img= array(); //images array $img[] = "image1"; $img[] = "image2"; $img[] = "image3"; $img[] = "image4"; $img[] = "image5"; $img[] = "image6"; $img[] = "image7"; $img[] = "image8"; $img[] = "image9"; $img[] = "image10"; $img[] = "image11"; $img[] = "image12"; $count= count($img); echo "$count"; for ($i=0; $i<$count; $i++){ if ( $i==0){ echo "<div>"; } if ($i % 5 == 0 && !$i == 0){ echo "</div> <div>"; } echo $img[$i]; } echo "</div>"; ?>
  22. Well you could change it so it matches the class as a literal and then it would only target that div. Didn't know pattern_order was the default. I've always used it just for the sake of it. I've only used regular expressions for pretty basic stuff to be honest. Thanks for the tip
  23. You could use: $string = 'The older way of doing this, with gconftool-2 doesn’t seem to work anymore in GNOME 3 – used to be something like:<br /><br />However, there is still possible to change the background image, by using the gsettings tool instead. You will need the libglib2.0-bin package, which is probably already installed on your system. To change the background, use a command like the following:'; $patterns = array(); $patterns[0] = '|<br /><br />|'; $replacements = array(); $replacements[2] = ''; echo preg_replace($patterns, $replacements, $string); That will remove any insteance of your double line break. However, if you're going to use it a bit more widely then you might want to make the regular expression a bit cleverer in that it will currently match precisely the way <br /><br /> is written - spaces and all. But should set you on the right path
  24. Hi Mate you could try this $teststring = "This is a new string \n and i just out a line in"; echo nl2br($teststring); It replaces all new lines with html line breaks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.