Jump to content

inquisitive

Members
  • Posts

    48
  • Joined

  • Last visited

    Never

Everything posted by inquisitive

  1. Alright I am trying to to obviously upload my form into the database...here is my following code: <?php // plug globals include("db_connect.php"); include("config.php"); include("functions.php"); // turn on ad footer // 1=on 0=off $foot_ad=1; ?> <?php $db="mydb"; $link = mysql_connect("myserver", "mylogin", "mypass"); if (! $link) die("Our database is experiencing technical difficulties. Please contact our Webmaster"); else{ mysql_select_db($db , $link) or die("Select DB Error: ".mysql_error()); } $submit = $_POST["Submit"]; if ($submit == "Submit") { $submit = $_POST["Submit"]; $form1 = $_POST["textfield1"]; $form2 = $_POST["textfield2"]; $form3 = $_POST["textfield3"]; $form4 = $_POST["textfield4"]; $form5 = $_POST["textfield5"]; $form6 = $_POST["textfield6"]; $form7 = $_POST["textfield7"]; $form8 = $_POST["textfield8"]; $form9 = $_POST["textfield9"]; $form10 = $_POST["textfield10"]; $form11 = $_POST["textfield11"]; $form12 = $_POST["textfield12"]; $form13 = $_POST["textfield13"]; mysql_query ("INSERT INTO newsletter_signup ( company_name, address, city, state, zip, sales_email, production_email, office_email, service_email, phone, fax, questions, nrgca_member) values ('$form1','$form2','$form3','$form4','$form5','$form6','$form7','$form8','$form9','$form10','$form11','$form12','$form13')"); $to = "provost.design@gmail.com"; $from = "provost.design@gmail.com"; $subject = "Contact Request from - ".$_SERVER['HTTP_HOST']." by " .$form1." " .$form2; $message = "First Name: " .$form1 ."<br>" ."Last Name: " .$form2 ."<br>" ."Address: " .$form3 ."<br>" ."City: " .$form4 ."<br>" ."State: " .$form5 ."<br>Zipcode: " .$form6 ."<br>Home Phone: " .$form7 ."<br>Alternate Phone: " .$form8 ."<br>Best Time to Call: " .$form9 ."<br>Email: " .$form10 ."<br>Type of Project: " .$form11 ."<br>Type of Gutter: " .$form12 ."<br>Do you Need financing?: " .$form13; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: $from"; mail($to,$subject,$message,$headers); ?> <META HTTP-EQUIV=Refresh CONTENT="0; URL=newsletter-signup2.php"> <? } ?>
  2. yeah gonna need more than an explaination here...maybe some code for example...im new to this thing
  3. HI I am looking to create a cron job that executes multiple queries or runs multiple jobs if you will...And please do not suggest crontabs because my server does not allow shell access....I can only create individual cron jobs...there has to be an easier way...
  4. So just this one line of code does it? DELETE FROM entry_table WHERE entry_date < CURDATE() - INTERVAL 2 WEEK;
  5. Alright here is what I am trying to do I have a website where users login and submit items for sale... I approve them and then their item goes into a list on the index.php page of items for sale... Now I was stupid and didn't program a way to delete them and there are tons of entries now... In order to remedy this situation I would like to program a script that eliminates the entries in the database after they have been in the database for 2 weeks...anyone have any idea how to do this????
  6. what is there to understand... Basically it is setup like Amway and every other sales company out there...The dealers sign up distributers and because they signed that specific distributer up the overall company gives the dealer a commission based on the orders that the distributer makes...I was just wondering if there was a system out there already that handled commission payments...or if you could suggest a way of attacking this with a few examples of code just to get me on my way... My theory is to create a unique id which is assigned to each individual that creates an account on the site.... from there I just hit a wall...any help would be awesome
  7. the entire thing...but mainly setting it up so that everytime a user signs in the system recognizes them and someones dealer and when they make the purchase automatically assign the comission to the distributer.
  8. Alright here is my dilemma...I am trying to create an e-commerce system that allow the following: Three types of logins 2 types are dealers 1 type is a distributer Now when distributers login they order and a certain percentage of their orders go to their specific dealer...I am not sure how to tie this together...I would have to either have each dealer made create a table and in that table all the dsitributers that they signed up...or create a number that is assigned to the distributer and every time that number makes a purchase then the specified percentage of their order goes to the dealer... I am just at a loss...
  9. this use to work...then it just crashed....how would i make it then so it retrieves all data..instead of just a single record...
  10. Why don't you think my result variable is storing anything...?
  11. The number 2 comes up on my page...when the ehco is put in
  12. thats the thing...it returns one result...and then errors...its sooo strange
  13. Here is the error; Warning: mysql_fetch_array(): 7 is not a valid MySQL...and the line is that errors is the while statement at the end... The following is the code: <?php if(isset($_POST['mysubmit'])) switch($_POST['type_account']) { case "pr_specialist": $type = "PRSpecialist"; break; case "contractors": $type = "Contractor"; break; case "students": $type = "Student"; break; case "admin": $type = "admin"; break; /* more */ } $query = "SELECT * FROM users WHERE pending = 0 AND type = '$type'"; $result = mysql_query($query) or die(mysql_error()); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { /* parse rows */ ?>
  14. This is the error that my code is returning...it doesn't like this statement: (statement inside the asteriks) ****while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {******* Warning: mysql_fetch_array(): 7 is not a valid MySQL result resource in /home/content/c/a/l/calvinsolar/html/admin/accounts.php on line 60
  15. doesnt really work at all... I'm working with a list to select the account type that I want to view...and this code just ties this select button with the database to display the info I am looking for...the switch and case statement didn't seem to work very well....not sure why...but this method was working before...it worked for about 5presses of the submit button then it just crashed...
  16. I didn't see where you declared the type variable....
  17. Here is the code... for some reason it is erroring and here is the error: Warning: mysql_fetch_array(): 4 is not a valid MySQL result resource in /home/content/c/a/l/calvinsolar/html/admin/accounts.php on line 65 The error is for the WHILE STATEMENT...any help would be awesome <?php { if(isset($_POST['mysubmit'])) if($_POST['type_account'] == 'pr_specialist') {$query = 'SELECT * FROM users WHERE pending = 0'; $query = ' SELECT * From users Where type = "PRSpecialist"'; $result = mysql_query($query) or die(mysql_error());} elseif($_POST['type_account'] == 'students') {$query = 'SELECT * FROM users WHERE pending = 0'; $query = ' SELECT * From users Where type = "Student"'; $result = mysql_query($query) or die(mysql_error());} elseif($_POST['type_account'] == 'contractors') {$query = 'SELECT * FROM users WHERE pending = 0'; $query = ' SELECT * From users Where type = "Contractor"'; $result = mysql_query($query) or die(mysql_error());} elseif($_POST['type_account'] == 'none') {$query = 'SELECT * FROM users WHERE pending = 0'; $query = ' SELECT * From users Where type = "PRSpecialist"'; $result = mysql_query($query) or die(mysql_error());} } while ($line = mysql_fetch_arrayphp($result, MYSQL_ASSOC)) { ?>
  18. My website has stopped working...not sure why...error in this file somewhere <? include 'lnglat.php'; include 'conn.php'; $startrow = $_GET['row']; ?><br><? $query = "SELECT * FROM testimonials WHERE lat BETWEEN ".$rlat." AND ".$llat." AND lng BETWEEN ".$llng." AND ".$rlng." LIMIT ".$startrow.", 9"; ?> <html xmlns:v="urn:schemas-microsoft-com:vml"> <head> <title>My GMapEZ Maps</title> <meta name="gmapkey" content="ABQIAAAAHK9B1odMblO_RDGYp68fVBQph564W_sfd6LeiVJWuMclzaD6KBRQKiQJdlASrx4wj5V8HWxb2QuhlQ" /> <script src="http://n01se.net/gmapez/gmapez-2.js" type="text/javascript"></script> </head> <body> <div class="GMapEZ G_MAP_TYPE GLargeMapControl GMapTypeControl GOverviewMapControl" style="width: 388px; height: 300px;"> <a href="http://maps.google.com/maps?ll=<? echo $_GET['lat']; ?>,<? echo $_GET['lng'];?>&spn=0.006130,0.009795&t=k&hl=en">GREEN START</a><div><b>You Are Here!</b><br>Your Longitude is: <? echo $_GET['lng'];?><br> Your Latitude is: <? echo $_GET['lat'];?></div> <? $result = mysql_query($query, $link) or die("Data not found."); for($x = 0 ; $x < mysql_num_rows($result) ; $x++){ $row = mysql_fetch_assoc($result); if ($row['lat'] == 0.000000) {}else{ ?><a href="http://maps.google.com/maps?ll=<? echo ($row['lat']); ?>,<? echo ($row['lng']);?>&spn=0.006130,0.009795&t=k&hl=en"><? echo $x + 1;?></a> <div> <? if (!empty($row['quote'])){echo '"'.$row['quote'].'"';} ?> <? if (!empty($row['firstname'])){echo $row['firstname']."<br>";} ?> <? if (!empty($row['lastname'])){echo $row['lastname']."<br>";} ?> <? if (!empty($row['address'])){echo $row['address']."<br>";} ?> <? if (!empty($row['city'])){echo $row['city'].",";} ?> <? if (!empty($row['state'])){echo $row['state'];} ?> <? if (!empty($row['zip'])){echo $row['zip'];} ?> </div><? } // empty lat ?> <? } //end for loop ?> </div> <!-- Start of StatCounter Code --> <script type="text/javascript"> sc_project=2219825; sc_invisible=1; sc_partition=20; sc_security="d20cf4ff"; </script> <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><div class="statcounter"><a href="http://www.statcounter.com/free_hit_counter.html" target="_blank"><img class="statcounter" src="http://c21.statcounter.com/2219825/0/d20cf4ff/1/" alt="counter hit make" ></a></div></noscript> <!-- End of StatCounter Code --> </body> </html>
  19. I have a form on my website that generates quotes for a service I provide. Now I have a google adwords account...and I want to track all the leads generated from my form that were visitors from clicks that I paid for through adwords...Does anyone know how to do this? I can track people from different URLs, but this is a new beast. Please be specific with any answers... thanks
  20. I corrected the above errors and I am getting a T_String error on line 53. I am not sure what this means...because my code looks pretty damn good. anyways...any more help out there?
  21. <?php // Pick up the form data and assign it to variables $name= $_Post['name']; $email= $_Post['email']; $topic= $_Post['topic']; $comments= $_Post['comments']; //Build the email (replace the address is the $to section with your own) $to = 'provost.design@gmail.com'; $subject = "New Message: $topic"; $message = "$name said: $comments"; $headers = "From: $email"; //Send the mail using PHPs mail () Function mail($to, $subject, $message, $headers); //Redirect header("location: success.html"); $sql = CREATE TABLE submissions( name VARCHAR(100) NOT NULL, email VARCHAR(255) NOT NULL, topic VARCHAR(255) NOT NULL, comments TEXT NOT NULL ); mysql_query( $sql, $conn ); //Open database connection $conn = mysql_connect('localhost', 'hp_admin', 'portable'); mysql_select_db('contact'); //Insert data $query = "INSERT INTO submissions (name, email, topic, comments) VALUES ('$name', '$email', '$topic', '$comments',)"; mysql_query($query); //close connection mysql_close($conn); //Ioen database connection $conn = mysql_connect('localhost','hp_admin','portable'); //Data cleaning function function clean_data($string) { if (get_magic_quotes_gpc() ) { $string = stripslashes($string); } return mysql_real_escape_string($string); } //Pick up the cleaned for data $name= clean_data($_Post['name']); $email= clean data($_Post['email']); $topic= clean_data($_Post['topic']); $comments= clean_data($_Post['comments']); //Data cleaning function function clean_data($string) { if (get_magic_quotes_gpc()) { $string = stripslashes($string); } $string = strip_tags($string); return mysql_real_escape_string($string); } //Mail header removal function remove_header($string) { $headers = array( "/to\:/i", "/from\:/i", "/bcc\:/i", "/cc\:/i", "/Content\-Transfer\-Encoding\:/i", "/Content\-Type\:/i", "/Mime\-Version\:/i" ); retufn preg_replace($headers, '', $string); } function remove_headers($string) { $headers = array( "/to\:/i", "/from\:/i", "/bcc\:/i", "/cc\:/i", "/Content\-Transfer\-Encoding\:/i", "/Content\-Type\:/i", "/Mime\-Version\:/i" ); if (preg_replace($headers, '', $string) == $string) { return $string; } else { die('You think Im spammy? Spammy how? Spammy like a clown, spammy?'); } } //Mail header removal function remove_headers($string) { $headers == array( "/to\:/i", "/from\:/i", "/bcc\:/i", "/cc\:/i", "/Content\-Transfer\-Encoding\:/i", "/Content\-Type\:/i", "/Mime\-Version\:/i" ); $string = preg_replace($headers, '',string); return strip_tags($string); } //Pick up the cleaned form data $name= remove_headers($_Post['name']); $email= remove_headers($_Post['email']); $topic= remove_headers($_Post['topic']); $comments= remove_headers($_Post['comments']);
×
×
  • 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.