-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
Images from directory with Pagination, Image Resizing etc
CroNiX replied to cobusbo's topic in PHP Coding Help
Since these are coming from a directory and not the database, I'd suggest using array_chunk(). Here's some pseudocode. Hopefully you can see what's going on. //grab the page number from the url, if not set assume it's page 1 $page_number = (isset($_GET['page'])) ? filter_input(INPUT_GET, 'page', FILTER_SANITIZE_NUMBER_INT) : 1; $folder = 'img/'; $filetype = '*.*'; $files = glob($folder.$filetype); //you'll need this total to determine how many "page" links to build $count = count($files); $per_page = 10; //show 10 images per page //split up the files array into chunks of 10 (number per_page) $files = array_chunk($files, $per_page); $files = $files[$page - 1]; //grab the files for this page from the chunked array based on index //now cycle through $images and display them ... //determine how many pages there will be based on total images and $per_page $total_pages = ceil($count / $per_page); //build your page links based on how many pages there are ... As far as the " ", search for it. Its not coming from this code. It is missing the ";" at the end so that's why it's showing up.- 4 replies
-
- php
- pagination
-
(and 1 more)
Tagged with:
-
Ah, so you don't have access to the actual mail logs, which is most likely where the bounce notice from gmail would be. It doesn't make sense that gmail is blocking bluehost if you are able to send to gmail from the send_message.php but not your other pages. Presumably these are all being sent via bluehost. We use SendGrid with a unique IP for outbound emails and it works great. You're not at the mercy of your hosts IP reputation. If 500 different domains are sending through Bluehost and some of them are bad/spammy/fishing/etc, it could affect delivery of everybody else. We send about 4,000 emails/day without issue. Once in a few months there will be a problem with a specific domain that we can get resolved directly, but google will be NO help to you unless you have a business account. They'll just point you to about 10 huge webpages of info and tell you to make sure your emails are in compliance with their rules. Here's some good info: http://www.rackaid.com/blog/gmail-blacklist-removal/
-
php sitemap script help - Last Mod Function not working properly
CroNiX replied to bomstudies's topic in PHP Coding Help
One of these lines is probably wrong. Look at the $dir/$file concatenation, they're different with one adding a directory separator. $fileinfo = pathinfo( $dir . $file ); if (filemtime( $dir .'/'. $file )==FALSE) { -
The webuser (user server is running as, not your account user) must have user or group file permissions to access/read/write on a dir outside of your webroot. Imagine the security implications if anyone on the server could just read/write any file they wanted.
-
Basic question about the capabilities of PHP.
CroNiX replied to claudiogc's topic in PHP Coding Help
Well that's a bit different than your original question where you were asking about simulating interacting with the page...clicking, etc. If you just wanted to get the images from some webpage on a different server (not yours), you could do what I mentioned in my #2 answer. 1) Use simple_html_dom to retrieve the webpage 2) Use simple_html_dom to traverse the webpage and extract the image urls 3) Use CURL to request each of the images from the other server and save them -
if (strtolower($category) == 'admissions') { Convert it to lower case and check against lower case
-
Dynamic Fields js/php to MySql need to submit dynamically to the database
CroNiX replied to jungle's topic in PHP Coding Help
PS in the future please post code between [ code] //code here [ /code] tags -
Dynamic Fields js/php to MySql need to submit dynamically to the database
CroNiX replied to jungle's topic in PHP Coding Help
Because you only tell it to insert 2 values: $bnt = mysql_query("INSERT INTO tablename (first, second) VALUES ('$ced', '$erg')")or die('Error: '. mysql_error() ); $result = mysql_query($bnt); That should probably be in your loop where you are retrieving $ced and $erg from $_POST. -
$myemail = "MY GOES EMAIL HERE"; //change to your email address mail($myemail, $subject, $message, 'From: ' . $myemail); it's mail(to, subject, message, headers) where "headers" can also be additional headers like "reply-to" but needs to contain at least the From header. Additionally, mail() returns a boolean to tell whether it was successful or not. So you can do something like: if (mail(to, subject, message, from)) { echo 'email sent'; } else { echo 'there was a problem sending the email'; }
-
You still haven't stated exactly what the error you get is, only that it "made reference to the php.ini". Copy/Paste the exact error message here.
-
you're welcome
-
What makes you think the problem is with php.ini? That gets installed/created when you install php, so it should be there. Do you get an error message or something?
-
Basic question about the capabilities of PHP.
CroNiX replied to claudiogc's topic in PHP Coding Help
1) No. PHP is run on the server and all it does is output. Once it sends the output it's done. JS runs in the users browser and can interact with the page. 2) not sure what you mean. It can't click on links, but you could scrape anything out of a page on a different server, like images. You'd grab the webpage using CURL or something, and then parse it grabbing the urls for images, and then requesting and saving the images on the server. -
Haven't tried on iPad, but you have the #footer-content set at 1000px width. Try 100%
-
I believe it would if you added L,R to EACH RewriteRule. Perhaps that's not what you meant since the htaccess you just posted doesn't do that.
-
That could cause several redirects since it will stop at the first L and redirect.
-
http://www.uploadify.com/
- 3 replies
-
- 1
-
- upload
- progressbar
-
(and 1 more)
Tagged with:
-
http://jsfiddle.net/4ycg79v8/ Changes: Added class "rotator" to parent div Removed all "hidden" classes from child elements (creates by itself so less HTML to start with) Works with any number of children without additional JS changes Fixed improper child element IDs (can't start with a number)