Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About chriscloyd

  • Rank
    Advanced Member
  • Birthday 02/05/1988

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
  1. chriscloyd

    Retrieve database dump values

    <?php foreach($array as $column => $value){ echo $column; echo $value; } ?> did this on on my phone. I’m not 100% sure what you are trying to do
  2. chriscloyd

    data not inserted into database ..

    Try this <?php $host = "localhost"; $username = "root"; $password = "root"; $db_name = "test2.0"; $tbl_name = "permohonan"; mysql_connect("$host", "$username", "$password") or die("cannot connect"); mysql_select_db("$db_name") or die("cannot select DB"); if (isset($_POST['submit'])) { $Jabatan = mysql_real_escape_string($_POST['Jabatan']); $unit = mysql_real_escape_string($_POST['unit']); $lain2 = mysql_real_escape_string($_POST['lain2']); $nama_pemohon = mysql_real_escape_string($_POST['nama_pemohon']); $destinasi = mysql_real_escape_string($_POST['destinasi']); $tujuan = mysql_real_escape_string($_POST['tujuan']); $maklumat_ = mysql_real_escape_string($_POST['maklumat_']); $datedepart_ = mysql_real_escape_string($_POST['datedepart_']); $timedepart_ = mysql_real_escape_string($_POST['timedepart_']); $datearrive_ = mysql_real_escape_string($_POST['datearrive_']); $timearrive_ = mysql_real_escape_string($_POST['timearrive_']); $query1 = mysql_query("INSERT INTO permohonan VALUES(NULL,'$Jabatan','$unit','$lain2','$nama_pemohon','$destinasi','$tujuan','$maklumat_','$datedepart_','$timedepart_,'$datearrive_',$timearrive_')"); if ($query1) { header("location : reservationform.php"); } else { echo mysql_errno() . ": " . mysql_error() . "\n"; } } ?>
  3. chriscloyd

    send alerts to users?

    I agree with Psycho, but it does not have to be a cron job, if you do not want to use one. You could do it on login. When the user logs in and if it is the first login of the day you can show all available job matches/alerts for that user.
  4. chriscloyd

    paid subscription tips of solutions

    Hello, I would create another row in your member table called subscription_id or what ever you would name the subscriptions table. Then in the subscriptions table just create the rows for the id, name, description (if one), term (months, years), cost, renewal automatically, signup_date, end_date? Some of the things I add to the new table. Then just do your magic.
  5. chriscloyd

    Combine 2 variables and use as an ID

    var x = "#inputList", y = 2; $(add_button).on('click', function(e) { e.preventDefault(); $(x + y).css('display','inline); console.log($(x + y)); //this should show you if you have the right object check your console y++; return false; });
  6. Well hello this is easy if you use jquery.... A couple of things $(document).ready(function() { var appendEle = $("#updateFixture"); $("#fixtures").on('change', function() { appendEle.html(""); var stage = $(this).val(); $.post('getFixtures.php', {stage: stage}, function(data) { var obj = $.parseJSON(data); $.each(obj, function(index, fixture) { var newEle = $("<div></div>"); var goalsfor = $('<label>' + fixture.hometeam + ' Goals</label><input type="text" id="goalsfor_' + fixture.id + '" name="goalsfor_' + fixture.id + '" value="' + fixture.goalsfor + '" />'); var goalsagainst = $('<label>' + fixture.awayteam + ' Goals</label><input type="text" id="goalsagaint_' + fixture.id + '" name="goalsagaint_' + fixture.id + '" value="' + fixture.goalsagaint_+ '" />'); goalsfor.append(newEle); goalsagainst.append(newEle); newEle.append(appendEle); }); }); }); $("#saveButton").on('click', function() { $.post('saveFixtures.php', $("#contactForm").serialize(), function(data) { if(data == "success") { //do what you want } else { //do what you want } }); }); }); That is the jquery file you will need two other files to save the changes and update I can help with that too if you need
  7. chriscloyd

    Reading an Array

    function multi_array_permutations($arrays) { $loops = 1; foreach ($arrays as $array) { $loops *= count($array); } for ($i = 0; $i < $loops; $i++) { $product = 1; for ($j = 0; $j < count($arrays); $j++) { $product *= count($arrays[$j]); print($arrays[$j][$i/($loops/$product) % count($arrays[$j])]); } print(PHP_EOL); } }
  8. chriscloyd

    Reading an Array

    What exactly are you trying to do with this array?
  9. chriscloyd

    Reading an Array

    Fastsol, you know he was trying to show an example so I will help him with that array(array(1,1,1,1),array(2,2,2,2),array(3,3,3,3),array(4,4,4,4));
  10. chriscloyd

    Need help with contact form

    <form action="" method="post" name="contact"> <input type="text" name="name" placeholder="First and Last Name" /><br /> <input type="email" name="email" placeholder="Email Address" /><br /> <input type="text" name="phone" placeholder="Phone Number" /><br /> <textarea name="message"> Type Your Message Here </textarea><br /> <input type="submit" name="submit" value="Send" /><br /> </form> <?php if(isset($_POST['submit'])){ $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; $to = 'Your Email Address'; $subject = 'Contact Message From - ' . $name; $body = "Name: {$name}\n Email: {$email}\n Phone: {$phone}\n Message:\n {$message}"; mail($to, $subject, $body); }
  11. $team = $_GET['team']; echo $team; $query = 'SELECT * FROM a_players WHERE team= '. $team .' ORDER BY nameLast ASC'; $results = mysql_query($query); $count = 0; while($line = mysql_fetch_assoc($results)) { I cleaned up your code a little bit. <?php $team = mysql_escape_string($_GET['team']); if(is_int($team)){ $query = "select `nameFirst`, `nameLast` from `a_players` where 'team' = '{$team}' order by nameLast asc"; $results = mysql_query($query); $count = 0; //why are you counting if you mind me asking while($player = mysql_fetch_assoc($results)) { $nameFirst = $player['nameFirst']; $nameLast = $player['nameLast']; echo <<<EOT <div> <a href="http://eg10basketball.com/playerinfo?nameFull={$nameFirst}-{$nameLast}">{$nameFirst} {$nameLast}</a> <br> </div> EOT; } }
  12. You can always try printing out the global variable $_GET try this echo '<pre>'; print_r($_GET); echo '</pre>'; it will show all the variables sent through
  13. chriscloyd

    Textarea not displayed in MySQL DB

    do this on your page before adding to the database just to make sure you are getting everything <?php echo "<pre>"; print_r($_POST); echo "</pre>";
  14. http://www.farinspace.com/saving-form-data-to-google-spreadsheets/ that other one is outdated
  15. Google is a good way to find out information. I googled accessing Google spread sheet and found this. http://sim.plified.com/2008/09/14/accessing-google-spreadsheet-with-php/

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.