-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
For what it's worth, I was able to replicate the error with the following lines of code: $number = ' 234234234 '; print number_format($number, 2, '.', ' ') . '<br>'; The number_format() function doesn't seem to like spaces. Have you tried using var_dump() to see the exact value of $prix?
-
Could you show us the code that defines $prix?
-
All it seems like you would need to do on the home page is query the database for id, title and short-text. Then loop through the results and display the title, short text, and a link to the full post which would pass the id through a GET variable. Then on the page that displays the post, you would read the GET variable with $_GET and query the database again. But this time you would get the title and long-text where the id is equal to the passed GET variable. Then you just display the post.
-
You could utilize the key returned from array_rand(). For example $randomKey = array_rand($enemyNames); $enemyName = $enemyNames[$randomKey]; $currImage = $enemyImage[$randomKey];
-
Are your radio buttons surrounded with a <form> tag? Is the <form> tag's method set to POST?
-
Ah, I wonder if the error is coming from the code that's supposed to process the first form. Try adding some debugging statements after the "All fields are required" string is saved to $error in both blocks of code. For example }else $error = "All fields are required."; echo '<div>form 1 submitted</div>'; And }else $error = "All fields are required."; echo '<div>form 2 submitted</div>'; As far as I can tell, the script that processes the form submissions doesn't check to see which form is submitted before executing the corresponding code.
-
what happens to the url of a page if it reach over 50 likes
cyberRobot replied to dil_bert's topic in Miscellaneous
It sounds like you are asking about Vanity URLs. Perhaps the following will help: https://www.facebook.com/notes/equine-calculator/how-to-claim-your-vanity-url-for-your-facebook-page/474147772600069 -
Have you checked to see if $from_name_s, $from_email_s, and $message_s contain expected values? Note that you can use var_dump() to check. For example $from_name_s = $_POST['name_s']; var_dump($from_name_s); If you're still unable to figure out the issue, it may help if you post the form code.
-
I'm not sure what you are asking. For what it's worth, both queries are pretty much the same. The only thing that would make a difference is the WHERE clause. In the second query, the WHERE clause is set to only pull records that have "raiz" set to 1 (using your $raiz1 variable).
-
Before performing the operation, you could run an if test to make sure the divisor isn't zero.
-
If the information comes from the form which has its method attribute set to POST, you would use $_POST. If the information comes from a GET method (form or HTML link), you would use $_GET. Note that I haven't spent a lot of time with your script, so I can't say definitively which one you should use. If you're unclear about the difference between $_GET and $_POST, perhaps the manual can help: http://php.net/manual/en/reserved.variables.get.php http://php.net/manual/en/reserved.variables.post.php
-
You'll want to double check the variable names. In the query, for example, you use $secondline. But the POST information appears to be store in $visitor_secondline.
-
It looks like the visitor ID is stored in a hidden field named "id". <input type="hidden" name="id" value="<?php echo $visitor_id; ?>"/> You'll need to update that name...or use $_POST['id'].
-
Login Page won't work, using pHPass
cyberRobot replied to beginnerProgrammer_96's topic in PHP Coding Help
It looks like code wasn't attached...or maybe was removed for you benefit. If you post again, you'll want to be careful with what you post. For example, you'll want to avoid posting any login credentials. -
For the sake of others, the double quotes shouldn't be an issue. The first part of the query string is surrounded by double quotes. $sql = "INSERT INTO visitors (visitor_name, visitor_email, visitor_firstline, visitor_secondline, visitor_town, visitor_county, visitor_postcode, visitor_tel, visitor_mobile, visitor_newsletter) VALUES ('" It is then concatenated with the necessary POST variables outside of the string. $sql = "INSERT INTO visitors (visitor_name, visitor_email, visitor_firstline, visitor_secondline, visitor_town, visitor_county, visitor_postcode, visitor_tel, visitor_mobile, visitor_newsletter) VALUES ('" . $_POST["vis_name"] . "','" . $_POST["vis_email"]... So this isn't a problem with double quotes being used within a double-quoted string. It's probably just a matter of the script that displays the form is calling itself. Note the form's action attribute is blank. Once the form is submitted, the same page / script is called and the form is re-displayed. But since the form isn't being populated with whatever was submitted before, the form appears to reset itself.
-
update table coloumn based o dropdown value
cyberRobot replied to hardikspider123's topic in PHP Coding Help
When you say table, do you mean HTML table? In other words, are you looking to change what an HTML tables displays based on the selection made in a drop-down menu? If that's the case, do you want the table to change instantly...or is it okay for the page to reload before showing the changes? If you want it to change instantly, you'll need to use a client-side language like JavaScript. Otherwise, you could use PHP to re-populate the HTML table. -
Adding an image to a PHP form submisison confirmation page
cyberRobot replied to stjonesMSI's topic in PHP Coding Help
As in something like this: echo '<img src="yourimage.jpg">'; echo "<h1>Thank you!</h1>\r\n<br>"; Note that you could also break out of PHP to do HTML stuff. if( $retval == true ) { ?> <img src="yourimage.jpg"> <h1>Thank you!</h1><br> Your application for employment has been successfully transmitted to <strong>Morgan Smith Industries</strong>.<br> <?php } -
Create Search in php and Display results as Products
cyberRobot replied to Adibhise's topic in PHP Coding Help
Is there a specific part you are stuck on? Note: if you're looking to hire someone to create a solution for you, you could try the Freelance forum: http://forums.phpfreaks.com/forum/77-job-offerings/ -
Form isn't working, goes to action-page.php
cyberRobot replied to MurielBuis's topic in PHP Coding Help
It looks like you're testing for a submit button named "send" here: if(isset($_POST['send'])) However, your submit button is not named. Try changing this <input type="submit" class="button" style="width:160px; height:47px;" value="send" /> To this (note the name attribute) <input type="submit" name="send" class="button" style="width:160px; height:47px;" value="send" /> -
Is PHP set to show all warnings and errors? If not, you can add the following lines of code to the top of your script(s) during the debugging process: error_reporting(E_ALL); ini_set('display_errors', 1);
-
Just to clarify, are you asking how to attach an ID to the allow button? Or are you looking for help with modifying the update query?
-
You could pass along a row ID with the button clicks. Then you just need to modify the update query to include the ID in the WHERE clause.
-
That solution isn't going to quite work since $row{"visivel"} comes from the first query. @magcr23 - That first query probably is not necessary. The update query will only change visivel when it is equal to zero. If you need to show the message about the product already being shown, you could use mysql_affected_rows(). More information about the function can be found here: http://php.net/manual/en/function.mysql-affected-rows.php
-
If that's the case, I wonder why it wouldn't strip off both zeros then...
-
Note that I agree with mac_gyver. Is there a reason you're trying to store the phone number as a number? With that said, have you made sure the zero is being lost by MySQL? The reason I ask is that I created a test column as bigint(11) and was able to insert values ranging from -9223372036854775808 to 9223372036854775807. It also didn't have a problem with 7788991100. So maybe something else is going on.