-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Code seams ok.. you say each page runs a query, are their more then 1 query ? are you running the same query more than once per page .. we really need some more info..
-
try class parent { var $config = ""; function initiate() { $this->config = "hello world"; } } class child extends parent { function display() { $content = $this->config; return $content; } } //$parent = new parent; //removed $child = new child; //$parent->initiate(); //removed $child->initiate(); $content = $child->display(); echo $content; EDIT also this should be in the OOP section!
-
Modify existing regex to support commas and spaces
MadTechie replied to solarisuser's topic in Regex Help
try ^(??:\d{1,3}\.){3}\d{1,3}(?:\z|,?\s+))+ or use effigy code (better solution) -
Function not executing upon success with IPN script
MadTechie replied to MasterACE14's topic in PHP Coding Help
<?php class paypal_class { var $last_error; // holds the last error encountered var $ipn_log; // bool: log IPN results to text file? var $ipn_log_file; // filename of the IPN log var $ipn_response; // holds the IPN response from paypal var $ipn_data = array(); // array contains the POST values for IPN var $paypal_url; // You need to ADD this var $fields = array(); // array holds the fields to submit to paypal function paypal_class() { // initialization constructor. Called when class is created. $this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; //NO Var for the line above -
Nope..(not what i have found) i think your thinking of the vbscript compression for uploads!! only worked on IE (was poop)
-
looks like "process" isn't being set in the form... try print_r($_POST); at the top of the code and post the results here
-
what about the manual! zlib & wrappers compression & ob_gzhandler
-
Shrink many characters to few characters using php
MadTechie replied to npsari's topic in PHP Coding Help
Seams OK here, Note the changes! <?php //New String $theString = "hi, my name is blaha blah, i likeeeeeeeeeeeeeeeeeeee to play footbal, adios, byeeee"; $max = 10; //changed from 25 to 10 $start = 6;//changed from 17 to 6 $end = 3; //changed from 5 to 3 $words = explode(" ",$theString); foreach($words as $word) { $sLength = strlen($word); if($sLength > $max) { $NewString = substr($word, 0, $start); $NewString .= "..."; $NewString .= substr($word, ($sLength-$end), $end ); }else{ $NewString = $word; } echo $NewString." "; } ?> output -
the above has always worked for me.. !
-
Function not executing upon success with IPN script
MadTechie replied to MasterACE14's topic in PHP Coding Help
only problem i can see is your missing var paypal_url; also move the donate1 function to the bottom ! -
Shrink many characters to few characters using php
MadTechie replied to npsari's topic in PHP Coding Help
maybe this <?php $theString = "1234567 8901234578901234567890123457890123456 7890123457890"; $max = 25; $start = 17; $end = 5; $words = explode(" ",$theString); foreach($words as $word) { $sLength = strlen($word); if($sLength > $max) { $NewString = substr($word, 0, $start); $NewString .= "..."; $NewString .= substr($word, ($sLength-$end), $end ); }else{ $NewString = $word; } echo $NewString." "; } ?> -
try this, its a basic check nothing special! <?php if (isset($_POST['email'])) { header("Location: http:\\whatever.com"); } require_once('libs/Smarty.class.php'); $smarty = new Smarty; $smarty->compile_check = true; $smarty->debugging = false; if (isset($_POST['action']) && $_POST['action'] == 'Submit request') { $body = ''; $body .= 'How d......
-
Shrink many characters to few characters using php
MadTechie replied to npsari's topic in PHP Coding Help
what about this <?php $theString = "123456789012345789012345678901234578901234567890123457890"; $max = 25; $start = 17; $end = 5; $sLength = strlen($theString); if($sLength > $max) { $NewString = substr($theString, 0, $start); $NewString .= "..."; $NewString .= substr($theString, ($sLength-$end), $end ); }else{ $NewString = $theString; } echo $NewString; ?> output EDIT or change 60 to 25 ### Shorten textual part if need be. $url_text = strlen($url) >= 25 ? (substr($url, 0, 20) . '...' . substr($url, -10, 10)) : $url ; -
you reading the WHOLE thing
-
I know.. i was saying the compression swaps its.. so check your not compressing it.. if your not compressing it, then you are doing something else wrong!
-
it is simple!! class testClass { funtion TestFunction() { echo "hello"; } } OR Use Extend Old POST
-
Determining # of Lines in "outputted" HTML / MS Word
MadTechie replied to Centinul's topic in PHP Coding Help
so you need to work out the paper size, if word wrap is on and the font size and the line spacing etc etc also i assume you are using M$ words ability to convert the HTML to a doc.. -
PDFLib Compression converts CMYK to RGB for web display! really need to see some code!!
-
what is a person who does php programming called ?
MadTechie replied to jd2007's topic in PHP Coding Help
zend_php_certification -
try this $to = "someone <some@email>"; $subject = "You've got mail!"; $message = "Hello someone."; $headers = "From: me@mysite.com\n"; // I suggest you try using only \n $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; $headers .= "Reply-To: me <me@mysite.com>\n"; $headers .= "X-Priority: 1\n"; $headers .= "X-MSmail-Priority: High\n"; $headers .= "X-mailer: My mailer"; mail ($to, $subject, $message, $headers)
-
Nothing but you need to start a table first
-
[SOLVED] Preg_match and password criteria fails
MadTechie replied to spookztar's topic in Regex Help
Gezzz OK heres the full example <?php $formpassword = "aaaA2aa"; //Works $formpassword = "aaaaaa"; //Fails $valid = (preg_match('/\A(?=\S*?[A-Z])(?=\S*?[a-z])(?=\S*?[0-9])\S*\z/', $formpassword)>0)?true:false; if (!$valid) { $error .= "<span class='warning'>$formpassword ERROR: Failed check for required symbols in password. Please adhere to the specifications given.</span><br />"; } echo $error; //Added ?> -
can you post the array from the print_r($_POST)!