-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
To help avoid blacklisting, you could consider using a plain "mailto" link: <a href="mailto:email@address.gov?subject=This is the Subject&body=This is the content of the email.">Email Link</a> This would open the message in the visitor's e-mail client and sent out by them. Note that this solution is geared toward e-mail clients like Microsoft Outlook. You would need to provide an alternative for those using web clients like Yahoo Mail...maybe a copy/paste solution. You could create a HTML form to send out the e-mail from your server. Note that there are many tutorials online for pre-populating forms: https://www.google.com/search?q=php+pre-populating+forms Just be aware that this has a greater potential as being marked as spam. Also, if you choose to go this route, be aware of e-mail injection attacks: https://www.google.com/search?q=php+email+injection
-
I would be careful with rushing the form. In addition to it not working, the script which sends out the e-mail could be used for e-mail injections. Note that there are many articles online for more information: https://www.google.com/search?q=php+injection+email As for getting something online soon, have you considered using a third-party solution? Google forms, for example, are free and can be embedded within existing websites. https://support.google.com/drive/answer/87809?hl=en The customization options are a little to be desired, but it's something to consider while you figure out an alternative.
-
remember Selected item of a list on update file
cyberRobot replied to unasemana's topic in MySQL Help
So basically, you have an HTML drop down menu and you're looking to set the default selection. Is that correct? Also, can you show the code for the compare() function? -
Can you provide any more specifics on what you're looking to do? Have you considered passing the necessary information using GET variables? PHP file 1 could send a flag to file 2 which generates the variable. File 2 can then send the variable back to file 1 using a header redirect. http://php.net/manual/en/function.header.php
-
How to print all images stored in a file Directory?
cyberRobot replied to Jenksuy's topic in PHP Coding Help
Also, I would imagine that image tag needs to go inside the foreach loop. <?php $files = glob('wp-content/uploads/'.$user_id.'/*'); foreach($files as $file) { echo '<img style="max-width:100%;" src="' . $file . ' />'; } ?> -
How to print all images stored in a file Directory?
cyberRobot replied to Jenksuy's topic in PHP Coding Help
This is just a guess, but it looks like you dropped the line of code which defined $user_id. $user_id = get_current_user_id(); -
The quotes look fine. To make some of the form fields required, you can run a series of if tests on the information. If the name is required, for example, check that the corresponding variable contains a value. If everything looks good, the e-mail can be sent. Otherwise, send them back to the form...or display an error message. Note that there are many tutorials online for making fields required. https://www.google.com/search?q=php+make+form+fields+required Try a few things out and if you get stuck, feel free to post again.
-
Just to clarify, Barand was asking you to provide the output for the array using his version of print_r()...or using the function. The output provided in the original post is difficult to wade through when there are no line breaks. Also, it might be helpful to see the portion of your code which pertains to the topic at hand. What have you tried?
-
What do you mean that the form doesn't even work as one? Are you getting errors? What is it doing that's unexpected? Side note: your form has two separate id attributes with the same value. <form id="jobnumber" method="post" action=""> <input type="text" name="jobnumber" id="jobnumber"/> The id value can only be used once throughout the page. http://www.w3.org/TR/html401/struct/global.html#h-7.5.2
-
As Jessica mentioned, the original code is invalid. The first string wasn't ended, for example. This: $strHtmlOutput.= ' <tbody> <tr> $strHtmlOutput.= '<tr> <th>Date of Request</th> <td> '.$result['cdate'].' </td> </tr> '; Should be: $strHtmlOutput.= ' <tbody> <tr>'; //<-- close string here $strHtmlOutput.= '<tr> <th>Date of Request</th> <td> '.$result['cdate'].' </td> </tr> ';
-
It might also be helpful to see the code for the form.
-
Does that mean the forms work as you expect now? Side note: I would recommend using the <label> tag for your form labels. For more information, visit http://www.cyberscorpion.com/2012-02/making-html-forms-more-accessible-and-improving-usability-with-the-label-tag/
-
Sanitize Function Stripping My Variables?
cyberRobot replied to capitalalist's topic in PHP Coding Help
What about the next step? Does $clubname have a value after it's created? Note that the code doesn't really show what happens to $clubname after it's initialized. Unless I'm missing something, you'll need to post more code. -
Sanitize Function Stripping My Variables?
cyberRobot replied to capitalalist's topic in PHP Coding Help
Have you done anything to see how the variables are working (or not) throughout the process? When the form loads, for example, do the hidden form fields contain a value? -
What do the values in the property column look like? Is there a separator between each component?
-
You're currently fetching the first row of data after executing the query...and then again in your do/while loop. If you switch to a while loop, you would only need to have the fetch in there once. <?php //... $recordset1 = mysql_query($query_recordset1, $Connection1) or die(mysql_error()); $row_recordset1 = mysql_fetch_assoc($recordset1); //... ?> <?php } while ($row_recordset1 = mysql_fetch_assoc($recordset1)); ?>
-
Is Dreamweaver writing the code for you...or are you just using it as a text editor? Using Dreamweaver in Code view doesn't add extra code that I'm aware of.
-
You could store the form information within a database and grab it as needed. Could you provide a little more information on what you're trying to do?
-
Have you tried running mysql_error() after the query which causes the error? http://php.net/manual/en/function.mysql-error.php
-
You sure can
-
Is there a better way to write this php / mysql script?
cyberRobot replied to Stuart_Westgate's topic in PHP Coding Help
Can you (or someone) clarify why PDO is inherently more secure than MySQLi? -
Getting Values from a Textbox that is in a While Loop?
cyberRobot replied to ZeTutorials101's topic in PHP Coding Help
It looks like the OP just wants the single ID for the item to remove. I would personally use anchor tags instead of the remove buttons and the HTML form. -
Getting Values from a Textbox that is in a While Loop?
cyberRobot replied to ZeTutorials101's topic in PHP Coding Help
One problem is that you have one form and many hidden input fields named "id". When the form is submitted, you may not get the desired input. -
Maybe this will help: http://www.tizag.com/mysqlTutorial/mysqlleftjoin.php
-
If you're going to use the anchor tag, you don't need the form tag anymore. If you want the link to look like a button, you can create one as an image...or use CSS to style the text. As for the ID, have you made sure that $recipe['id'] contains a value? You can use var_dump to find out: http://php.net/manual/en/function.var-dump.php Note that your original code used a different variable ($recipe_id).