Jump to content

jbwebdesign

Member
  • Posts

    167
  • Joined

  • Last visited

Everything posted by jbwebdesign

  1. so krillz how would you hijack the form and send out spam?....this is good, i am not the best programmer but i always like to learn new things
  2. lang=EN-US link=blue vlink=purple style='tab-interval:.5in'> src="custom_invitations_files/image006.jpg" v:shapes="_x0000_i2068"> style='font-family:Verdana;color:#009999'>A Wedding Invitation Investigation! style='font-size:10.0pt;font-family:Verdana'>Fill in the form as detailed as possible. It’s worth it I promise. Every little question is designed so that I can find out as much as possible about your big event, what you REALLY want in your invitations and your (yes, the two of you, don’t surprise him ) style preferences! style='font-size:10.0pt;font-family:Verdana;color:#009999'>Our Special Day Information: style='font-size:10.0pt;font-family:Verdana'>Our wedding will be held in /and style='font-size:10.0pt;font-family:Verdana'>It will be held on this date style='font-size:10.0pt;font-family:Verdana'>The wedding will have # of parts. (ceremony, reception, tea-ceremony, etc). They are style='font-size:10.0pt;font-family:Verdana'>Our wedding would be ( class=GramE>indoor/outdoor?) style='font-size:10.0pt;font-family:Verdana'>We want our wedding to be Traditional Dinner Banquet Garden Cocktails Fancy Dress Casual Country City/Urban Vintage Beach Destination Themed/Others style='font-size:10.0pt;font-family:Verdana'>We are inviting # of guests, we would like to send invitations class=GramE>tostyle='font-size:10.0pt;font-family:Verdana'> #of guests style='font-size:10.0pt;font-family:Verdana'>We want our invitations to be: Traditional Formal and Classy Casual Edgy/Cool Unique and Alternative Natural and Rustic style='font-size:10.0pt;font-family:Verdana'>We want to send them out by this date . style='font-size:10.0pt;font-family:Verdana'>We are interested in save-the-dates or RSVPs. Yes No style='font-size:10.0pt;font-family:Verdana'>What information do you absolutely must have on your invitation? style='font-size:10.0pt;font-family:Verdana'> style='font-size:10.0pt;font-family:Verdana'>What standard information do you want on your information? style='font-size:10.0pt;font-family:Verdana'> style='font-size:10.0pt;font-family:Verdana;color:#009999'>The Story of Us: style='text-decoration:none'> style='font-size:10.0pt;font-family:Verdana'>My favorite colors are style='mso-spacerun:yes'> and style='mso-spacerun:yes'> while he likes style='mso-spacerun:yes'> and . style='font-size:10.0pt;font-family:Verdana'>This is the story we TELL others about how we met: style='font-size:10.0pt;font-family:Verdana'>I grew up in , he grew up in style='font-size:10.0pt;font-family:Verdana'>The awesomest part of our relationship that we want reflected in our invitations is that style='font-size:10.0pt;font-family:Verdana;color:#009999'>Style and Fun style='font-size:10.0pt;font-family:Verdana'>We like these types of music (pick 3) Blues Rock and Roll (70s) Rock and Roll (60s) Big Band Heavy Metal 80’s Music Oldies/Folk/Country Musicals/Broadway Classical Alternative World Music Others style='font-size:10.0pt;font-family:Verdana'>My favorite city in the whole wide world is style='mso-spacerun:yes'> his favorite city in the whole wide world is . style='font-size:10.0pt;font-family:Verdana'> style='mso-spacerun:yes'> Our favorite activity together class=GramE>is . style='font-size:10.0pt;font-family:Verdana'>Finish this sentence (check all that applies) : I am a ______kind of girl: Cotton Linen Lace Silk Chiffon Burlap Muslin Hi-tech/synthetic fabrics Wool knits Cashmere Velvet Brocade style='font-size:10.0pt;font-family:Verdana'>Finish this sentence (check all that applies) : I/we prefer ___________ Japanese washi papers Handmade paper Vintage aged papers Tissue-thin paper Flecked recycled paper Textured paper Refined thick cotton rag paper Any tree-free papers Standard cardstock style='font-size:10.0pt;font-family:Verdana'>Finish this sentence (pick 3): We are definitely into _______ : Polished wood Vintage, antique or reclaimed wood Wood Veneer Brushed metal Hi-shine metal Gold Silver Copper Plastic Anything in the natural world only! style='font-size:10.0pt;font-family:Verdana'>We MOST like these movies (pick 3): Classic Film Noir Silent Movies Musicals/Broadway Fantasy/Sci-Fi Period Dramas 80’s Teen Movies Zombie Movies Horror Flicks Romantic Comedies Edgy Psychological Thrillers Martial Arts Films Foreign Art House Cult/Alternative Movies Sweeping Epics Others style='font-size:10.0pt;font-family:Verdana'>Which invitation type from the link below do you most like? (important: make sure to copy and paste link in new window) www.etsy.com/shop/treespacestudio enctype="application/x-www-form-urlencoded"> style='font-size:10.0pt;font-family:Verdana'> style='font-size:10.0pt;font-family:Verdana'> style='font-size:10.0pt;font-family:Verdana'>src="custom_invitations_files/image009.jpg" v:shapes="_x0000_i2071"> The class=SpellE>TreeSpace Studio Personalized {Functional} Artwork and Design Solutions For Your Creative, Business and Everyday Needs style='font-size:10.0pt;font-family:Verdana'>1-818-574-6942 style='font-size:10.0pt;font-family:Verdana'>href="mailto:info@treespacestudio.com">info@treespacestudio.com style='font-size:10.0pt;font-family:Verdana'>href="http://www.treespacestudio.com/">http://www.treespacestudio.com style='font-size:10.0pt;font-family:Verdana'>href="http://www.treespacestudio.com/blog">http://www.treespacestudio.com/blog style='font-size:10.0pt;font-family:Verdana'>
  3. you can see the page here: http://www.textmonster.org/temp
  4. I haven't tested this out yet, but this is very very cool! Thanks for the info!
  5. hey, i tried to combine the css just like you said and it still doesn't work. hmm.... i wonder why.... here is the new code /* CSS Document */ body{ background-color:#f0eff0; margin:0; padding:0; width:1150px; height:1420px; border:none; } #header{ background: url(images/header.jpg) repeat-x; width:100%; height:150px; } #nav{ background: url(images/navbar.jpg) repeat-x; height:58px; width:100%; } #main{ background: url(images/main.jpg) repeat-x; width:100%; height:1121px; } #container{ margin-left:100px; width:1050px; border:double 1px; border-bottom:none; border-top:none; } #content{ margin-left:225px; width:575px; } #footer{ background: url(images/footer.jpg) repeat-x; height:91px; width:100%; padding:25px; } .copyright{ font-family:Georgia, "Times New Roman", Times, serif; font-size:12px; font-weight:bold; }
  6. Hey everyone, I am working on some css code and I can't seem to get the background to repeat-x on mozilla but it works fine on IE. I'm not sure what i am doing wrong, please help. Here is my code: /* CSS Document */ body{ background-color:#f0eff0; margin:0; padding:0; width:1150px; height:1420px; border:none; } #header{ background-image:url(images/header.jpg); background-repeat:repeat-x; width:100%; height:150px; } #nav{ background-image:url(images/navbar.jpg); background-repeat:repeat-x; height:58px; width:100%; } #main{ background-image:url(images/main.jpg); background-repeat:repeat-x; width:100%; height:1121px; } #container{ margin-left:100px; width:1050px; border:double 1px; border-bottom:none; border-top:none; } #content{ margin-left:225px; width:575px; } #footer{ background-image:url(images/footer.jpg); background-repeat:repeat-x; height:91px; width:100%; padding:25px; } .copyright{ font-family:Georgia, "Times New Roman", Times, serif; font-size:12px; font-weight:bold; text-shadow:#999999; }
  7. I found a different opensource database class file that allows me to insert, update, and delete records. i'm not sure what my error is but i am using this new class that i found and it works fine. here is the class: <?php # Name: Database.class.php # File Description: MySQL Class to allow easy and clean access to common mysql commands # Author: ricocheting # Web: http://www.ricocheting.com/ # Update: 2009-12-17 # Version: 2.2.2 # Copyright 2003 ricocheting.com /* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ //require("config.inc.php"); //$db = new Database(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE); ################################################################################################### ################################################################################################### ################################################################################################### class Database { var $server = ""; //database server var $user = ""; //database login name var $pass = ""; //database login password var $database = ""; //database name var $pre = ""; //table prefix ####################### //internal info var $error = ""; var $errno = 0; //number of rows affected by SQL query var $affected_rows = 0; var $link_id = 0; var $query_id = 0; #-############################################# # desc: constructor function Database($server, $user, $pass, $database, $pre=''){ $this->server=$server; $this->user=$user; $this->pass=$pass; $this->database=$database; $this->pre=$pre; }#-#constructor() #-############################################# # desc: connect and select database using vars above # Param: $new_link can force connect() to open a new link, even if mysql_connect() was called before with the same parameters function connect($new_link=false) { $this->link_id=@mysql_connect($this->server,$this->user,$this->pass,$new_link); if (!$this->link_id) {//open failed $this->oops("Could not connect to server: <b>$this->server</b>."); } if(!@mysql_select_db($this->database, $this->link_id)) {//no database $this->oops("Could not open database: <b>$this->database</b>."); } // unset the data so it can't be dumped $this->server=''; $this->user=''; $this->pass=''; $this->database=''; }#-#connect() #-############################################# # desc: close the connection function close() { if(!@mysql_close($this->link_id)){ $this->oops("Connection close failed."); } }#-#close() #-############################################# # Desc: escapes characters to be mysql ready # Param: string # returns: string function escape($string) { if(get_magic_quotes_runtime()) $string = stripslashes($string); return @mysql_real_escape_string($string,$this->link_id); }#-#escape() #-############################################# # Desc: executes SQL query to an open connection # Param: (MySQL query) to execute # returns: (query_id) for fetching results etc function query($sql) { // do query $this->query_id = @mysql_query($sql, $this->link_id); if (!$this->query_id) { $this->oops("<b>MySQL Query fail:</b> $sql"); return 0; } $this->affected_rows = @mysql_affected_rows($this->link_id); return $this->query_id; }#-#query() #-############################################# # desc: fetches and returns results one line at a time # param: query_id for mysql run. if none specified, last used # return: (array) fetched record(s) function fetch_array($query_id=-1) { // retrieve row if ($query_id!=-1) { $this->query_id=$query_id; } if (isset($this->query_id)) { $record = @mysql_fetch_assoc($this->query_id); }else{ $this->oops("Invalid query_id: <b>$this->query_id</b>. Records could not be fetched."); } return $record; }#-#fetch_array() #-############################################# # desc: returns all the results (not one row) # param: (MySQL query) the query to run on server # returns: assoc array of ALL fetched results function fetch_all_array($sql) { $query_id = $this->query($sql); $out = array(); while ($row = $this->fetch_array($query_id, $sql)){ $out[] = $row; } $this->free_result($query_id); return $out; }#-#fetch_all_array() #-############################################# # desc: frees the resultset # param: query_id for mysql run. if none specified, last used function free_result($query_id=-1) { if ($query_id!=-1) { $this->query_id=$query_id; } if($this->query_id!=0 && !@mysql_free_result($this->query_id)) { $this->oops("Result ID: <b>$this->query_id</b> could not be freed."); } }#-#free_result() #-############################################# # desc: does a query, fetches the first row only, frees resultset # param: (MySQL query) the query to run on server # returns: array of fetched results function query_first($query_string) { $query_id = $this->query($query_string); $out = $this->fetch_array($query_id); $this->free_result($query_id); return $out; }#-#query_first() #-############################################# # desc: does an update query with an array # param: table (no prefix), assoc array with data (doesn't need escaped), where condition # returns: (query_id) for fetching results etc function query_update($table, $data, $where='1') { $q="UPDATE `".$this->pre.$table."` SET "; foreach($data as $key=>$val) { if(strtolower($val)=='null') $q.= "`$key` = NULL, "; elseif(strtolower($val)=='now()') $q.= "`$key` = NOW(), "; else $q.= "`$key`='".$this->escape($val)."', "; } $q = rtrim($q, ', ') . ' WHERE '.$where.';'; return $this->query($q); }#-#query_update() #-############################################# # desc: does an insert query with an array # param: table (no prefix), assoc array with data # returns: id of inserted record, false if error function query_insert($table, $data) { $q="INSERT INTO `".$this->pre.$table."` "; $v=''; $n=''; foreach($data as $key=>$val) { $n.="`$key`, "; if(strtolower($val)=='null') $v.="NULL, "; elseif(strtolower($val)=='now()') $v.="NOW(), "; else $v.= "'".$this->escape($val)."', "; } $q .= "(". rtrim($n, ', ') .") VALUES (". rtrim($v, ', ') .");"; if($this->query($q)){ //$this->free_result(); return mysql_insert_id($this->link_id); } else return false; }#-#query_insert() #-############################################# # desc: throw an error message # param: [optional] any custom error to display function oops($msg='') { if($this->link_id>0){ $this->error=mysql_error($this->link_id); $this->errno=mysql_errno($this->link_id); } else{ $this->error=mysql_error(); $this->errno=mysql_errno(); } ?> <table align="center" border="1" cellspacing="0" style="background:white;color:black;width:80%;"> <tr><th colspan=2>Database Error</th></tr> <tr><td align="right" valign="top">Message:</td><td><?php echo $msg; ?></td></tr> <?php if(strlen($this->error)>0) echo '<tr><td align="right" valign="top" nowrap>MySQL Error:</td><td>'.$this->error.'</td></tr>'; ?> <tr><td align="right">Date:</td><td><?php echo date("l, F j, Y a\t g:i:s A"); ?></td></tr> <tr><td align="right">Script:</td><td><a href="<?php echo @$_SERVER['REQUEST_URI']; ?>"><?php echo @$_SERVER['REQUEST_URI']; ?></a></td></tr> <?php if(strlen(@$_SERVER['HTTP_REFERER'])>0) echo '<tr><td align="right">Referer:</td><td><a href="'.@$_SERVER['HTTP_REFERER'].'">'.@$_SERVER['HTTP_REFERER'].'</a></td></tr>'; ?> </table> <?php }#-#oops() }//CLASS Database ################################################################################################### ?> and here is the config.inc.php file <?php //database server define('DB_SERVER', "localhost"); //database login name define('DB_USER', "moneypok_school"); //database login password define('DB_PASS', "pass123"); //database name define('DB_DATABASE', "moneypok_school"); //smart to define your table names also define('TABLE_USERS', "users"); define('TABLE_SCHOOLS', "schools"); define('TABLE_CLASSES', "classes"); define('TABLE_POSTS', "posts"); define('TABLE_ADMIN_POST', "admin_posts"); ?>
  8. do you think the problem is because i am not inserting it as an array?
  9. i tryed it and i didn't get anything.... hmm it's still not inserting into the database. i don't seem to get any errors how ever. by the way, i have uploaded the .zip with the contracts to the business forums section
  10. Hey everyone, I have attached a zip file containing Web Design Contracts in a .doc format. the following is included in this zip file: Website Design Contract Website Maintenance Contract Website Building Worksheet Enjoy! :cool:
  11. i'm not sure what you mean by "try-catch block" but i do believe i understand the return piece of it from your OOP video tutorial. should i do it like this??: function newSchool(){ $sql = mysql_query("INSERT INTO schools (school, country, city, state, zip) VALUES (" . $this->school . ',' . $this->country . ',' . $this->city . ',' . $this->state . ',' . $this->zip . ")"); return $sql; }
  12. and stefan i was looking through your web design business section where you were talking about web design contracts and how they are necessary..... i found some useful contracts on the web that i would like to share with you. I'm not sure if you have posted the contracts online or not but i have the following: Website Preparation Worksheet Website design Contract Website Maintenance Contract and i will be more than happy to share them with killersites. I beleive you should put them somewehre where other designers can use the templates as well.
  13. this is my classlib.php <?php //------THIS FILE WILL CONTROL MY CMS SYSTEM class cms{ //----------------DEFINE MY VARIABLES FOR THIS CMS CLASS var $db; var $host; var $username; var $password; var $current_time; var $id; var $c_id; var $school; var $country; var $city; var $state; var $zip; //-----------------END DEFINE VARIABLES FOR THIS CLASS---- function connect(){ $con = mysql_connect($this->host,$this->username,$this->password) or die("Could not connect to database"); $sel =mysql_select_db($this->db) or die("Could not select database"); } function post(){ $sql = "SELECT * FROM posts WHERE school_id = '".$this->id."' AND class_id = '" . $this->c_id . "' ORDER BY post_id DESC"; $res = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($res)){ echo '<h2 class="title"><a href="#">' . $row['post_title'] . '</a></h2>'; echo '<p class="meta">' . $row['post_time'] . ' <span>Posted by <a href="#">' . $row['username'] . '</a></span></p>'; echo '<div class="entry"> <p>'.$row['post_body'] . '</p>'; echo '</div>'; } } function adminPost(){ $sql = "SELECT * FROM admin_posts ORDER BY id DESC"; $res = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($res)){ echo '<h2 class="title"><a href="#">' . $row['post_title'] . '</a></h2>'; echo '<p class="meta">' . $this->current_time . ' <span>Posted by <a href="#">' . $row['post_by'] . '</a></span></p>'; echo '<div class="entry"> <p>' . $row['post_body'] . '</p>'; echo '</div>'; } } function newSchool(){ $sql = mysql_query("INSERT INTO schools (school, country, city, state, zip) VALUES (" . $this->school . ',' . $this->country . ',' . $this->city . ',' . $this->state . ',' . $this->zip . ")"); } function schoolList(){ $sql = "SELECT * FROM schools"; $res = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($res)){ echo '<div class="entry"> <p><a href="classes.php?school_id=' . $row['id'] . '">' . $row['school'] . '</a></p>'; echo '</div>'; } } function classList(){ $sql = "SELECT * FROM classes WHERE school_id = '".$this->id."' ORDER BY class_type DESC"; $res = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($res)){ echo '<div class="entry"> <p><a href="class_posts.php?school_id=' . $row['id'] . '&class_id=' . $row['class_id'] . '">' . $row['class_type'] . '</a> - With ' . $row['teacher'] . '</p>'; echo '</div>'; } } function country(){ echo '<select name="country"> <option value=" " selected>(please select a country)</option> <option value="--">none</option> <option value="AF">Afghanistan</option> <option value="AL">Albania</option> <option value="DZ">Algeria</option> <option value="AS">American Samoa</option> <option value="AD">Andorra</option> <option value="AO">Angola</option> <option value="AI">Anguilla</option> <option value="AQ">Antarctica</option> <option value="AG">Antigua and Barbuda</option> <option value="AR">Argentina</option> <option value="AM">Armenia</option> <option value="AW">Aruba</option> <option value="AU">Australia</option> <option value="AT">Austria</option> <option value="AZ">Azerbaijan</option> <option value="BS">Bahamas</option> <option value="BH">Bahrain</option> <option value="BD">Bangladesh</option> <option value="BB">Barbados</option> <option value="BY">Belarus</option> <option value="BE">Belgium</option> <option value="BZ">Belize</option> <option value="BJ">Benin</option> <option value="BM">Bermuda</option> <option value="BT">Bhutan</option> <option value="BO">Bolivia</option> <option value="BA">Bosnia and Herzegowina</option> <option value="BW">Botswana</option> <option value="BV">Bouvet Island</option> <option value="BR">Brazil</option> <option value="IO">British Indian Ocean Territory</option> <option value="BN">Brunei Darussalam</option> <option value="BG">Bulgaria</option> <option value="BF">Burkina Faso</option> <option value="BI">Burundi</option> <option value="KH">Cambodia</option> <option value="CM">Cameroon</option> <option value="CA">Canada</option> <option value="CV">Cape Verde</option> <option value="KY">Cayman Islands</option> <option value="CF">Central African Republic</option> <option value="TD">Chad</option> <option value="CL">Chile</option> <option value="CN">China</option> <option value="CX">Christmas Island</option> <option value="CC">Cocos (Keeling) Islands</option> <option value="CO">Colombia</option> <option value="KM">Comoros</option> <option value="CG">Congo</option> <option value="CD">Congo, the Democratic Republic of the</option> <option value="CK">Cook Islands</option> <option value="CR">Costa Rica</option> <option value="CI">Cote d'Ivoire</option> <option value="HR">Croatia (Hrvatska)</option> <option value="CU">Cuba</option> <option value="CY">Cyprus</option> <option value="CZ">Czech Republic</option> <option value="DK">Denmark</option> <option value="DJ">Djibouti</option> <option value="DM">Dominica</option> <option value="DO">Dominican Republic</option> <option value="TP">East Timor</option> <option value="EC">Ecuador</option> <option value="EG">Egypt</option> <option value="SV">El Salvador</option> <option value="GQ">Equatorial Guinea</option> <option value="ER">Eritrea</option> <option value="EE">Estonia</option> <option value="ET">Ethiopia</option> <option value="FK">Falkland Islands (Malvinas)</option> <option value="FO">Faroe Islands</option> <option value="FJ">Fiji</option> <option value="FI">Finland</option> <option value="FR">France</option> <option value="FX">France, Metropolitan</option> <option value="GF">French Guiana</option> <option value="PF">French Polynesia</option> <option value="TF">French Southern Territories</option> <option value="GA">Gabon</option> <option value="GM">Gambia</option> <option value="GE">Georgia</option> <option value="DE">Germany</option> <option value="GH">Ghana</option> <option value="GI">Gibraltar</option> <option value="GR">Greece</option> <option value="GL">Greenland</option> <option value="GD">Grenada</option> <option value="GP">Guadeloupe</option> <option value="GU">Guam</option> <option value="GT">Guatemala</option> <option value="GN">Guinea</option> <option value="GW">Guinea-Bissau</option> <option value="GY">Guyana</option> <option value="HT">Haiti</option> <option value="HM">Heard and Mc Donald Islands</option> <option value="VA">Holy See (Vatican City State)</option> <option value="HN">Honduras</option> <option value="HK">Hong Kong</option> <option value="HU">Hungary</option> <option value="IS">Iceland</option> <option value="IN">India</option> <option value="ID">Indonesia</option> <option value="IR">Iran (Islamic Republic of)</option> <option value="IQ">Iraq</option> <option value="IE">Ireland</option> <option value="IL">Israel</option> <option value="IT">Italy</option> <option value="JM">Jamaica</option> <option value="JP">Japan</option> <option value="JO">Jordan</option> <option value="KZ">Kazakhstan</option> <option value="KE">Kenya</option> <option value="KI">Kiribati</option> <option value="KP">Korea, Democratic People's Republic of</option> <option value="KR">Korea, Republic of</option> <option value="KW">Kuwait</option> <option value="KG">Kyrgyzstan</option> <option value="LA">Lao People's Democratic Republic</option> <option value="LV">Latvia</option> <option value="LB">Lebanon</option> <option value="LS">Lesotho</option> <option value="LR">Liberia</option> <option value="LY">Libyan Arab Jamahiriya</option> <option value="LI">Liechtenstein</option> <option value="LT">Lithuania</option> <option value="LU">Luxembourg</option> <option value="MO">Macau</option> <option value="MK">Macedonia, The Former Yugoslav Republic of</option> <option value="MG">Madagascar</option> <option value="MW">Malawi</option> <option value="MY">Malaysia</option> <option value="MV">Maldives</option> <option value="ML">Mali</option> <option value="MT">Malta</option> <option value="MH">Marshall Islands</option> <option value="MQ">Martinique</option> <option value="MR">Mauritania</option> <option value="MU">Mauritius</option> <option value="YT">Mayotte</option> <option value="MX">Mexico</option> <option value="FM">Micronesia, Federated States of</option> <option value="MD">Moldova, Republic of</option> <option value="MC">Monaco</option> <option value="MN">Mongolia</option> <option value="MS">Montserrat</option> <option value="MA">Morocco</option> <option value="MZ">Mozambique</option> <option value="MM">Myanmar</option> <option value="NA">Namibia</option> <option value="NR">Nauru</option> <option value="NP">Nepal</option> <option value="NL">Netherlands</option> <option value="AN">Netherlands Antilles</option> <option value="NC">New Caledonia</option> <option value="NZ">New Zealand</option> <option value="NI">Nicaragua</option> <option value="NE">Niger</option> <option value="NG">Nigeria</option> <option value="NU">Niue</option> <option value="NF">Norfolk Island</option> <option value="MP">Northern Mariana Islands</option> <option value="NO">Norway</option> <option value="OM">Oman</option> <option value="PK">Pakistan</option> <option value="PW">Palau</option> <option value="PA">Panama</option> <option value="PG">Papua New Guinea</option> <option value="PY">Paraguay</option> <option value="PE">Peru</option> <option value="PH">Philippines</option> <option value="PN">Pitcairn</option> <option value="PL">Poland</option> <option value="PT">Portugal</option> <option value="PR">Puerto Rico</option> <option value="QA">Qatar</option> <option value="RE">Reunion</option> <option value="RO">Romania</option> <option value="RU">Russian Federation</option> <option value="RW">Rwanda</option> <option value="KN">Saint Kitts and Nevis</option> <option value="LC">Saint LUCIA</option> <option value="VC">Saint Vincent and the Grenadines</option> <option value="WS">Samoa</option> <option value="SM">San Marino</option> <option value="ST">Sao Tome and Principe</option> <option value="SA">Saudi Arabia</option> <option value="SN">Senegal</option> <option value="SC">Seychelles</option> <option value="SL">Sierra Leone</option> <option value="SG">Singapore</option> <option value="SK">Slovakia (Slovak Republic)</option> <option value="SI">Slovenia</option> <option value="SB">Solomon Islands</option> <option value="SO">Somalia</option> <option value="ZA">South Africa</option> <option value="GS">South Georgia and the South Sandwich Islands</option> <option value="ES">Spain</option> <option value="LK">Sri Lanka</option> <option value="SH">St. Helena</option> <option value="PM">St. Pierre and Miquelon</option> <option value="SD">Sudan</option> <option value="SR">Suriname</option> <option value="SJ">Svalbard and Jan Mayen Islands</option> <option value="SZ">Swaziland</option> <option value="SE">Sweden</option> <option value="CH">Switzerland</option> <option value="SY">Syrian Arab Republic</option> <option value="TW">Taiwan, Province of China</option> <option value="TJ">Tajikistan</option> <option value="TZ">Tanzania, United Republic of</option> <option value="TH">Thailand</option> <option value="TG">Togo</option> <option value="TK">Tokelau</option> <option value="TO">Tonga</option> <option value="TT">Trinidad and Tobago</option> <option value="TN">Tunisia</option> <option value="TR">Turkey</option> <option value="TM">Turkmenistan</option> <option value="TC">Turks and Caicos Islands</option> <option value="TV">Tuvalu</option> <option value="UG">Uganda</option> <option value="UA">Ukraine</option> <option value="AE">United Arab Emirates</option> <option value="GB">United Kingdom</option> <option value="US">United States</option> <option value="UM">United States Minor Outlying Islands</option> <option value="UY">Uruguay</option> <option value="UZ">Uzbekistan</option> <option value="VU">Vanuatu</option> <option value="VE">Venezuela</option> <option value="VN">Viet Nam</option> <option value="VG">Virgin Islands (British)</option> <option value="VI">Virgin Islands (U.S.)</option> <option value="WF">Wallis and Futuna Islands</option> <option value="EH">Western Sahara</option> <option value="YE">Yemen</option> <option value="YU">Yugoslavia</option> <option value="ZM">Zambia</option> <option value="ZW">Zimbabwe</option> </select>'; } }//------END CLASS ?> this is my config.php <?php include("classes/classlib.php"); //----HERE IS THE MAIN WEBSITE STUFF-------- $web_title = "School-Cheats.com"; $web_slogan = "We Have All The Answers!"; date_default_timezone_set('America/New_York'); //------------------------ $cms = new cms(); $cms->host = 'localhost'; $cms->username = 'moneypok_school'; $cms->password = 'pass123'; $cms->db = 'moneypok_school'; $cms->current_time = date('D,F j, Y, h:i:s A'); $cms->id = $_GET['school_id']; $cms->c_id = $_GET['class_id']; $cms->school = $_POST['school_name']; $cms->country = $_POST['country']; $cms->city = $_POST['city']; $cms->state = $_POST['state']; $cms->zip = $_POST['zip']; //------------------------- ?> this is my main file <?php session_start(); include("config.php"); //connect to the database $cms->connect(); if($_GET['new_school'] == "yes"){ $cms->newSchool(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="logo"> <h1><a href="#"><?php echo $web_title; ?> </a></h1> <p><em><?php echo $web_slogan; ?> </em></p> </div> <hr /> <!-- end #logo --> <div id="header"> <div id="menu"> <ul> <li><a href="index.php" class="first">Home</a></li> <li class="current_page_item"><a href="#">Blog</a></li> <li><a href="#">Photos</a></li> <li><a href="#">About</a></li> <li><a href="members/login.php">Login</a></li> <li><a href="register.php">Register</a></li> </ul> </div> <!-- end #menu --> <div id="search"> <form method="get" action=""> <fieldset> <input type="text" name="s" id="search-text" size="15" /> <input type="submit" id="search-submit" value="Find School!" /> </fieldset> </form> </div> <!-- end #search --> </div> <!-- end #header --> <!-- end #header-wrapper --> <div id="page"> <div id="page-bgtop"> <div id="content"> <div class="post"> <div class="entry"> <p style="padding-left:250px;"><strong>Fill out the form to add a your school!</strong></p> <p><form action="new_school.php?new_school=yes" method="post"> <center><table align="center" border="1"> <tr> <td>School Name: </td><td><input type="text" name="school_name" /></td> </tr> <tr> <td>Country: </td><td><?=$cms->country(); ?></td> </tr> <tr> <td>City: </td><td><input type="text" name="city" /></td> </tr> <tr> <td>State: </td><td><input type="text" name="state" /></td> </tr> <tr> <td>Zip: </td><td><input type="text" name="zip" /></td> </tr> <tr> <td></td><td><input type="submit" name="submit" value="Add School!" /></td> </tr> </table></center> </p> </div> </div> </div> <!-- end #content --> <div id="sidebar"> <ul> <li> <h2>Lates News </h2> <p>School-Cheats.com is now up and running! Tell everyone about this and lets all be lazy cheaters! </p> </li> </ul> </div> <!-- end #sidebar --> <div style="clear: both;"> </div> </div> </div> <!-- end #page --> <div id="footer"> <p>Copyright (c) 2009-2010 <?php echo $web_title; ?>. All rights reserved..</p> </div> <!-- end #footer --> </div> </body> </html> and i don't seem to get any errors but the code doesn't seem to work either. it doesn't insert the values into the database
  14. hello, i'm new to Object Oriented Programming and I am trying to create a class function that will insert data into my database. i beleive i have the code correct but i'm not sure what i am doing wrong. can some one help me please? here is my code..... class cms{ var $db; var $host; var $username; var $password; var $school; var $country; var $city; var $state; var $zip; function connect(){ $con = mysql_connect($this->host,$this->username,$this->password) or die("Could not connect to database"); $sel =mysql_select_db($this->db) or die("Could not select database"); } function newSchool(){ $sql = mysql_query("INSERT INTO schools (school, country, city, state, zip) VALUES (" . $this->school . ',' . $this->country . ',' . $this->city . ',' . $this->state . ',' . $this->zip . ")"); } } and here is my other code........ <?php include("config.php"); $cms = new cms(); $cms->connect(); if($_GET['new_school'] == "yes"){ $cms->newSchool(); } ?> <form action="new_school.php?new_school=yes" method="post"> <center><table align="center" border="1"> <tr> <td>School Name: </td><td><input type="text" name="school_name" /></td> </tr> <tr> <td>Country: </td><td><?=$cms->country(); ?></td> </tr> <tr> <td>City: </td><td><input type="text" name="city" /></td> </tr> <tr> <td>State: </td><td><input type="text" name="state" /></td> </tr> <tr> <td>Zip: </td><td><input type="text" name="zip" /></td> </tr> <tr> <td></td><td><input type="submit" name="submit" value="Add School!" /></td> </tr> </table> and the config file just defines my $_POST vars for the form.
  15. I found my problem I needed to change MySQL query. I didn't know that there was a MySQL query to SUM up the values in a colum. but I found it on tizag
  16. Hello.....I am working on a script that will pull the data from a db and I am having some trouble.....I was wondering if someone can help me out. I have a db with a field called payment_amount. i would like to add * FROM payment_amount. does anybody have any idea on how i can add the total amount?? here is what i have: //connect to the db connect(); //build query $history = mysql_query("SELECT * FROM payments"); $my_rows; //create a while loop to show all records while($row = mysql_fetch_array($history,MYSQL_ASSOC)){ $my_rows = $my_rows . $row['payment_amount']; //here i will add the total amount paid =) $total = ""; //---set default value for total amount paid $row['payment_amount']+= $total; } echo $my_rows; echo $total;
  17. thanks soo much for the info. it worked perfectly
  18. Hello, I am trying to write a script that uses $_GET, to be able to connect to my database and pull the records WHERE the Student_name Field is LIKE the variable i have but i am not sure what I am doing wrong..... I want to know how i would be able to address it by the URL, for instance: student.php?field=Student_name&s=john here is my code: <?php $field = 'Student_name'; $s = $_GET['s']; mysql_connect('localhost','bcheight_mbdc','frog123'); mysql_select_db('bcheight_mbdc'); $result = mysql_query("SELECT * FROM after_school_services WHERE '$field' = '$s'"); $my_rows; while($row = mysql_fetch_array($result,MYSQL_ASSOC)){ $my_rows = $my_rows . ' ' . $row['Student_name'] . ' Student Id: ' . $row['ff_id'] . 'Student Name: ' . $row['Student_name'] . ' D.O.B.: ' . $row['dob'] . ' Sex: ' . $row['Sex'] . ' Grade: ' . $row['grade'] . ' Class Room: ' . $row['class_room'] . ' Teacher: ' . $row['teacher'] . ' Parent\'s Name: ' . $row['Parent_name'] . ' Language: ' . $row['language'] . ' Home Number: ' . $row['home_num'] . ' Work Number: ' . $row['work_num'] . ' Cell number: ' . $row['cell_num'] . ' Email: ' . $row['email'] . ' Address: ' . $row['address'] . ' Apt: ' . $row['apt'] . ' City: ' . $row['city'] . ' Zip: ' . $row['zip'] . ' Emergency Name: ' . $row['emergency_name'] . ' Emergency Number: ' . $row['emergency_contact_number'] . ' '; } echo $my_rows; ?>
  19. if that's not the problem, try changing the word METHOD on your form to lower case for example your form should be like this: echo ' ';
  20. i dont think that your $_POST[""]; needs double quotes, try using single quotes and see what happens
  21. wow thanks sooo much man :cool: that was as clear as it can get............it really helped me out alot an i got my script working
  22. hello, I am trying to work on a script that will JOIN 2 different tables and I keep getting the following error..... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 109 can anyone help me out with this? thanks //==========================CONNECT TO DB AND PULL THE SALES FROM EACH USER FROM SEPERATE TABLES===================== $con = mysql_connect('localhost','bcheight_textmon','fadjflka'); $sel = mysql_select_db('bcheight_text'); $sql_query = "SELECT promoters.username, promoter_sales.package_sold ". "FROM promoters, promoter_sales ". "WHERE promoters.username = promoter_sales.username"; $my_q = mysql_query($sql_query); $my_sales; while($row = mysql_fetch_array($sql_query,MYSQL_ASSOC)){ $my_sales = $my_sales . 'Date Sold: ' . $row['date_sold']. " Package Sold: ". $row['package_sold'] . ' '; } //===============================================================================================
  23. you have "" in your $_POST["name"]; when it should be single '' for example $_POST['name'];
  24. Hello, I was speaking with stephan and I asked him how can I link 2 different tables in MySQL.....I was told that creating "views" is the easiest way to go about doing this. At first i didn't have any idea what "views" were but now after googling mysql views i learned a bit about them. I still do not know how to use the views and I would really appreciate it if anyone can help out. I have a table that contains users and i want to create another table that will allow me to keep a record of the users sales and what they sold as well as what dates they sold it. Please help me out with mysql Views
×
×
  • Create New...