Jump to content

onlyican

Members
  • Posts

    921
  • Joined

  • Last visited

Everything posted by onlyican

  1. OK, This seems more complex than it is. Trying to work out different methods I have a table which lists pictures, description ect for an album, it also contains the Album ID My Pictures page displays 4 images, based on Page number But I want to have it to show by Image ID as well (So I can direct Link to that picture) This means the pagination would not be known as it will change (Newest images first, so what was Page 1 can now be page 2) Is there a way I can run a query which selects by the PK + 3 more (Either To left of or to right off) For example, PK1, Select 1-4 PK 10 (out of 10 records) - Select 6-10 PK 5 SELECT 3-7 ????
  2. With this many if statements can I advice using SWITCH switch($_GET){ case 'topic': include 'modules/pages/posts.php'; break; case 'forum': include 'modules/pages/topics.php'; break; case ''parent': ..... }
  3. Hi I have an upload script which uploads an image then resizes The error Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 7776 bytes) in Dir/UploadScript.php on line 234 The code function $strNewFileName = date("YmdHis").rand(0,5000).".".$this->strFileExt; $this->strNewFileName = $strNewFileName; $strDir = $_SERVER['DOCUMENT_ROOT'].$this->strSaveDir.$strNewFileName; $strTNDir = $_SERVER['DOCUMENT_ROOT'].$this->strSaveDir."tn_".$strNewFileName; move_uploaded_file($this->arrUploadFile['tmp_name'], $strDir); $image_p = imagecreatetruecolor($this->intNewWidth, $this->intNewHeight); switch($this->strFileExt){ case "jpg": $image = imagecreatefromjpeg($strDir); break; case "gif": $image = imagecreatefromgif($strDir); break; case "png": $image = imagecreatefrompng($strDir); break; } imagecopyresampled($image_p, $image, 0, 0, 0, 0, $this->intNewWidth, $this->intNewHeight, $this->intCurWidth, $this->intCurHeight); $blnSuccessUpload = false; switch($this->strFileExt){ case "jpg": if(imagejpeg($image_p, $strTNDir)){ $blnSuccessUpload = true; } break; case "gif": if(imagegif($image_p, $strTNDir)){ $blnSuccessUpload = true; } break; case "png": if(imagepng($image_p, $strTNDir)){ $blnSuccessUpload = true; } } imagedestroy($image_p); return $blnSuccessUpload; the Line causing issues (234) is $image = imagecreatefromjpeg($strDir); Now that image is created but the TN is not //Edit Just a note. I have ini_set('memory_limit', 16MB); if you notice the allocated memory is less than the memory allowed.
  4. Hi Goal: I have a popular website which has stories from users. Moving with the times, I want t to add a FB Like Button. but I also want to record the clicks I have searched for this and cant seem to find anything where I can get the num likes if I go to http://graph.facebook.com/http://www.example.com/page/ (Replacing example.com/page with my URL) I get { "error": { "type": "OAuthAccessTokenException", "message": "An access token is required to request this resource." } } The only alternative I can think of is having a script which goes to http://www.facebook.com/plugins/like.php?href=www.example.com/page/ Reading the code, getting the number between <span class="connect_widget_not_connected_text"> and people like this. </span> Any other suggestions are more than welcome
  5. my JS Skills are not the best. I have a snippet of code for the Facebook Like, so I can record the like clicks by adding my own function. I thought of using XMLHttpRequest() to call a page, which would run an SQL insert statement The only issue is, I can not record the Facebook details, thus making the page easily spammable. Any suggestions how I can do this?
  6. Its not too late to modify, I wont tell anyone Please at least wrap it in isset() to humor me
  7. Also Standards of Websites <html> <head> //Title Meta ect </head> <body> The website Stuff </body> </html> You have in your code Half way through the Body <HTML> <!-- @page { margin: 0.79in } P { margin-bottom: 0.08in } --> <BODY DIR="LTR"> </p>
  8. it should but amuse me here. Line 9 is giving an error as well for undefined UserID Comment this line out. (Yes I found the site, it aint that difficult)
  9. Most Common Issue I have seen is a space before the <?php tag <?php //Code here [code]
  10. you mention that this is SEO purpose. SEO purpose you should not change your URLS, I rebuilt my old website, which included removing some sections. I still kept content on these pages as it had links into and good PR. But options are as follows Find and Replace each time A file containing all page names, as variables or constants SQL (Not good idea as it would be a high load on your SQL) You could even have a function which handles the page function setPageName($strPage){ switch($strPage){ case 'home': $strNewPage = '/Index/'; break; default: $strNewPage = $strPage; } return $strNewPage; } echo '<a href="'.setPageName('home').'">Go Home</a><br />';
  11. The way I work is I have a global constants file which is called at the top of EVERY page This contains my php settings such as session_start(); Even shows before I debug my code (echo out above header)
  12. So you have loads of filenames, you want to change to SEO Friendly rewrites. Notepad++ and Find and Replace sorry
  13. Adding a ' will make it a \' as its escaping the quote for DB Protection (or your query would fall over) When you echo out the code, just use stripslashes(); so echo stripslashes($str);
  14. Hey I never said it was a ground floor Patio Window, Its more likely a 40th floor cat size window but still a window. Still dont like allowing users to actually run JS from my site.
  15. also you have [ / b ] within the string (After checkbox) And if you want to change your code and try a previous example, it wont work <pre>';print_r($property);echo'</pre>';
  16. Try removing the [ b ] before the echo Also property['propertyName']. where 'propertyName' is the Field from the Database.
  17. Your form fields have no NAME elements <input type="text" name="frmName" id="name" value="Name" onblur="if(this.value==''){this.value='Name'}" onfocus="if(this.value=='Name'){this.value=''}" /> //Add frmName
  18. Do you mean a JavaScript script, where you click "more" and more comments just show up, expanding the box?
  19. $propertyName is an array, Within your foreach loop try adding this echo'<pre>';print_r($propertyName);echo'</pre>'; See your results, tell us your results
  20. Can I get free Taxis if I help? lol only joking. Anyway try stripping to basics $subject = 'Results from Contact form'; $emailadd = 'm.mcdade@hotmail.co.uk'; $url = 'http://www.mock.thetaxirank.co.uk/thankyou.html'; $text = "This is a test"; if(mail($emailadd, $subject, $text, 'From: '.$emailadd.'')){ echo 'Mail has been sent'; }else{ echo 'there has been an error'; } Also check the SPAM box in hotmail, mail() tends to put emails into spam on hotmail
  21. I have had a look at your code, the error appears to be from one of your includes. Try commenting out all includes and test if it works Then uncomment one by one, u will find the include file causing the issue
  22. Sounds to me your missing a }
  23. I will start honestly, I aint bothered reading everything above. All I saw was Mail Form Multiple Refresh Anyway, Are you using any Captchas to stop bots using your form. Most of these fail if the form has been re-submitted (Refreshed) A very popular / Good Captcha, is googles recaptcha (They bought it early this year I think) http://www.google.com/recaptcha
×
×
  • 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.