[PHP] $_POST Array and Cleaning

2008-01-20 Thread nihilism machine
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 -

[PHP] POST/GET into variables

2008-01-20 Thread nihilism machine
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

Re: [PHP] POST/GET into variables

2008-01-20 Thread nihilism machine
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

[PHP] forms class

2008-01-21 Thread nihilism machine
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

[PHP] form cleaning class

2008-01-21 Thread nihilism machine
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

[PHP] upload problem

2008-01-22 Thread nihilism machine
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']['

[PHP] sessions/cookies

2008-01-22 Thread nihilism machine
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

[PHP] upload issue

2008-01-23 Thread nihilism machine
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 (

[PHP] first php 5 class

2008-01-29 Thread nihilism machine
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

[PHP] first php class take 2

2008-01-29 Thread nihilism machine
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

[PHP] call to a member function select() on a non object.

2008-01-29 Thread nihilism machine
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)

[PHP] shopping carts

2008-02-06 Thread nihilism machine
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

Re: [PHP] shopping carts

2008-02-06 Thread nihilism machine
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

Re: [PHP] issues with calling methods twice in a row

2008-02-08 Thread nihilism machine
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

[PHP] issues with calling methods twice in a row

2008-02-08 Thread nihilism machine
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

[PHP] Better DB Class MySQL

2008-02-09 Thread nihilism machine
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

[PHP] mysql question

2008-02-10 Thread nihilism machine
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; }

[PHP] mysql question #2

2008-02-10 Thread nihilism machine
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

[PHP] https forced redirect question

2008-02-15 Thread nihilism machine
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() {

[PHP] www. not working

2008-02-15 Thread nihilism machine
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']; } //

[PHP] check if website has www. in front of domain

2008-02-15 Thread nihilism machine
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) {

Re: [PHP] www. check still not working

2008-02-15 Thread nihilism machine
. $_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.&#x

[PHP] www. check still not working

2008-02-15 Thread nihilism machine
checkWWW(); } // Check if site is preceeded by 'WWW' public function checkWWW() { $myDomain = $_SERVER['SERVER_NAME']; $FindWWW = 'www.'; $POS = strpos($myDomain, $FindWWW); if ($POS === 1) {

[PHP] upload issue

2008-02-17 Thread nihilism machine
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

[PHP] separating strings from extensions

2008-02-17 Thread nihilism machine
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

[PHP] classes

2008-02-18 Thread nihilism machine
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

[PHP] mysql input

2008-02-18 Thread nihilism machine
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

[PHP] form cleaner class

2008-02-21 Thread nihilism machine
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 =

[PHP] Sendmail question

2008-03-14 Thread nihilism machine
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]"

[PHP] email issue

2008-03-14 Thread nihilism machine
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

[PHP] GD / Pixel Font Rendering

2008-03-15 Thread nihilism machine
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