Jump to content

BrodaNoel

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by BrodaNoel

  1. I cant understand wich is you question, because my english is soo bad. If you can explaint you again, and more quickly and "neutral", will be good. Check you have an error... You forget a "});" <script type='text/javascript'> $('.bt-add-com').click(function(){ var theCom = $('.the-new-com'); var theName = $('#name-com'); var theMail = $('#mail-com'); <?php if($username && $userid) : ?> theName = "<?php $username; ?>"; theMail = "<?php $email; ?>"; <?php endif; ?> }); // This you forget </script>
  2. Remember: if( empty($errors)) is FASLE becasuse that is TRUE: if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['subject']) || empty($_POST['message'])) { $errors .= "\n Error: all fields are required"; } and then, your code not send the e-mail.
  3. Wait wait wait wait... First, you ahve very mucho problems. Look... I'm in your site, and I go to the file when you process your e-mail (http://www.icampk.com/contact-form-handler.php) and I'm seen that: You have not support to PHP in your server... else, we should not see the PHP code. That is your PHP code: $errors = ''; $myemail = 'info@icampk.com'; if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['subject']) || empty($_POST['message'])) { $errors .= "\n Error: all fields are required"; } $name = $_POST['p1']; $email_address = $_POST['p2']; $email_address = $_POST['p3']; $message = $_POST['message']; if (!preg_match( "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", $email_address)) { $errors .= "\n Error: Invalid email address"; } if( empty($errors)) { $to = $myemail; $email_subject = "Contact form submission: $name"; $email_body = "You have received a new message. ". " Here are the details:\n Name: $name \n ". "Email: $email_address\n Message \n $message"; $headers = "From: $myemail\n"; $headers .= "Reply-To: $email_address"; mail($to,$email_subject,$email_body,$headers); //redirect to the 'thank you' page header('Location: contact-form-thank-you.html'); } And, look the first lines... if(empty($_POST['name']) || and bla bla bla... Is obviolsy that... $_POST['name'] is EVERYTIME empty, because $_POST['name'] not exist... only exist $_POST['p1'] All that is is empty: if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['subject']) || empty($_POST['message'])) You should modify that... replace "name" for "p1", and "email" for "p2" and bla bla bla. Then i see: $message = $_POST['message']; But, $_POST['message'] is not existing! remember add "name=message" at your <textarea> And then, you use: mail($to,$email_subject,$email_body,$headers); but, $email_body is a string defined for your... You should use "$message"... Please, dont copy and past code for others site... is better learn about PHP, read about PHP, read examples, but NEVER COPY AND PAST... I have very much experience with PHP and when I copy and past, EVERYTIME have problems. If you continue having problems, report us here.
  4. Can you share with us the PHP code? THe code that you use to send the e-mail I'm looking you html and: "<textarea></textarea>" here you write your mensaje, but, you have not set a "name". You should write: <textarea name="message"></textarea> And then, in PHP code, use $_POST['"message"]
  5. Replace the "include" for "include_once" if only include a file for use their functions.
  6. Hi! Mmmmm... Are muy missing the "$" in TeamName var ? Like that: You have: <td width='90'><font size='2pt'>".TeamName."</td> And you should have: <td width='90'><font size='2pt'>".$TeamName."</td> In another hand, (css), check replace that: <td ALIGN='left'><font size='2pt'>".UserID."</td> and that <td ALIGN='center' style='vertical-align: top;'>".$userid."</td><td> for: <td style='text-align:center'><font size='2pt'>".UserID."</td> and that <td style='vertical-align: top; text-align:center'>".$userid."</td><td>
  7. http://php.net/manual/en/function.mysql-insert-id.php int mysql_insert_id ([ resource $link_identifier = NULL ] ) Retrieves the ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT). Example: <?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('mydb'); mysql_query("INSERT INTO mytable (product) values ('kossu')"); printf("Last inserted record has id %d\n", mysql_insert_id()); ?> Warning This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. And... Please, read about: SQL Inyection.
  8. Try with that: $mapping = array( '/booknow' => 'inc/mobile/booknow.php', // Warning here... Remove this ","... ); if(array_key_exists($_GET['from'], $mapping)) include $mapping[$_GET['from']]; else include 'inc/mobile/default.php'; That will work fine. If you still having problems, do that: $mapping = array( '/booknow' => 'inc/mobile/booknow.php' ); var_dump($mapping); var_dump($_GET['from']); var_dump($_GET); var_dump(array_key_exists($_GET['from'], $mapping)); var_dump($mapping[$_GET['from']]); if(array_key_exists($_GET['from'], $mapping)) include $mapping[$_GET['from']]; else include 'inc/mobile/default.php'; And paste here all this results, so, we can see what is the problem.
  9. I'm recommend everytimes push the "die(mysql_error())" in debug time. That remove very much problems. Just... for the next : Change $query = "insert into complainant(username,password,c_name,email) values ('$com_username','$com_password','$com_email','$com_companyname')"; if (mysql_query($query)) { echo "<script>alert('Registration Successful')</script>"; } for that: $query = "insert into complainant(username,password,c_name,email) values ('$com_username','$com_password','$com_email','$com_companyname')"; $resTest = mysql_query($query) or die(mysql_error()); if ($resTest) { echo "<script>alert('Registration Successful')</script>"; }
  10. In another side, you have problems with the performance. You are doing a query for each user... And, that's sh**. You should be something like that: "get all the users with their data" $friends = Friends::getFriendsForUser($data->id); if (count($friends) > 0) { $db = DB::getInstance(); $friendsWithData = $db->query('SELECT name, username FROM users WHERE id IN (?)', implode(',',$friends)); foreach ($friendsWithData as $friend) { echo '<table> <tr> <td><img src="images/avatar.png"></td> <td><a href="profile.php?user='.escape($friend->username).'">'.$friend->name.'</a></td> </tr> </table>'; } } else { echo 'Not following anyone.'; } With that, you are doing a only one QUERY at the DataBase and print HTML for each result. This is better.
  11. I cant see an error. Please, do that: En the first line of the file, write this: if(isset($_POST['username'])){ var_dump($_POST); } And, append in each "mysql_query' function that: 'or die(mysql_error())'. Example: $check_email = "select * from complainant where email='$com_email'"; $run = mysql_query($check_email) or die(mysql_error()); Then, go to the site, write your data, push "submit" and paste here everything. On the other side, check that: you have problems (in a future) with a vulnerability (security). read about: MySQL Injection.
  12. Or, the emails are landing in the SPAM folder.
  13. No, I'm saying that <option> tag not have the "name" property... Is the <select> tag has that. When you select a value in a <select> (combobox), you are "creating" a (only one) variable with the value that you are selected. So, that is the problem for asnwer this: "For some reason we can't seem to get our select box in our search from" So, if you write the "name" property in the <option> tag, the variable not be going to be created. Can you paste here the HTML generated (using the SELECT)? I need see what is "field name", "id_field" al more, for help me to help you.
  14. Exactly... We can't (for time or desire) refactor all a web site! That is soo expensive (in dollars)
  15. Wait... Prune option? You should be give us more information about this "option". Can you paste here some screenshot? I dont know some "prune option" in PHPMyAdmin, but, this function can be some function created for any database admin of your website. Please, give more information about this option.
  16. The "name" should be in the <select>... Not in the <option> tag. Something like that: echo '<select name="fieldname">'; and echo '<option ' .$selected . ' type="selectbox" value="'. $fieldName . '_' . $field_id. '">'.$child->name.'</option>';
  17. Hey guys! I'm new with this topic. Which is the better Continuous Integration Server for PHP? And, what are the better skills of this servers to be most important?
  18. Hey guys! I'm new with this topic. Which is the better CUnit Test library for PHP? (like PHPUnit) And, what are the better skills of this libraryes to be most important?
  19. Exactly... And with that, you solve the problem. But, you need think what gonna happen when $_GET['form'] will take a value that is not in the array... The "include" sentence will include this file: "" (empty string)... You should do any like that: if($mapping[$_GET['from']] != '') include $mapping[$_GET['from']]; else include 'default_file.php';
  20. You can define an array with the "map" of key-content. For example: $mapping = array('/page1' => 'content1', '/page2' => 'content2', '' => 'default'); echo $mapping[$_GET['from']]; So, you only do add another element in the array.
  21. It's simple. The "warning" (is not an error) say: "The $errors is not defined" So.. The $errors is not defined... It not have a value. If you use a var without a value, or not defined, you will see a warning. In the top of you site, add this line: $errors = ''; So, $errors will have a value... But, dont worry, is only a warning... not an error.
  22. In this line, we have not a sintax error... Only if trigger_error, or mysql_errno is not defined... but... I guess they are defined... Can you paste here the complete error message?
  23. I'm sorry Ch0cu3r. Read my sign... "Sorry for my english"... My english is soo bad. I had not read your answer. Sorry.
  24. Here you can see an example (in Spanish, but, only look at the code): http://www.elserver.com/ayuda/como-envio-correos-con-php-por-smtp-phpmailer/ Saludos!
×
×
  • 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.