-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
There may be more issues, but the things that jump out at me are the extra "echo" and semi-colon. Try changing this: <?php echo do_shortcode('[button color="accent-color" hover_text_color_override="#fff" size="large" url="' . echo types_render_field("signup-link"); . '" text="SIGN UP TODAY - It's Free and Secure!" color_override="#d28743"]'); ?> To this: <?php echo do_shortcode('[button color="accent-color" hover_text_color_override="#fff" size="large" url="' . types_render_field("signup-link") . '" text="SIGN UP TODAY - It's Free and Secure!" color_override="#d28743"]'); ?> If that doesn't work and you're still getting errors, please let us know what the exact message is (or messages are).
-
Does this regex need the backslash before the dot? ^\S+@\S+\.\S+$
cyberRobot replied to appobs's topic in Regex Help
Side note: did you know that PHP has a built-in function for validating email addresses? http://php.net/manual/en/filter.examples.validation.php -
What is the error message you are seeing?
-
You could use the index of the <li> tag that was clicked to determine which image to show in the second list. Here's a quick example: <script type="text/javascript"> $('#all ul li').on('click', function(){ $(this).addClass('selected').siblings().removeClass('selected'); var selectedIndex = $(this).index() + 1; //index() starts with 0, but nth-child starts with 1...that's the purpose behind adding 1 $('.container ul li').removeClass('visible invisible'); $('.container ul li:nth-child(' + selectedIndex + ')').addClass('visible'); $('.container ul li:nth-child(' + selectedIndex + ')').siblings().addClass('invisible'); }); </script>
-
Perhaps you could find something here: https://www.google.com/?gws_rd=ssl#q=javascript%20onchange%20calculate%20total The following example seems close to what you're trying to do: http://www.mcfedries.com/javascript/ordertotals.asp
- 7 replies
-
- price
- match amount
-
(and 2 more)
Tagged with:
-
Reading From htm file and saving in mysql table using php
cyberRobot replied to akshayhomkar's topic in PHP Coding Help
You could load the page into PHP's DOMDocument class to process the table information. http://php.net/manual/en/domdocument.loadhtmlfile.php -
Have you tried using the LIMIT clause? Note that you can use it to select a range. http://www.mysqltutorial.org/mysql-limit.aspx
-
It looks like your script is dependent on Register Globals being enabled. For example, one of your radio buttons is named "list". In the PHP script that processes the form, it looks like you're trying to use the radio button's value here: Would you like to be part of our mailing list? $list \r\n <br> With the Register Globals settings disabled / removed (note that it was deprecated in PHP 5.3 and removed in 5.4), $list is now undefined. Trying using $_POST instead: Would you like to be part of our mailing list? $_POST['list'] \r\n <br>
-
Are you getting any errors? Note that you can show all PHP errors by adding the following to the top of your PHP script: <?php error_reporting(E_ALL); ini_set('display_errors', 1); ?>
-
Are you getting any errors? If not, have you checked if there are any MySQL errors? I'm not sure if you're using MySQL, MySQLi, or PDO, but they all have a function for showing errors after a query is processed. Here is the function for MySQL: http://www.php.net/manual/en/function.mysql-error.php
-
Have you looked into loading the external website into an iFrame?
-
Do you currently have the HTML and PHP parts in different scripts? If so, they'll need to be merged so you can use the PHP variables in form as mogosselin suggested. Your code might look something like the following: <?php //... $query = mysql_query("SELECT yname,mail,tp FROM reg WHERE mail = '$mail' LIMIT 1"); $row = mysql_fetch_assoc($query); mysql_close($con); ?> <form class="form-signin" role="form" id="form1" action="post_user.php"> <label>Name <input type="text" class="form-control" placeholder="Your Name"<?php if($row['yname'] != '') { echo ' value="' . $row['yname'] . '"'; } ?> required name="yname" id="yname" autofocus /></label><br /> ... </form> Note that I added the LIMIT clause to the query since you're probably only looking for one result. If that's a correct assumption, you don't need the loop. I also modified the <label> tag so that it's attached to the corresponding input field.
-
how to show selected result from db on dropdown?
cyberRobot replied to lovephp's topic in PHP Coding Help
You could try something like this: <?php echo '<select name="Manager">'; $query="SELECT * FROM managers"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value='{$row['manager_name']}'"; if($Manager == $row['manager_name']) { echo ' selected="selected"'; } echo ">{$row['manager_name']}</option>"; } echo '</select>'; ?> -
Does your table have a primary key? If so, you could store that key in a session variable after the user logs in. You can then use the session variable for the key in your query(ies).
-
mysqli prepared statements ... don't get any results
cyberRobot replied to Epimetheus1980's topic in MySQL Help
Have you checked if there are any MySQL errors? Try adding the following debug line before closing the database connection: echo $mysqli->error; -
Forget Password/Registration Emails not working
cyberRobot replied to JoeyTemp's topic in PHPFreaks.com Website Feedback
You probably already tried this, but have you checked your spam folder? Pretty much everything PHPFreaks sends me goes to spam. -
This is a very crude example, but you could hard-code the values in an array. Then use a GET variable from a form, or wherever, to pull the corresponding links. <?php $linkArray = array( 'new' => array( 'http//ebay.com/newcars/', 'http//cars.com/new/', 'http//auto.com/newmake/' ), 'old' => array( 'http//ebay.com/oldcars/', 'http//cars.com/old/', 'http//auto.com/oldmake/' ) ); foreach($linkArray[$_GET['type']] as $currLink) { print "<div>$currLink</div>"; } ?> If the GET variable (type) is set to "new", the example code will display the new links. Otherwise, it will display the old links when set to "old".
-
Where does these links come from? Do you have a database which indicates which links go with "new" and "old"? If so, you could just query the database depending on which option was checked.
-
Sorry, I misread the question a bit. But I'm glad you figured it out though. Note that the ORDER BY clause defaults to ascending order, so the "ASC" isn't really necessary.
-
Also, you could minimize the number of results being processed by the query with the WHERE clause. For example: $query = "SELECT * FROM events WHERE date >= '" . date('Y-m-d') . "' ORDER BY date DESC, time DESC LIMIT 5"; With the above query, you won't need the following if statement: if ($row['date'] >= date('Y-m-d'))
-
To get the information you want, you'll need to sort the results. Have you tried something like this: SELECT * FROM events ORDER BY date DESC, time DESC LIMIT 5
-
What does the query look like when you add the LIMIT clause? Have you tried using mysql_error() to see if the query is returning errors?
-
You could add 3 input fields and name them using array syntax. Here is a quick example: <?php if(isset($_GET['brand'])) { print '<pre>' . print_r($_GET, true) . '</pre>'; } ?> <form method="get"> <p>Your favorite cars are:</p> <div><label>Brand 1: <input type="text" name="brand[]"></label></div> <div><label>Brand 2: <input type="text" name="brand[]"></label></div> <div><label>Brand 3: <input type="text" name="brand[]"></label></div> <input type="submit"> </form>
-
You could modify the query so it's sorted in descending order using DESC. More information can be found here: http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html You could then use the LIMIT clause so the query only returns 5 results: http://www.mysqltutorial.org/mysql-limit.aspx Side note: in case you're not aware, the mysql_* functions have been deprecated. At some point in the near future, you'll need to switch to MySQLi or PDO. More information can be found here: http://www.php.net/manual/en/mysqlinfo.api.choosing.php
-
It's difficult to know what you're trying to do based on the information provided. We might be able to help if you let us know what you're database looks like and describe what the expected output should look like. In case you're unfamiliar with building dynamic pages in PHP, the following video may help with the basics: Note that this is an older video which uses the deprecated mysql_* function. At some point in the near future, you'll need to use MySQLi or PDO if you're not doing so already. More information can be found here: http://www.php.net/manual/en/mysqlinfo.api.choosing.php