atlanta
Members-
Posts
172 -
Joined
-
Last visited
Never
Everything posted by atlanta
-
[SOLVED] Problem submitting data to database
atlanta replied to tony_leic's topic in PHP Coding Help
<html><body> <h4>test</h4> <form action="process.php" method="post"> Message: <input name="message" type="text" /> <input type="submit" /> </form> </body></html> you had message="message" needed to be name="message" also <?php // Open database connection mysql_connect("localhost", "*********", "**********") or die(mysql_error()); mysql_select_db("*******8") or die(mysql_error()); $name = mysql_real_escape_string($_POST['message']); // Insert data $query = "INSERT INTO friends (name) VALUES ('$name')"; mysql_query($query) or die(mysql_error()); print "updated"; ?> -
Yea you will have to do it as a session throughout if you want it to work that way.. I have some apps that will go through php files and change certain strings.. if you dont wanna do it this way then have the cookie expire after a period of time, do a survey and see how long the average user stays on.. just throwing some ideas out there
-
No problem if it worked hit the topic solved button.. -WILL-I-AM-
-
yea good idea i knew it was something wrong with that .. thanks for the correction.
-
<?php $test = "word_word"; $teststr = str_replace("_", " ", $test); echo $teststr; ?>
-
Sorry didnt look at the code good the first time. $query = "SELECT * FROM listings WHERE category = '{$_GET['id']}'"; $result = mysql_query($query); $numrows = mysql_num_rows($result); $row_count = "0"; for($x = 0; $row = mysql_fetch_array($result); $x++) { $id = $row['id']; $lines = stripslashes($row['lines']); $markets = stripslashes($row['markets']); $opportunity = stripslashes($row['opportunity']); $listings .= '<div id="list"><table width="100%"><tr><td class="listID"><a href="NEED_LINK?id='.$id.'">Listing ID: '.$id.'[/url]</td></tr><tr><td class="listLine">Product Lines: '.$lines.'</td></tr><tr><td class="listLine">Target Markets: '.$markets.'</td></tr><tr><td class="listLine">Sales Opportunity: '.$opportunity.'</td></tr></table></div>'; $row_count++; if (!$numrows == "0") { $listings = '<div>Sorry, no listings under '.$category.' matchining your criteria were found.</div>'; } }
-
$query = "SELECT * FROM listings WHERE category = '{$_GET['id']}'"; $result = mysql_query($query); $numrows = mysql_num_rows($result); for($x = 0; $row = mysql_fetch_array($result); $x++) { $id = $row['id']; $lines = stripslashes($row['lines']); $markets = stripslashes($row['markets']); $opportunity = stripslashes($row['opportunity']); $listings .= '<div id="list"><table width="100%"><tr><td class="listID"><a href="NEED_LINK?id='.$id.'">Listing ID: '.$id.'</a></td></tr><tr><td class="listLine"><b>Product Lines:</b> '.$lines.'</td></tr><tr><td class="listLine"><b>Target Markets:</b> '.$markets.'</td></tr><tr><td class="listLine"><b>Sales Opportunity:</b> '.$opportunity.'</td></tr></table></div>'; $row_count++; if (!$numrows) { $listings = '<div><b>Sorry, no listings under '.$category.' matchining your criteria were found.</b></div>'; } }
-
Can anyone help with this PHP form checkbox query?
atlanta replied to markrees's topic in PHP Coding Help
Something like this . if (isset($subscribe)) { $subscribe = "Subscribed"; } else { $subscribe = "Not Subscribed"; } put that after $subscribe = $_POST['subscribe']; only if that is how you have your code written post up your php code so i can tell you for sure, -
Yea use php to set your session variable as showed here http://us2.php.net/session look over that link . if you need help let us know`
-
Post the code up that you have .
-
The way i do it is escape out of php and echo the html inside of making php work to display the content.. ex. <?php if($variable == "yes") { ?> <b>Bold</b><i>text</i> <? } ?>
-
very first line elseif(isse($_GET['id'])) needs to be elseif(isset($_GET['id']))
-
Something simple that will change the background on your page when different level is selected <html> <script language="JavaScript"> <!-- var Color = new Array(); Color[1] = '#FF0000'; Color[2] = '#00FF00'; Color[3] = '#FFFF00'; function changeBG(myColor){ document.bgColor = Color[myColor]; } //--> </script> <select name="d" onChange="javascript:changeBG(this.value)"> <option value="1">High</option> <---- background red <option value="2">Medium</option> <---- background green <option value="3" selected>Low</option> <---- background yellow </select> </body> </html>
-
Ok so you mean when the user select red the background of the box turns RED??.. If so you will want to use javascript
-
[SOLVED] Very Simple Form/PHP Mail Setup - Need Help
atlanta replied to cdinsmore's topic in PHP Coding Help
Try this in your php file <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- TemplateBeginEditable name="doctitle" --> <title>Your Request Has Been Submitted</title> <!-- TemplateEndEditable --> <!-- TemplateBeginEditable name="head" --> <!-- TemplateEndEditable --> </head> <body> <?php $recipient = "email@email.com"; $from = "email@email.com"; $subject = "Newsletter Submission"; $SubmittingDepartment = $_POST['SubmittingDepartment']; $Contributor = $_POST['Contributor']; $NewsletterText = $_POST['NewsletterText']; $EventDescription = $_POST['EventDescription']; $EventDate = $_POST['EventDate']; $LrgCopyDescription = $_POST['LrgCopyDescription']; $LrgCopyDate = $_POST['LrgCopyDate']; $MassEmailDescription = $_POST['MassEmailDescription']; $MassEmailDate = $_POST['MassEmailDate']; $LetterDescription = $_POST['LetterDescription']; $LetterDate = $_POST['LetterDate']; $MaintenanceDescription = $_POST['MaintenanceDescription']; $MaintnenanceDate = $_POST['MaintenanceDate']; $Visitor = $_POST['Visitor']; $VisitingDepartment = $_POST['VisitingDepartment']; $VisitDate = $_POST['VisitDate']; $message = "<html><body><p><b>Submitting Department:</b> ".$SubmittingDepartment."<br /><b>Contributor:</b> ".$Contributor." <br /><b>Newsletter Text:</b> ".$NewsletterText." <br /><b>Upcoming Event:</b> ".$EventDescription." <b>Date:</b> ".$EventDate."<br /><b>Large Copy Job:</b> ".$LrgCopyDescription." <b>Date:</b> ".$LrgCopyDate."<br /><b>Mass E-mail Distribution:</b> ".$MassEmailDescription." <b>Date:</b> ".$MassEmailDate."<br /><b>Letter Distribution:</b> ".$LetterDescription." <b>Date:</b> ".$LetterDate." <br /><b>Scheduled Maintenance:</b> ".$MaintenanceDescription." <b>Date:</b> ".$MaintnenanceDate."<br /><b>Visitor:</b> ".$Visitor." <b>Will be visiting:</b> ".$VisitingDepartment." on: ".$VisitDate."<br /></body></html>"; //In case any of the lines are larger than 70 characters, use wordwrap $message = wordwrap($message, 70); $headers = "From: $from\nContent-Type: text/html; charset=iso-8859-1"; ini_set("SMTP","my.email.server"); # Send the email mail($recipient, $subject, $message, $headers); echo("<p>Your message has been sent. Thank you!</p>\n"); ?> </body> </html> -
If you actually have php check the filesize and type then no.. but if you only where the html form tries to validate the size and type then yes
-
The second error is telling you that you have this section wrong. $db_conn = new COM("ADODB.Connection"); $connstr = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=F:\Wellness Program\Copy of HR Employee Wellness Program.mdb;"; Make sure your syntax for these lines are correct.
-
I really dont see a problem here only thing i could say it is one of the 2 . 1. Your Server Integrity is bad (possible) or 2. User Error (MORE LIKELY) Have you yourself ever had the 404 problem recently?
-
The above makes no sense read it again to yourself lol
-
I say the delimiter is important it will allow you to read the access log better.
-
What function do i use for data encyrption and decryption ?
atlanta replied to jd2007's topic in PHP Coding Help
md5 http://us2.php.net/md5 or sha1 http://us2.php.net/manual/en/function.sha1.php -
the way he wrote the query is just the correct longer way of writing the sql query thats all
-
Access your control panel and copy and paste your error logs here.
-
Can PHP play a sound file on windows, localy?
atlanta replied to FoxboyJT's topic in PHP Coding Help
Yea i mean have the c# app from your computer read a log or have the php script send data to your pc which would in return trigger the c# app to play a sound -
http://www.phpfreaks.com/tutorials/43/0.php