-
Posts
837 -
Joined
-
Last visited
Everything posted by samshel
-
post ur code from protected.php , i think it is going there and redirecting back to log.php
-
ur form action is going to login.php and you have written the code in log.php, try posting the form to log.php
-
[SOLVED] Little help for someone new to php
samshel replied to dieselserpent's topic in PHP Coding Help
print "<font color=blue>" . $num2 . "</font> and the answer is <font color=red>" $myTotal ."</font>!"; should be print "<font color=blue>" . $num2 . "</font> and the answer is <font color=red>".$myTotal ."</font>!"; error shows the line number -
Agree
-
thanks for the response ! right ! it should open on page load
-
Hi, Is anyone aware of any Javascript which can open a pop under and not get detected by the pop up blocker. One of my clients urgently need it Thanks Samir
-
Hi, Does anyone have an idea about a ready made Rule engine available in PHP? I already took a look at the google project, but it seems it is stuck. any help is greatly appreciated. Thanks Samshel
-
extract from manual...use the following $result = mysqli_query($db,$query);
-
[SOLVED] Nested Classes hierarchy - Best approach suggestion needed
samshel replied to samshel's topic in Application Design
dont worry ! i got it I am using combination of multi level includes [for inner levels] and factory [for outer level]. Its scalable and fast -
Hi All, Ok so here is what i am trying to do and i strongly need advice about what is the best way to do it. Requirement: Build an external interface module which will interact with any third party system and if a new system comes up tomorrow i can just add a file with business logic and i dont have to worry about common things which i have already done for other similar systems. So when i need to add a new payment gateway which is a webservice all i need to do is write the business logic. For this i have divided any system into categories and sub-categories nested upto nth level, Simple Example: verisign - Category : Webservice - Sub Category: Payment Gateway So Verisign is first a webservice and then a payment gateway. I have already implemented Paypal webservice and i dont want to write the common code again for Verisign. I know the first thought that comes to mind is factory method...but still read on I have the following structure interface -- interface.php [Factory Controller for outmost level] -- interfacecommon.php [Common functions for outmost level] webservice -- webservice.php [Factory Controller for webservice level] -- webservicecommon.php [Common functions for webservice level] payment -- payment.php [Factory Controller for payment level] -- paymentcommon.php [Common functions for payment level] paypal -- paypal.php [Actual business logic for Paypal] verisign -- verisign.php [Actual business logic for Verisign] Solutions that i can think of: 1) Create object of outermost level (interface.php). Call a function, which will create an object of inner level controller(webservice.php) and assign it to its own member variable. The inner level controller again creates an object of the one more level inner level controller (payment.php), which inturn creates object of lowest level class (verisign.php). All these controllers will inherit a class each present on thier level which will have the common functionality for that level. By this I get one object with many member variables nested. 2) I dont use Factory so i dont need a controller. I start from inner most level (paypal.php) , which inherits upper level common class(payment.php), which inherits 1 more level upper common class (webservice), which inherits one more level upper common class (interface.php) and i use object of this. 3) anything u can suggest..i am all ears. man this is complicated !! I really hope i am able to explain properly what i need. anyways i need the system to be extremely scalable but extremely fast too, so i dont want unnecessary includes and object creations. Thanks for the patience !! your suggestions are highly appreciated..
-
echo "<option value='".$row['ID']."'>- ".$row['ID']."</option>";
-
include("http://www.domain.com/file.php?search=q1"); include("http://www.domain.com/file.php?search=q2"); include("http://www.domain.com/file.php?search=q3"); when u include a URL, PHP actually gives a hit to that URL as if a user has clicked on it and then includes the HTML output.. check if this is what u need. It may require some php.ini configurations to allow to read a URL.
-
Finding words in a given site and replace them to links
samshel replied to werushka's topic in PHP Coding Help
so you want to read from an outside website (ex: http://www.google.com/search?hl=en&q=Tvscreens ) parse all specific words like Tvscreens, replace the words in HTML with hyperlink , landing page of which you can specify and put these replacements back on the website? OR do you want to take the HTML, replace words with links and write it to a local file, which you can use in your own website? Initial case is not possible as u cannot write to pages of a website that does not beling to you, later case is possible, if u need that then it is easy to do - read url using any file read command - ereg_replace words with links - write to a file. OR may be i completely misunderstood what u r looking for -
$width = imageSX($imgObj); $height = imageSY($imgObj); ..... imagecopyresampled($newImage, $imgObj, 0, 0, 0, 0, $width, $height, imageSX($imgObj), imageSY($imgObj)); i think $width is same as imageSX($imgObj) and $height is same as imageSY($imgObj). so ur passing the destination height and width the same as source, so it will give u image of the same size, it crops the image but the size is same so it fills remaining area with black color.. please carefully study each parameter of the function imagecopyresampled and check if you are supplying them correctly.
-
[SOLVED] mysql_real_escape_string() and nl2br() problem
samshel replied to shadiadiph's topic in PHP Coding Help
do nl2br first then stripslashes..try it -
something like this... <?php $arrFiles = array( "http://weather.noaa.gov/pub/data/raw/fp/fpus20.kwbn.scs.01.txt", "http://weather.noaa.gov/pub/data/raw/fp/fpus20.kwbn.scs.02.txt", "http://weather.noaa.gov/pub/data/raw/fp/fpus20.kwbn.scs.03.txt", "http://weather.noaa.gov/pub/data/raw/fp/fpus20.kwbn.scs.04.txt" ); $strHTML = ""; for($i=0;$i<count($arrFiles)$i++) { $arrTemp = file($arrFiles[$i]); $strHTML .= implode("", $arrTemp); } $fd = fopen("/path/to/us-scs.html", "w"); fwrite($fd, $strHTML); fclose($fd); ?>
-
please explain in detail...
-
pl post some more details...some code/DB structure etc. if this is all that you have, then read some tuts to prepare basic PHP pages, make DB connection best of luck
-
$row_i = 1; foreach($enrolled_array as $enrolled_client){ echo $cell_1 = "topmostSubform[0].Page1[0].SMART_ID___Row_1[0]"; echo "<br/>"; echo $cell_1 = "topmostSubform[0].Page1[0].SMART_ID___Row_".$row_i."[0]"; $fields[$cell_1]->setValue($enrolled_client['clientid']); $row_i++; } check closely if they are exactly same.
-
is this a duplicate post? check my reply here..let me know if thats what ur looking for. http://www.phpfreaks.com/forums/index.php/topic,243735.0.html
-
what r u trying to achieve? you want to show records in 3 columns? try this.. <?php // Setup and run query $query = "select * from items where name like '%".$searchterm."%'"; $result = $db->query($query); $num_results = $result->num_rows; echo "<p>Number of items found: ".$num_results."</p>"; // Display results echo "<table border= 1>"; for ($i=0; $i <$num_results; $i=$i+3) { echo "<tr>"; for ($c=0; $c < 3; $c++) { if((($i*3) + $c) < $num_results) { $row = $result->fetch_assoc(); $Imge = stripslashes($row['imge']); echo "<td>"; echo "<p><strong>Number: "; echo stripslashes($row['number']); echo "\t \t"; echo htmlspecialchars(stripslashes($row['title'])); echo stripslashes($row['name']); echo "</strong><br /></p>"; echo "<p align='center'><img border=\"0\" src=\"images/".$Imge."\"><br /></p>"; echo stripslashes($row['description']); echo "<br />Price: "; echo stripslashes($row['price']); echo "</p>"; echo "</td>"; } else { echo "<td> </td>"; } } echo "</tr>"; } echo "</table>"; ?> PS: the code is not tested. EDIT: updated if condition to multiply by 3
-
u sure this is the form which is displayed? this form should post the info to mess_send.php. try to view source your page in browser and check form action.
-
try system("php x.php >> $output",$retval);
-
it should work !! i tried to do the same thing with sample code and it works..may be there is some problem in function calling or surrounding code. <?php $str = ""; function setString($val){ global $str; $str = $val; } setString("Test"); echo $str; ?> but yes ! i agree with PFMaBiSmAd
-
<?php $filename = 'weather1.txt'; if (file_exists($filename)) { echo "Last Updated: " . date ("F d Y H:i:s.", filemtime($filename) + 60*60); } ?> i m not sure though if adding 1 hour will solve your problem, it may cause issues when day light savings come into effect.