Jump to content

jake2891

Members
  • Posts

    113
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jake2891's Achievements

Member

Member (2/5)

0

Reputation

  1. hey guys id just like some input when you should use oop programming and when you should use procedural programming?
  2. lol this post was posted in october haha dont think he'd be seeing our replies now.
  3. yeah i just tested that code on a mysql db and it works for me. can you put a or die(mysql_error()) on your query and see what it says. show us your insert statement. heres my example one i used just for testing not to make code secure and nice etc... <?php $conn = mysql_connect("***","***","***"); mysql_selectdb("testsql"); $timestampInSeconds = $_SERVER['REQUEST_TIME']; $mySqlDateTime= date("Y-m-d H:i:s", $timestampInSeconds); mysql_query("insert into hello (`test1`)values('$mySqlDateTime')"); $q = mysql_query("select * from hello"); while($row = mysql_fetch_array($q,MYSQL_ASSOC)){ echo $row['test1']."<br>"; } ?>
  4. have you created the ch2 directory in your htdocs directory? seems like a silly question i know but u never know . does anything get displayed on the webpage in your browser when you open the page anything at all?
  5. is it just one file or all? can you post your php file your trying to run from /ch2/foo.php. also are you using something like wamp etc?
  6. you can use it for a dev or live environment. or if your writing a reusable piece of code where the host may change.
  7. the codes using jquery have you downloaded and installed that seeing as you just copied the code from somewhere?
  8. WHERE email=='$email' AND username=='$username' should be WHERE email='$email' AND username='$username'
  9. just do this on the next form <?php if($_POST['text']){ echo 'got text'; }else{ echo 'no text'; } if($_POST['graphic']){ echo 'got graphic'; // can do something now }else{ echo 'no graphic'; // cant do shit } ?>
  10. change the javascript function check i gave you to this instead its overkill but it will work. function check(){ var none_checked = false; var graphics = document.getElementsByName("graphic[]"); var text = document.getElementsByName("text[]"); for(i=0;i<graphics.length;i++){ if(!graphics[i].checked){ none_checked = true; } } for(i=0;i<text.length;i++){ if(!text[i].checked){ none_checked = true; } } if(none_checked == true){ document.getElementById('submit').style.display='none'; }else{ document.getElementById('submit').style.display='block'; } for(i=0;i<graphics.length;i++){ if(graphics[i].checked){ if(document.getElementById('submit').style.display=='none'){ document.getElementById('submit').style.display='block'; } } } for(i=0;i<text.length;i++){ if(text[i].checked){ if(document.getElementById('submit').style.display=='none'){ document.getElementById('submit').style.display='block'; } } } }
  11. yeah if you write a php script that connects to the database loops through records and finds a match for a birthday on that day it would mail them. just create a cron job to run your php script once a day in the morning or something.
  12. no thats not rite because if the id is unique your fetching one record instead of an array of records? if your only wanting one record then use mysql_fetch_row instead. $query = mysql_query("SELECT * FROM content WHERE id =1") or die(mysql_error()); if($query){ $row = mysql_fetch_row($query); } // if your table is structure like this? $row[0]; // id $row[1]; // title $row[2]; // content
  13. hmm well if you make it that when there is no checked boxes the submit dissappears again like i mentioned earlier you wont get an empty array on the next page unless you get a sneaky hacker then you would have to validate alot more.
  14. yeah you can do this $query = mysql_query('SELECT * FROM contact'); while($results = mysql_fetch_array($query,MYSQL_ASSOC)){ $title = $results['title']; $id = $results['id']; $content = $results['content']; echo "<a href=\"javascript:void(0);\" onclick=\"show_content($id)\">$title</a>"; echo "<div id=\"$id\" style=\"display:none\">$content</div>"; }
  15. lol... yeah man ull need to pull the content from ur table into the results variable and add in any other spacing and css you want to distance the links and divs etc.. let me know if u dont understand
×
×
  • 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.