-
Posts
969 -
Joined
-
Last visited
Everything posted by Destramic
-
it all works but this part doesn't $field_value = ${"_" . $this->Method}[$field_name];
-
yep POST is the value set for the method...but has no return here is my code...but i am running this script off my apache server...possible some setting are wrong in my php.ini file? <?php class Form_Validation { public $Form_Name; public $Fields = array(); public $Method = "POST"; public $Errors = false; public function __construct($form_name) { $this->Form_Name = $form_name; } public function Validate_Field($field_name, $field_type, $error_message) { $this->Fields[$field_name]['name'] = $field_name; $this->Fields[$field_name]['type'] = $field_type; $this->Fields[$field_name]['error_message'] = $error_message; } public function Display_Errors() { foreach ($this->Fields as $field) { $field_name = $field['name']; $field_type = $field['type']; $error_message = $field['error_message']; echo $field_value = ${"_" . $this->Method}[$field_name]; echo $_POST[$field_name]; echo $this->Method; } } public function Validate_Form() { } } ?>
-
i tried the code and it returned no value <?php echo $field_value = ${"_" . $this->Method}[$field_name]; // but both vars below returned values echo $_POST[$field_name]; echo $this->Method; ?> so the code you gave me didn't seem to have worked
-
as the method can change from _POST - _GET variable varable is what i need for this certian code...do you know why the code above isn't working please?
-
i'm having a problem getting this to work... $this->method = "POST" if anyone could help please $field_value = $_{$this->Method}[$field_name];
-
thats a great help...thank again
-
i've just trying to get back into php after a long break...and im a bit rusty on a few certian things...and i can't get this code to work below if anyone can hep me please cause i've forgtten how to use <<<CODE to echo the html <?php <<<CODE <form action="<?php echo __FILE__; ?>" name="test"> Name : <input type="text" name="name" /><br /> E-Mail : <input type="text" name="email" /><br /> </form> >>>CODE; ?>
-
hey guys...a nice and easy question, does anyone have a script or a tutorial to help take card payments over the net...all im after is a simple script which you can input your card details and it debits a one off payment to another account...if somone could point me in the right direction i'd be very greatful...thanks
-
can you post your page please?
-
i had a quick look through and saw that you arew calling a function before it has been set.. put: connectDB(); after: function connectDB() { $db_connection = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD); mysql_select_db (DB_NAME); } same with your getRows function...
-
i basically want to make a cron where it will dump my tables at midnight every night to my computer not web server!. The cron is not the concern, but how would i get the dump sent to my computer? is this possible? many thanks Ricky
-
you want to use mysql create a table users ----------------- user_id username password ---------------- login.php <?php $username = $_POST['username']; $password = md5($_POST['password']); $query = "SELECT username, password FROM users WHERE username = '".$username."' AND password = '".$password."'"; $result = mysql_result($query) $count = mysql_num_rows($result); $row = mysql_fetch_array($result); if ($count > 0) { session_start(); $_SESSION['username'] = $row['username']; $_SESSION['password'] = $row['password']; $_SESSION['user_id'] = $row['user_id']; } else { echo "Login details incorrect.<br \>\n"; } ?> logout.php <?php session_start(); unset($_SESSION['username']); unset($_SESSION['password']); unset($_SESSION['user_id']); session_destroy(); ?> index.php <?php if (isset($_SESSION['username']) && isset($_SESSION['password'])) { echo "control panel here!<br />\n"; } ?> this should work...just written it up now...very simple way of doing thinks which can be adapted upon..any problems give me a shout Ricky
-
try putting it in capitals [code[ <?php define("IMAGE_ROOT", "/web/d2/w/mysite/mysite.com/images/"); $imageurl = IMAGE_ROOT . $myrow['image']; ?>
-
does anyone know how this is done? im thinking i dont know how to do this.... i dont know what file format to save the file as and where? any pointers?
-
anyone? help me?
-
so this would work? i dont understand where and what file format i should save it as? localhost@21 # cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ 0 0 * * * root mysql_backup.php ricky
-
basically i want a automated script that on a certian time (00:00) it will send sql tables to my computer so i have a backup? Ricky
-
bah i thought this could simply be done via date_default_timezone_set($time_zone); have a page which could help me out?
-
trying to add integers then convert to time
Destramic replied to matthewst's topic in PHP Coding Help
shouldnt that work out the hours? $hours = round(($time / 60) / 60, 2); -
i would change the time zone using this function date_default_timezone_set($time_zone); all the timezones would come from the database, i have a colum which tells me the users timezone and then i change the time zone accordingly
-
basically if $time_zone = "umt" or something different i want the time to show up in that time zone.
-
im trying to format a timestamp, for instance if date is today then it will return today then [time] and if date is yesterdays date then it will return it...I want it to work in different time zones, but im having a bit of trouble gettin it all together and working...can somone have a look and gove me some pointers? <?php timestamp_format($timestamp, $format = “d/m/Y G: i:s T”, $time_zone = “GMT”) { date_default_timezone_set($time_zone); $timestamp = expload(“ “, date($format, $timestamp)); $yesterdays_date = ; $todays_date = date($format, $timestamp[0]); if ($timestamp[0] == $todays_date) { $date = “Today at ” . $timestamp[1]; } else if () { $date = “Yesterday at ” .$timestamp[1]; } else { $date = $timestamp[0] . $timestamp[1]; } return $date; } ?> thanks ricky
-
just wondering how to do this....i see done on alot of website? Ricky