-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Yes it work the same way each time.
-
Yes is possible. your need GDlib installed, (most have servers that installed) if you search for image resize your find tons on here
-
See here http://www.phpfreaks.com/tutorial/php-security AND http://phpsec.org/projects/guide/4.html
-
how to knowthe forwarder email using imap functions
MadTechie replied to indianyogi's topic in PHP Coding Help
Use toaddress from the imap_headerinfo that will give you all the email address send to.. to put them into an array you could do this *untested* <?php $info = imap_headerinfo($m_mail, $msgid) preg_match_all('/\s?[^,]*/', $info->toaddress , $toaddress); $toaddress= $toaddress[1]; echo "<pre>";print_r($toaddress); ?> -
With the phone number you should filter it before its inserted and then format the output ie $Phone= preg_replace('/[^0-9]/i', '', $Phone); 555-1234 becomes 5551234 you can then do the same with the search to search for "any" you need to use LIKE and % as wildcards ie SELECT * FROM table WHERE company LIKE "%freaks%"; //contains freaks SELECT * FROM table WHERE company LIKE "freaks%"; //Starts with freaks SELECT * FROM table WHERE company LIKE "%freaks"; //Ends with freaks Hope that helps
-
[SOLVED] Preventing web app from being pirated
MadTechie replied to stoneyrose's topic in Application Design
One problem with nu-coder is it requires "Php Express loader" to be installed on the Server while Zend requires "zend optimizer" which is included on most servers.. [*]First and foremost, the protection provided by encoders is questionable because the source code is while encrypted is still available. Decryption of such files is not terribly hard. If there is a malicious user who wants to get your source - there is a pretty good chance that he/she will break this protection [*]Second problem is the performance of the files encrypted with the php encoders from this category. Execution times tend to be slower because of the additional overhead produced by decrypting of the file prior to the processing. -
This seams pointless putting a vot up! if its paid for then post in the freelance section so are you submitting data to 4 sites ?
-
Hotmail use "HTTP" access if you want POP you need to pay for the PLUS account.. So you could do the same for POP but only if you have a Plus account EDIT: I may invest some time into creating a script that allows you to get message from hotmail without needing the plus account.
-
Are you trying to use FTP from you PC that connects to both server and transfers the data ? if so thats going to take ages! you best bet is to create a php script thats download the files to the host machine.. then put that script on the new server and let it run.. does the script below give you a list of files on the old server ?when its ran from the new server ? update this line first $dir = "ftp://usernae:password@remotehost.com/myfiles/"; <?php $dir = "ftp://usernae:password@remotehost.com/myfiles/"; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo "filename: $file : filetype: " . filetype($dir . $file) . "<br>\n"; } closedir($dh); } } ?>
-
Okay when you open gmail.. the page loads up and you see your messages (plus links) these are build by the dynamic page.. So http://mail.google.com/mail/?shva=1#inbox contains the links ie http://mail.google.com/mail/?shva=1#inbox/11f08c542531d23d, So if you read the html contents it must contain "?shva=1#inbox/11f08c542531d23d" thus you know the "inbox/11f08c542531d23d" code however i truly recommand you take the imap route.. untested <?php $mbox = imap_open ("{imap.gmail.com:993/imap/ssl}INBOX", "username@gmail.com", "password") or die("can't connect: " . imap_last_error()); echo "<h1>Mailboxes</h1>\n"; $folders = imap_listmailbox($mbox, "{imap.gmail.com:993/imap/ssl}INBOX", "*"); if ($folders == false) { echo "Call failed<br />\n"; } else { foreach ($folders as $val) { echo $val . "<br />\n"; } } echo "<h1>Headers in INBOX</h1>\n"; $headers = imap_headers($mbox); if ($headers == false) { echo "Call failed<br />\n"; } else { foreach ($headers as $val) { echo $val . "<br />\n"; } } imap_close($mbox); ?>
-
[SOLVED] Preventing web app from being pirated
MadTechie replied to stoneyrose's topic in Application Design
DON'T DOUBLE POST -
[SOLVED] Preventing web app from being pirated
MadTechie replied to stoneyrose's topic in Application Design
Connecting to your own site to check for a valid number.. well if i open the php file i can just remove that routine.., encrypting that php file well thats a slow down.. won't stop me but will slow me down.. The thing you should remember when it comes to securing your Apps.. is you can NOT stop someone stealling it.. if you send them the program they can hack it.. What you need to work on is a protection that will last as long as it take to release a new version or will waste so much of their time its cheaper to buy it.. if you don't mind me asking.. whats the app ? Attached is an example of Zend Encrypted Code: [attachment deleted by admin] -
When you curl the first page it's likes will have the "11f08c542531d23d" code.. BUT why not just use imap to connect to the gmail server ? and use it correctly
-
[SOLVED] Social network profile.php need to be made how do i ?
MadTechie replied to jamesxg1's topic in PHP Coding Help
No offence but if you hace Asperger syndrome then you need to start and study the basics even more, your need to pay look at the minor details more than the whole plan.. and you would NOT be the type of person who can just jump in at the deep end trust me i know more about Asperger's than you may think and if you are the type or person who need to jump in at the deep end then you don;t have Asperger and if you do then you have never started anything! -
[SOLVED] Files in directory not 0kb?
MadTechie replied to NorthWestSimulations's topic in PHP Coding Help
This should do it <?php $dir = "cgi-bin/bin"; //FULL PATH $Guest = 0; $Members = 0; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if($file == "." || $file == ".." || is_dir($dir.$file)) continue; $size = filesize($dir.$file); if($size > 0) { $Guest++; }else{ $Members++; } } closedir($dh); } } echo "Members: $Members<br>Guests: $Guest<br>"; -
[SOLVED] upload file - change filename but extension dont chage
MadTechie replied to web_master's topic in PHP Coding Help
<?php $filename = "Myfile.txt"; $file_ext = strrchr($filename, '.'); //gets .txt $newfile = "Whatever".$file_ext; //=Whatever.txt ?> -
your need to use addslashes() or better still mysql_real_escape_string() if you post you code with the "INSERT INTO" i could give you a actual example
-
I agree with CV and heres an example <?php format_input( "test", T_STRIP); //pass 1 format_input( "test", array(T_STRIP, T_HTML)); //pass more than 1 format_input( "test", array(T_HTML)); //pass 1 (as an array will also work) function format_input( $variable_data, $variable_type ) { if(!is_array($variable_type)) { $variable_typeA = array(); $variable_typeA[] = $variable_type; }else{ $variable_typeA = $variable_type; } foreach($variable_typeA as $variable_type) { switch( $variable_type ) { //HTML clean #$this->page->postit_code# case T_HTML: $variable_data = nl2br( $this->strip_html( $variable_data, $this->config['system_allowed_html_tags'], false, true ) ); break; //HTML remove case T_NOHTML: $variable_data = $this->strip_html( $variable_data, $this->config['system_allowed_html_tags'], false, true, true ); break; //HTML remove case T_PREVIEW: $variable_data = $this->strip_html( $variable_data, $this->config['system_allowed_html_tags'], false, false ); break; //HTML <form> element clean case T_FORM: $original = array( '\\n', '\\r' ); $replaced = array( chr( 10 ), chr( 13 ) ); $variable_data = str_replace( $original, $replaced, $variable_data ); break; //Clean for database entry case T_DB: $variable_data = $this->xss_clean( $variable_data, false ); break; //Clean for database entry case T_STRIP: $variable_data = stripslashes( $variable_data ); break; //URL friendly case T_URL_ENC: $variable_data = urlencode( $variable_data ); break; //URL un-friendly case T_URL_DEC: $variable_data = urldecode( $variable_data ); break; //URL parsable for filesizes case T_DL_PARSE: $variable_data = str_replace( " ", "%20", $variable_data ); break; //Format based on locale case T_NUM: $variable_data = number_format( $variable_data ); break; //Nothin' default: break; } } return $variable_data; } ?>
-
[SOLVED] new user activation email - theory and implementation
MadTechie replied to Lodius2000's topic in PHP Coding Help
echo the query and then grab the SQL and try the where in a select ie SELECT * FROM users WHERE `username` = 'my-username' AND `active_hash` = 'hash-goes-here' -
try renaming it to shoutbox.php and put it in the public_html folder then open it.. or rename the .htaccess file to 1.htaccess
-
[SOLVED] easy server side validation question
MadTechie replied to carley_bell's topic in PHP Coding Help
Try this if (preg_match('/^[a-z0-9]*$/i', $_POST['field_1'])) { # It's alphanumeric } -
Okay it sounds like a rewrite problem.. have to created an .htaccess files ? added anything to "tidy the url" etc ?
-
Add <?php die("TESTING"); ?> at the very top, to check it is infact a page problem and not a rewrite problem