Jump to content

dual_alliance

Members
  • Posts

    140
  • Joined

  • Last visited

    Never

About dual_alliance

  • Birthday 02/04/1990

Profile Information

  • Gender
    Male
  • Location
    NSW, Australia

dual_alliance's Achievements

Member

Member (2/5)

0

Reputation

  1. It's quite simply really, you just set it in the array. For example: $data['ftitle'] = array('name'=>'title', 'size' => 30, 'value' => set_value('title') ); $data['fauthor'] = array('name'=>'author', 'size' => 30, 'value' => set_value('author') ); And so on...
  2. $teamname = GET_("team_name"); $teamcaptain = GET_("team_captain"); $teamphone = GET_("team_number"); $teamemail = GET_("team_address"); to $teamname = $_POST['player_name']; $teamcaptain = $_POST['phone_number']; $teamphone = $_POST['player_email']; $_GET is only used if you are passing variables via a URL e.g. index.php?act=index To refer to this, you would then use $_GET['act'].
  3. I can't test it at the moment, but from what l can see you need to do something like below <?php // variable n is equal to the id of number on PrimeNumber.html $PrimeNum = $_GET['number']; // Checks to see if the number entered is between 1-1000 // Make sure it also checks to see if the number is less then 0 if ( $PrimeNum <= 0 || $PrimeNum >= 1000) { echo "<p>The number must between 1 and 999. Please try again.</p>"; echo "<p><a href='PrimeNumber.html'>Go Back.</a></p>" ; die(); // Make it so the script stops here and doesn't continue running } // Calculates to check and see if a number is prime. If it is not prime it displays an error message. for($i = 2; $i < sqrt($PrimeNum); $i = $i + 2){ if ($PrimeNum % $i == 0){ echo "<p>The number you entered was not a prime number.</p>" ; echo "<p><a href='PrimeNumber.html'>Go Back.</a></p>" ; die(); //Like before, we know its not a prime number so there is no reason to continue processing }else{ echo "<p>The number you entered is prime!</p>"; echo "<p><a href='PrimeNumber.html'>Go Back.</a></p>" ; die(); // like before, except we know now that this is a prime number } } ?> Hopefully it works...
  4. <?php $myvar1 = $_GET['myfn']; $myvar2 = $_GET['mymt']; header('Content-disposition: attachment; filename=' && $myvar1); header('Content-type: ' && $myvar2); readfile($myvar1); ?> I'm not sure why you are using the operator && (and) in the header function, you will probably have more luck with the code below <?php $myvar1 = $_GET['myfn']; $myvar2 = $_GET['mymt']; header('Content-disposition: attachment; filename='.$myvar1); header('Content-type: '.$myvar2); readfile($myvar1); ?>
  5. I've ran your script on my local computer, it works fine. Is there any other PHP in addnotices.php that you did not show? As this might be causing the script not to display for you.
  6. This is just a guess as l can't test this at the moment, but try: td.middle { vertical-align: top; height: 400px; width: 100%; <----- padding: 4px; }
  7. O.O, but there are other support options Google.com <- Your best friend when you have a problem to solve. php.net <- Go to the manual and you can find information about all the functions in php and what they do with examples This forum. There really is no need for phone line support!
  8. Also it helps if you post the error you are receiving. From just looking at the code, here is what l see that needs to be fixed. <?php echo "<p>".$e->getMessage(),"</p>"; // To echo "<p>".$e->getMessage()."</p>"; ?> Can't really help you more until you give the exact error that is happening.
  9. Thanks 448191 thats exactly the kick in the right direction l needed!
  10. It's not exactly what l'm trying to acheive, as when it comes to a mysqli database that would be of no use as l want to use it in a way like this: $db = new database('w.e', 'w.e', 'w.e', w.e'); $db->query()... That way, if l switch to a server that has mysqli and no mysql all l have to do is edit the config file and the database.php will enable me to use the functions from mysqli.database.php (which l havent made yet) Thanks for trying to help
  11. Hello, While learning OOP l've hit a snag. I wish to be able to switch between two different database types mysqli and mysql. To do that l've setup the following... database.php mysql.database.php mysqli.database.php In database.php, it will eventually select from the config file what type of database to use. However, l still cant grasp the concept of how do achieve this. This is what l have so far. database.php include('mysql.database.php'); interface database { function connect($host, $db, $user, $pass) { $this->host = $host; $this->db = $db; $this->user = $user; $this->pass = $pass; } mysql.database.php class MySQL implements database { function connect() { mysql_connect($this-host,$this->user,$this->pass); mysql_select_db($this->db); echo 'working?'; } } I've changed the code many times from idea's l've found on the internet while trying to find out how to do this. I know the code above wont work properly, but l really would appreciate a kick in the right direction Thanks for your help.
  12. The design is nice, you should probably centre it though to make it look better as l dont think it looks good currently being aligned to the left. And lastly, like others have said before me get rid of the tables and use div's with css.
  13. I dont think it is a wise idea for any user to see the information that is being submitted to the database, such as a registration script this is why l consider $_POST to be more secure.
  14. You should use $_POST instead of $_GET as it is more secure. But if you still want to use $_GET you should make it so that the script checks to see if the user via $_SESSION has permission then delete's a record. Also it would also be wise to filter $_GET with htmlspecialchars()
×
×
  • 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.