Jump to content

quickfire84

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

quickfire84's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, I wrote a code for using custom fields to display images, and im using it to display thumbnails so i have the code grab it and send it threw the TimThumb php image resizing script to make the image smaller for the front page, everything works except the TimThumb, it doesn't work for me. this is the code to grab the img url from the custom field: <?php query_posts('category_name=blog&showposts=5'); if(have_posts()) : while(have_posts()) : the_post(); // check for thumbnail $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); // check for thumbnail class $thumb_class = get_post_meta($post->ID, 'Thumbnail Class', $single = true); // check for thumbnail alt text $thumb_alt = get_post_meta($post->ID, 'Thumbnail Alt', $single = true); ?> <div class="blogArea" id="post-<?php the_ID(); ?>"> <div id="blogThumb"> <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php echo $thumb; ?>&w=100&h=65&zc=1&q=100" alt="<?php the_title(); ?>" class="left" width="100px" height="65px" /> </div> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="date"><?php the_time('M d, Y') ?> <!-- by <?php the_author() ?> --></div> <?php the_content('Read moreĀ»'); ?> </div> <?php endwhile; ?> This is the little bit of code that takes the image url from the custom field and puts it into the timthumb script <?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php echo $thumb; ?>&w=100&h=65&zc=1&q=100" alt="<?php the_title(); ?>" class="left" width="100px" height="65px" /> and as you can see here http://cardarello.com the images never show up But in this theme from Elegant Themes uses the same type of custom field coding and put it threw the timthumb and works fine.. http://www.elegantthemes.com/preview/Influx/
  2. Ok this might be a stupid question, but i was told tables are out dated way to make web layouts and DIVs are what you should be using today, so i was wondering, if i have like a php news system or any other php for that matter, can i put that php include code in my main content DIV if its floating or not? Like i have divs for my header and nav, then have main content with two floating divs one for my main content on left and a skin right floating div so could i put the php code in it, and will it still load normal? one more question no php related is there a way to fix the hieght of a DIV and if the content inside is longer then it it will be able to scroll?? Thank you.
  3. Ok, i have a couple of forms there is one main for and several secondary forms and each form post data into different tables in my one DB once they submit the main form they are given a ID, i am trying to figure out a way i can pull all the data from each table assocated, with a ID?????
  4. Ok now with php how would i pull data from several tables by the ID. main table has a ID set primary key all other tables have the cutomerID as foreign keys set to the ID, so if i wanted to pull data from every table by the ID how would i do so using php???
  5. Ok, i figured out how to post data in my DB and email it to me and submitter it works, but i get a error.. also some of the stuff like phone, anythingelse and idealcustomer does not submit... ?? <?php // Pick up the form data and assign it to variables $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $companyname = $_POST['companyname']; $idealcustomer = $_POST['idealcustomer']; $productservices = $_POST['productservices']; $maincompet = $_POST['maincompet']; $differcompet = $_POST['differcompet']; $needdone = $_POST['needdone']; $lookingfor = $_POST['lookingfor']; $doneby = $_POST['doneby']; $anythingelse = $_POST['anythingelse']; // Validation if($name == '') { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid Name</font></p>"); } if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email)) { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>"); } if($companyname == '') { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid Company name</font></p>"); } //MySQL DATA INSERT TAGS START HERE $con = mysql_connect("localhost","moppiei1_chris1","zxcv2470"); //Replace with your actual MySQL DB Username and Password if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("moppiei1_customers", $con); //Replace with your MySQL DB Name $name=mysql_real_escape_string($_POST['name']); //This value has to be the same as in the HTML form file $email=mysql_real_escape_string($_POST['email']);//This value has to be the same as in the HTML form file $phone=mysql_real_escape_string($_POST['phone']); $companyname=mysql_real_escape_string($_POST['companyname']); $idealcustomer=mysql_real_escape_string($_POST['idealcustomer']); $productservices=mysql_real_escape_string($_POST['productservices']); $maincompet=mysql_real_escape_string($_POST['maincompet']); $differcompet=mysql_real_escape_string($_POST['differcompet']); $needdone=mysql_real_escape_string($_POST['needdone']); $lookingfor=mysql_real_escape_string($_POST['lookingfor']); $doneby=mysql_real_escape_string($_POST['doneby']); $anythingelse=mysql_real_escape_string($_POST['anythingelse']); $sql="INSERT INTO quote (name,email,phone,companyname,idealcustomer,productservices,maincompet,differcompet,needdone,lookingfor,doneby,anythingelse) VALUES ('$name','$email','$phone','$companyname','$idealcustomer','$productservices','$maincompet','$differcompet','$needdone','$lookingfor','$doneby','$anythignelse')"; /*form_data is the name of the MySQL table where the form data will be saved.*/ if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "The form data was successfully added to your database."; mysql_close($con); //MySQL DATA INSERT TAGS END HERE // Build the email (replace the address in the $to section with your own) $to = 'webmaster@moppieillusions.com'; $subject = "Quote Submittion"; $message = "Name: $name, \n Email: $email, \n Phone Number: $phone, \n Comapny Name: $companyname, \n Ideal Customer: $idealcustomer, \n Product or Services: $productservices, \n Main Competition: $maincompet, \n How You Differ From Competition: $differcompet, \n Services Needed: $needdone, \n Looking For: $lookingfor, \n Need Done By: $doneby, \n Anything Else: $anythingelse"; $headers = "From: $email"; // Send the mail using PHPs mail() function mail($to, $subject, $message, $headers); //Sending auto respond Email to visitor $header = "From: webmaster@moppieillusions.com" . "Reply-To: webmaster@moppieillusions.com"; $subject = "Confirmation of quote enquiry to moppie.illusions"; $to = "$email"; $message = "Thank You $n for choosing moppie.illusions, Your quote enquiry will be processed immediately \n \n \n Sincerely, \n Chris Cardarello \n Webmaster \n moppie.illusions "; // Send the mail using PHPs mail() function mail($to, $subject, $message, $headers); // Redirect header("Location: success.html"); ?> How can i get it to still goto my redirect also this is error i get The form data was successfully added to your database. Warning: Cannot modify header information - headers already sent by (output started at /home/moppiei1/public something about line 90..
  6. Ok, I have several forms, but before they can fil out any of them they gotta fill out this first one, i have a database set up with tables a table for each form. I wanna know how i can make the forms post into the tables i need them too, like this form i need it to post in my customers DB in the quotes TABLE how do i do this? I have html form the post and send info to this which then send me a email and them a email i wanna do that but also post in DB into the table..? <?php // Pick up the form data and assign it to variables $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $companyname = $_POST['companyname']; $idealcustomer = $_POST['idealcustomer']; $productservices = $_POST['productservices']; $maincompet = $_POST['maincompet']; $differcompet = $_POST['differcompet']; $needdone = $_POST['needdone']; $lookingfor = $_POST['lookingfor']; $doneby = $_POST['doneby']; $anythingelse = $_POST['anythingelse']; // Validation if($name == '') { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid Name</font></p>"); } if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email)) { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>"); } if($companyname == '') { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid Company name</font></p>"); } // Build the email (replace the address in the $to section with your own) $to = 'webmaster@moppieillusions.com'; $subject = "Quote Submittion"; $message = "Name: $name, \n Email: $email, \n Phone Number: $phone, \n Comapny Name: $companyname, \n Ideal Customer: $idealcustomer, \n Product or Services: $productservices, \n Main Competition: $maincompet, \n How You Differ From Competition: $differcompet, \n Services Needed: $needdone, \n Looking For: $lookingfor, \n Need Done By: $doneby, \n Anything Else: $anythingelse"; $headers = "From: $email"; // Send the mail using PHPs mail() function mail($to, $subject, $message, $headers); //Sending auto respond Email to visitor $header = "From: webmaster@moppieillusions.com" . "Reply-To: webmaster@moppieillusions.com"; $subject = "Confirmation of quote enquiry to moppie.illusions"; $to = "$email"; $message = "Thank You $n for choosing moppie.illusions, Your quote enquiry will be processed immediately \n \n \n Sincerely, \n Chris Cardarello \n Webmaster \n moppie.illusions "; // Send the mail using PHPs mail() function mail($to, $subject, $message, $headers); // Redirect header("Location: success.html"); ?>
  7. Ok, I have several forms, but before they can fil out any of them they gotta fill out this first one, i have a database set up with tables a table for each form. I wanna know how i can make the forms post into the tables i need them too, like this form i need it to post in my customers DB in the quotes TABLE how do i do this? I have html form the post and send info to this which then send me a email and them a email i wanna do that but also post in DB into the table..? <?php // Pick up the form data and assign it to variables $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $companyname = $_POST['companyname']; $idealcustomer = $_POST['idealcustomer']; $productservices = $_POST['productservices']; $maincompet = $_POST['maincompet']; $differcompet = $_POST['differcompet']; $needdone = $_POST['needdone']; $lookingfor = $_POST['lookingfor']; $doneby = $_POST['doneby']; $anythingelse = $_POST['anythingelse']; // Validation if($name == '') { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid Name</font></p>"); } if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email)) { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>"); } if($companyname == '') { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid Company name</font></p>"); } // Build the email (replace the address in the $to section with your own) $to = 'webmaster@moppieillusions.com'; $subject = "Quote Submittion"; $message = "Name: $name, \n Email: $email, \n Phone Number: $phone, \n Comapny Name: $companyname, \n Ideal Customer: $idealcustomer, \n Product or Services: $productservices, \n Main Competition: $maincompet, \n How You Differ From Competition: $differcompet, \n Services Needed: $needdone, \n Looking For: $lookingfor, \n Need Done By: $doneby, \n Anything Else: $anythingelse"; $headers = "From: $email"; // Send the mail using PHPs mail() function mail($to, $subject, $message, $headers); //Sending auto respond Email to visitor $header = "From: webmaster@moppieillusions.com" . "Reply-To: webmaster@moppieillusions.com"; $subject = "Confirmation of quote enquiry to moppie.illusions"; $to = "$email"; $message = "Thank You $n for choosing moppie.illusions, Your quote enquiry will be processed immediately \n \n \n Sincerely, \n Chris Cardarello \n Webmaster \n moppie.illusions "; // Send the mail using PHPs mail() function mail($to, $subject, $message, $headers); // Redirect header("Location: success.html"); ?>
  8. Ok i have several forms for my customers, right now they just send me a email and them a auto respones, what i wanna do is when they fill out the first form it sends their names and all the submit info into a db table and assigns it a customer id which is included in the auto respone, then when they fill out one of the secondary forms either it either has a spot in form to enter customer id number or matches their whole name up with the existing number but adds to a different table, and make a page that lets me view a customer id and pulls all the data that matchs the id from each table and can assign a status NEW, IN PROGRESS, or COMPLETED if this is possible? can someone help me on how to do this??
  9. ok just one question if i make the id in the table can i make it customerid or customer_id then make it the primary_key or does it have to be just id?
  10. Umm where ever is the best place, my form is already made one of them just not to post into a db, so where would be good to start, since im quite new to db's
  11. Im trying to make php forms that instert customers orders into a database each form with its own table but when they submit the first form, they are assigned a customer id number, when they come back to fill out other form they enter their id number and when submit it it enter it into the table and so i can pull each customer id up a review what they need and set there order status NEW, IN PROGRESS, or COMPLETED, i amy ok with php right now my first form sends me the submitted results and a auto respons to the customer. Can anyone Help me a little on how to do this??
  12. Thank You.!! I Also have been think of trying to make a database for customers they fill out the quote form and its post there info and asigns them a customer id number, then when they filll out the complete job detail form and post into either same or another db and links and a way i could pull up customer by customer and change status of there job order from new to in progress to completed.. it would take alot to do that correct?? I am new to php but i am a pretty fast learn i been reading the sams book on php and mysql But and Thank You so much will be much eaier to read. lol
  13. Ok when the form is submitted it goto a php page emailform.php which send a auto reply to the submitter and the result to one of my emails but its hard to read cause it all on one line is there anyway to make like a line break after each value here is the code $to = 'webmaster@moppieillusions.com'; $subject = "Quote Submittion"; $message = "name: $name, email: $email, phone: $phone, comapny name: $companyname, Ideal Customer: $idealcustomer, Product or Services: $productservices, Main Competition: $maincompet, How You Differ From Competition: $differcompet, Services Needed: $needdone, Looking For: $lookingfor, Need Done By: $doneby, Anything Else: $anythingelse"; $headers = "From: $email"; Also is there anyway that i can but some security on the form and maybe something to stop spaming like one of those enter these letters Thank you.
×
×
  • 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.