I'm trying to create a function that will first take an array of
$_POSTs and give them key/value pairs like variables. For instance, if
i had $_POST['whatever'] = "whatever", that would be made into
$whatever = "whatever", then i can clean for sql injection and xss.
any ideas here?
- e
-
how does this look? should this by me calling ... myforms = new
forms(); work by turning all key/value pairs for both get and post
into variable names of the same name as the get/post key, and the
variable values as the values from the post/get?
class forms {
// Some stuff
putName = "somevalue".
I am not concerned about cleaning the input as i have a function
already for that.
On Jan 20, 2008, at 10:06 PM, Nathan Nobbe wrote:
On Jan 20, 2008 9:47 PM, nihilism machine
<[EMAIL PROTECTED]> wrote:
how does this look? should this by me callin
Why isnt this cleaning my form $_POST's
class forms {
var $UserInputClean;
// Forms to variables
function forms() {
if (count($_POST) > 0) {
foreach($_POST as $curPostKey => $curPostVal) {
$c
now my debug shows that with the following code, all of the
$_POST['whatever'] values are blank.
class forms {
var $UserInput;
// Forms to variables
function forms() {
if (count($_POST) > 0) {
foreach($_POST as $curPostK
any ideas why this does not work?
class upload {
function upload() {
upload::uploader();
}
function uploader() {
$FileName = basename($_FILES['upload1']['name']);
if (move_uploaded_file($_FILES['upload1']['
I wrote an authentication class in php4. The sessions dont seem to be
working with internet explorer, just with FF. here is the code below,
a cookies notice pops up when you try and login:
mysql_connect('','','') or die('ERROR: Could not connect to
database');
mysql_selec
i am using this code on my form page:
method="post" name="adForm" id="adForm">
alt="Submit Form" />
my upload code is below:
$uploaddir = 'admin/advertisements/';
$uploadfileTmp = basename($_FILES['upload1']['name']);
$uploadfile = $uploaddir . basename($_FILES['upload1']['name']);
if (
Ok, trying to write my first php5 class. This is my first project
using all OOP PHP5.2.5.
I want to create a config class, which is extended by a connection
class, which is extended by a database class. Here is my config class,
how am I looking?
$connInfo;
}
}
?>
--
PHP General
How does this look now?
$connInfo;
}
}
?>
$connInfo = new dbconfig();
$username =
$hostname =
$password =
$database =
$DB = new PDO("mysql:host=$connInfo[$hostname];dbname=
$connInfo[$database]", $connInfo[$username], $c
I amn trying to use my db class in my auth class, but i get the error:
call to a member function select() on a non object
connect();
}
// Connect to MySQL Server
private function connect() {
$this->link = mysql_connect($this->db_server,$this->db_user,$this-
>db_pass)
Does anyone know of a shopping cart which allows you to add multiple
custom fields to each product?
--e
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
that does not help, none specify whether they have a custom fields
option or not.
On Feb 6, 2008, at 4:23 PM, Daniel Brown wrote:
On Feb 6, 2008 4:18 PM, nihilism machine <[EMAIL PROTECTED]>
wrote:
Does anyone know of a shopping cart which allows you to add multiple
custom fields t
that was just an example. yes they both provide 5 input variables.
On Feb 8, 2008, at 4:18 PM, Jim Lucas wrote:
nihilism machine wrote:
i have a method called CreateUser() which is public and takes 5
variables as its data, then adds them to a db. it only executes the
first method not the
i have a method called CreateUser() which is public and takes 5
variables as its data, then adds them to a db. it only executes the
first method not the other although its all the same but the variable.
ex:
$auth = new auth();
$auth->CreateUser("fake email", 1, "fake name", 4);
$auth->Create
Looking to really beef up my DB class, any suggestions for functions
to add that will be more time saving for a web 2.0 app, or ways to
improve existing methods? thank you everyone in advance.
connect();
}
// Connect to MySQL Server
public function connect() {
$this
i have this functuon:
public function select_one($sql) {
$this->last_query = $sql;
$r = mysql_query($sql);
if (!$r) {
$this->last_error = mysql_error();
return false;
}
Ok, I read the php.net info. so with this function though:
public function select_one($sql) {
$this->last_query = $sql;
$r = mysql_query($sql);
if (!$r) {
$this->last_error = mysql_error();
ret
why isnt this redirecting my page to https://www.mydomain.com instead
the page stays at my domain.com
checkHTTPS();
$this->checkWWW();
$this->ServerName = $_SERVER['SERVER_NAME'];
}
// Check if HTTPS
public function checkHTTPS() {
this still does not work, if a domain has no preceeding www. it
redirects to http://www.www.site.com, if it has a www. it goes to www.www.mydomain.com
, any ideas?
checkWWW();
$this->ServerName = $_SERVER['SERVER_NAME'] .
$_SERVER['REQUEST_URI'];
}
//
here is my function:
// Check if site is preceeded by 'WWW'
public function checkWWW() {
$myDomain = $_SERVER['SERVER_NAME'];
$FindWWW = '.';
$POS = strpos($myDomain, $FindWWW);
if ($POS === false) {
. $_SERVER['REQUEST_URI'];
header($redir);
}
}
Regards,
Anjan Upadhya
nihilism machine wrote:
checkWWW();
}
// Check if site is preceeded by 'WWW'
public function checkWWW() {
$myDomain = $_SERVER['SERVER_NAME'];
$FindWWW = 'www.
checkWWW();
}
// Check if site is preceeded by 'WWW'
public function checkWWW() {
$myDomain = $_SERVER['SERVER_NAME'];
$FindWWW = 'www.';
$POS = strpos($myDomain, $FindWWW);
if ($POS === 1) {
any idea why this fails?this is the error: "Sorry, there was a problem
uploading your file"
$insertID = $DB->insert_sql("INSERT INTO CMS_Media (File_Name) VALUES
('')");
$target = "media/" . $insertID . $extension;
//echo $target;
if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $targ
i am using this code to get the extension of a filename:
$extension = strtolower(strrchr($fileName,"."));
how can i get the text BEFORE the . (period)
?
thanks in advance.
-e
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
if i declare an instance of a class in the top of my php file, then
have html, then later on user $myClassInstance->myMethod(); --
myMethod() does not execute, only when i have the instantiation of the
class right before the call to the method does it work. any ideas?
-e
--
PHP General Mai
I have a user saving a VARCHAR(255) field in a mysql db which has
single quotes in the text, how can i replace them so that they dont
fuck up my mysql command?
-e
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
What is a better idea? Using this class in my db class and using
CleanInput on the sql statements, or using it in the top of the all
pages with form input to clean the $_POST's? Also, any ideas or
comments on improving the class?
0) {
foreach($_POST as $curPostKey =
I have a link that i want to use as the body of an html email. here
is the code i use:
// Notify about comments
public function emailComment($Link, $ID) {
$mail = new SendMail();
$mail->SetCharSet("ISO-8859-1");
$mail->from("someone", "[EMAIL PROTECTED]"
here is my simple email lib: http://pastebin.com/m4d107c01
any idea why in the body i have a link with an = sign that gets
replaced with a % sign?
-e
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I am trying to render an 8 pixel pixel font without anti aliasing to
look crisp (silkscreen) in 8pt with gd. the font is huge and ugly:
-- any ideas?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
31 matches
Mail list logo