Jump to content

S3cr3t

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Everything posted by S3cr3t

  1. function romanNumerals($num) { $n = intval($num); $res = ''; /*** roman_numerals array ***/ $roman_numerals = array( 'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1); foreach ($roman_numerals as $roman => $number) { /*** divide to get matches ***/ $matches = intval($n / $number); /*** assign the roman char * $matches ***/ $res .= str_repeat($roman, $matches); /*** substract from the number ***/ $n = $n % $number; } /*** return the res ***/ return $res; } echo romanNumerals(2012);
  2. Set different name on each submit button then grab it with a if. if(isset($_POST['buttonNameOne'])) .... if(isset($_POST['buttonNameTwo'])) .... And you got only one <form></form> ...
  3. Same as the line before. echo "<center><table border='0' width='100%' cellspacing='0' cellpadding='0' > <tr bgcolor='#ffffcc'><form name=myForm method='post' onSubmit="ajaxFunction(this.form); return false">... "; echo "<center><table border='0' width='100%' cellspacing='0' cellpadding='0' > <tr bgcolor='#ffffcc'><form name=myForm method='post' onSubmit=\"ajaxFunction(this.form); return false\">...";
  4. Change specialpage.php to your *.php file. Change ?variable=$2 to ?item=$2
  5. Well you could make a script that reads each line and inserts it into the INSERT INTO string. The lazy way would be to go into phpMyAdmin and create those missing tables manually.
  6. <?php if(isset($_POST['submit'])) { $message = ''; $numberOne = htmlentities($_POST['numberOne']); $numberTwo = htmlentities($_POST['numberTwo']); $doMath = htmlentities($_POST['doMath']); $result = htmlentities($_POST['result']); if($doMath == '+') { $compare = $numberOne + $numberTwo; } else if($doMath == '-') { $compare = $numberOne - $numberTwo; } else if($doMath == '*') { $compare = $numberOne * $numberTwo; } else if($doMath == '/') { $compare = $numberOne / $numberTwo; } else { $compare = 0; } if($compare == $result) { $message = 'Yes you are !'; } else { $message = 'Unfortunately you are not...'; } } else { $message = ''; } $numberOne = rand(0, 10); $numberTwo = rand(0, 10); ?> <!DOCTYPE html> <html lang='de'> <head> <meta charset='utf-8' /> <title>Math</title> </head> <body> <form action='?' method='post'> <input type='text' name='numberOne' readonly='readonly' value='<?php echo $numberOne; ?>' /> <select name='doMath'> <option value='+'>+</option> <option value='-'>-</option> <option value='*'>*</option> <option value='/'>/</option> </select> <input type='text' name='numberTwo' readonly='readonly' value='<?php echo $numberTwo; ?>' /> <span>=</span> <input type='text' name='result' /> <input type='submit' name='submit' value='Am I correct ?' /> <p><?php echo $message; ?></p> </form> </body> </html>
  7. Try to use the $_POST variables to compare your result. Store the other variables in hidden inputs.
  8. echo '</head><body onload="ajaxFunction()";>';
  9. If there are no errors so bErrors == false then submit form. So just the normal way action='yourphpvalidationfile.php' gets the $_POST.
  10. Tried that one ? RewriteRule ^team-info.php?team_id=([0-9]+)$ team/team-info.php?team_id=$1 [R=301,L]
  11. INSERT INTO data (`username`,`email`,`gender`,`age`,`photo1`,`photo2`,`photo3`,`description`,`country`,`state_province`,`city`,`sexual_orientation`,`zodiak`,`bodytype`,`hair`,`eyes`,`ethnicity`,`education`,`religion`,`kids`,`smoke`,`drink`,`income`) VALUES ("me303","1personsemail@mail.com","Woman",18,"nophoto.jpg","nophoto.jpg","nophoto.jpg","helloe very one i am a verry fun person to be around i like to go out or stay home if i have that special soem one right their with me i am willing to try eveything once so if u want to talk ","US","CT","Denver","Straight","Aquarius","Average","Black","Black","Hispanic/Latino","Some College","No Answer","No","No","Ocasionally","No Answer"); INSERT INTO data (`username`,`email`,`gender`,`age`,`photo1`,`photo2`,`photo3`,`description`,`country`,`state_province`,`city`,`sexual_orientation`,`zodiak`,`bodytype`,`hair`,`eyes`,`ethnicity`,`education`,`religion`,`kids`,`smoke`,`drink`,`income`) VALUES ("nice guy","personsemail@mail.com","Man",20,"nophoto.jpg","nophoto.jpg","nophoto.jpg","im smart funny,i like to live life to its fullest.looking for a friend or more","US","MO","cape","Straight","Gemini","Athletic","Blonde","Green","Caucasian (white)","Some College","Catholic","No","Ocasionally","Often","Less than $24,999"); If you got the right table...
  12. Yeah $get_rating = mysql_query("select sum(DISTINCT(crating)) as crating, sum(DISTINCT(srating)) as srating from myscore where roundID ='12'") or die(mysql_error()); $get_rating2 = mysql_fetch_array($get_rating); echo $get_rating2['crating']."<br>";
  13. If you are not using this index.php anymore rename it. Visitors should be redirect to index.html automatically.
  14. select sum(DISTINCT(crating)) as crating, sum(DISTINCT(srating)) as srating from scores where roundID = 12 echo $dbResult['crating']; echo $dbResult['srating'];
  15. $all_unpaid = (!$items_array[$i]['direct_payment_paid'] && !$items_array[$i]['flag_paid'] && [b]$items_array[$i]['bid_amount'] >= 1[/b]) ? $all_unpaid : false;
  16. You will need a counter to indicate there are 3 <td>s so that script puts a </tr><tr> in it and then reset the counter to continue with the <td>s.
  17. What about a form.submit() event in your button click event ?
  18. <?php $address = $addressL1 .','. $area .','. $county .','. $postcode .','. $country; $address = urlencode($address); ?>
  19. Or you just drag them first to the left / right and then in the middle.
  20. select sum(DISTINCT(crating)), sum(DISTINCT(srating)) from scores where roundID = 12
  21. Well this script isn't really supposed to update boxes in same container...
  22. <?php echo (isset($_GET['failed'])) ? CNT_TXT_MYERRORMESSAGE : ''; ?>
  23. I dont really understand that but I would save an userID and username too. Table users - userID - username - password Table comments - commentID - userID - message - timestamp Associate the userID in comments table with the userID in the login table. Probably make a $_SESSION['userID']; . And then do it with that WHERE statement.
  24. Unfortunately I don't know that script. Got something in the JS error console ? PHP errors ? Tried do compare your script with that one in the demo ?
×
×
  • 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.