-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
The following quote is from the manual (http://php.net/manual/en/function.strtotime.php):
-
How to validate contact form using java script?
cyberRobot replied to MathiVel's topic in Javascript Help
This can be accomplished with PHP. You would just re-display the form if there were errors, populate it with the information submitted, and display the necessary error notices. The only benefit of using a client-side solution, like JavaScript, is that the page doesn't need to be reloaded before the errors are displayed. JavaScript could display the errors on the fly. Just be aware that JavaScript can be turned off, so it's a good idea to also validate using a server-side solution like PHP. -
Media queries stop working after certain size
cyberRobot replied to hamburgerlove413's topic in HTML Help
Perhaps the path to the 768.css and 480.css files isn't correct? Your first two responsive stylesheets are linked using document-relative links. The 768 and 480 stylesheets use root-relative links. Try removing the slash before "css" in the following lines: <link rel="stylesheet" media="only screen and (max-width: 768px) and (min-width: 481px)" href="/css/768.css"> <link rel="stylesheet" media="only screen and (max-width: 480px)" href="/css/480.css"> -
Whats the process for customizing php?
cyberRobot replied to ausdigitalmedia's topic in PHP Coding Help
Have you looked into creating a separate page template? http://codex.wordpress.org/Page_Templates -
echo permalink for featured image in wordpress portfolio
cyberRobot replied to bantersaurus's topic in PHP Coding Help
Did you have the code where you tried fixing the issue? Note: when posting code here, please surround it with tags. It makes the post and code easier to read. To fix the issue, you could try the following: $postThumbInfo = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); if ( $i < 3 ) { echo '<li class="margin_r"><div class="port_tn"><a href="<?php echo $postThumbInfo[0]; ?>" rel="prettyPhoto[portfolio-gallery]">'; echo the_post_thumbnail( array (40,40, true, "title" => "")); echo '</a></div></li>'; $i= $i+"1"; } else { echo '<li class="no_margin"><div class="port_tn"><a href="<?php echo $postThumbInfo[0]; ?>" rel="prettyPhoto[portfolio-gallery]">'; echo the_post_thumbnail( array (40,40, true, "title" => "")); echo '</a></div></li>'; $i = "0"; } -
For what it's worth, the <label> tags need to be attached to the form fields. For more information, see: http://www.cyberscorpion.com/2012-02/making-html-forms-more-accessible-and-improving-usability-with-the-label-tag/ Also, there is a specific filter for email addresses: http://php.net/manual/en/filter.examples.validation.php
-
echo permalink for featured image in wordpress portfolio
cyberRobot replied to bantersaurus's topic in PHP Coding Help
I don't have any personal recommendations, but you could try out the PHP Freelancing section: http://forums.phpfreaks.com/forum/20-php-freelancing/ Note that you could also post your updated code and perhaps someone here can help. Note that we'll likely need to see more of the code than just the link. -
echo permalink for featured image in wordpress portfolio
cyberRobot replied to bantersaurus's topic in PHP Coding Help
I think the answer can be found here: http://codex.wordpress.org/Function_Reference/the_post_thumbnail#Post_Thumbnail_Linking_to_Large_Image_Size So basically, you would do something like the following: <?php $postThumbInfo = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?> <a href="<?php echo $postThumbInfo[0]; ?>" rel="prettyPhoto[portfolio-gallery]"><?php the_post_thumbnail( array (40,40, true, "title" => "")); ?></a> More information about the wp_get_attachment_image_src() function can be found here: http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src -
Validate form errors before going to action page
cyberRobot replied to Last's topic in PHP Coding Help
Try changing ["amount"] to $_POST['amount'] -
There needs to be a space after all open PHP tags. So code like the following: <?}?> ...needs to be changed to something like <?php } ?>
-
echo permalink for featured image in wordpress portfolio
cyberRobot replied to bantersaurus's topic in PHP Coding Help
Where does $image[0] come from? Also note that the following: <a href="<?php echo $image[0]; ?>" rel="prettyPhoto[portfolio-gallery]">'; echo the_post_thumbnail( array (40,40, true, "title" => "")); echo '</a> ...should be <a href="<?php echo $image[0]; ?>" rel="prettyPhoto[portfolio-gallery]"><?php the_post_thumbnail( array (40,40, true, "title" => "")); ?></a> Note that I added the PHP tags around the call to the_post_thumbnail(). I also removed the "echo" since the_post_thumbnail() function automatically outputs the result. More information about the function can be found here: http://codex.wordpress.org/Function_Reference/the_post_thumbnail -
I have marked the topic as solved. If you need anything else, please mark it as unsolved...or start a new topic.
-
Perhaps the value is getting reset somewhere. Or maybe there is something else going on. If you need further assistance, we'll need to see some code.
-
Timed events -- Not sure best way to approach this
cyberRobot replied to RyanWalsh3387's topic in PHP Coding Help
I would look into storing a timestamp of when user 1 submits their report. The script would then check the timezone before doing anything else. -
Have you considered using AJAX? Perhaps something here will help: https://www.google.com/search?q=call+php+function+with+ajax
-
And what would that action be? Perhaps there is a JavaScript solution. Or maybe you could use CSS media queries. It all depends on what you're looking to do.
-
What are you trying to accomplish? What do you need the browser window width for? Perhaps we can direct you down a different path.
-
Instead of using document-relative paths, have you considered root-relative? For example, you could do something like the following: <?php include "{$_SERVER['DOCUMENT_ROOT']}/includes/egl_inc.php"; ?> With this, you won't need to change the include code from page to page.
-
Perhaps the following will help: http://overit.com/blog/canonical-urls
-
Server-side analytics and server-side logging in particular
cyberRobot replied to johnsmith153's topic in PHP Coding Help
The way I read that is the ability to enable Google Analytics from within Segment.io is being depreciated. Based on a cursory look through the web, I didn't see any references to server-side Google Analytics being shut down. -
Have you tried doing something like this: <a href="sub_item.php" class="icons_button<?php if($page == 'index') echo ' selected'; ?>"><i class="icon-tablet"> </i> Sub Item Example</a>
-
You'll need to use something like PHP or JavaScript to process the text box.
-
As AbraCadaver suggested, you should look into the alternatives for mysql_ functions since they are depreciated. More information about the alternatives can be found here: http://www.php.net/manual/en/mysqlinfo.api.choosing.php In the meantime, mysql_error() will show if the query is causing errors. An example showing how to use the function can be found here: http://php.net/manual/en/function.mysql-error.php
-
What are you looking to do with the script? Perhaps there's an alternative solution that we could suggest if we knew more.