-
Posts
837 -
Joined
-
Last visited
Everything posted by samshel
-
Assign Number Automatically in Each Row (Please help)
samshel replied to apaunganhote's topic in PHP Coding Help
Try this, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Test</TITLE> </HEAD> <BODY> <?php $arr = $_POST['oldvalue']; $arr[] = $_POST['newvalue']; ?> <table> <?php for($i=0;$i<count($arr);$i++) { ?> <tr><td><?php echo $arr[$i] ?></td></tr> <?php } ?> </table> <form method="POST"> <input type="text" name="newvalue"> <?php for($i=0;$i<count($arr);$i++) { ?> <input type="hidden" name="oldvalue[]" value="<?php echo $arr[$i] ?>"> <?php } ?> <input type="submit" name="submit" value="Add Value"> </form> </BODY> </HTML> -
avoid it altogether !
-
//$diff is the difference $intyears = (int) ($diff/365); $intRemainingDays = fmod($diff,365); $str = ""; if($intyears > 0) $str .= $intyears." Years and "; $str .= $intRemainingDays." Days"; ?>
-
Hi, Please check rewrite rules and .htaccess changes on google. It will be easy with one rule like below ([^/]*)/([^/]*)/ index.php?page=($1)/($2) To use .htaccess, you should have allowoverrideall setting enabled in httpd.conf. Please google around. hth
-
Hi, check if this works. <?php $indays = 970; echo $intyears = (int) (970/365); echo " Years and ".$intRemainingDays = fmod(970,365); ?>
-
Hi, Or you can simply do this: <?php $fileUrl = "http://someurl.com/prices.xml"; $AgetHeaders = @get_headers($fileUrl); if (preg_match("|200|", $AgetHeaders[0])) { // file exists echo"file exists"; readfile($fileUrl); } else { // file doesn't exist echo"<error>Cannot read file</error>"; return false; } ?>
-
Hi, It should work.Try not specifying a mode. By default it should be 777. May be it works SamShel
-
Hi What Soap Client Class are you using? Can you please provide some more code?
-
Hi, Assuming MemberID is autoincrement field, try this $q1 = "select * from classmates_members where profile_image = '' order by MemberID desc limit 0,3 "; OR if you have a date_joined field in the table sort by that field in descending order. hth
-
Hi, try this <td><input name="type" type="text" readonly="true" Value="<?php echo $row['type']?>" /></td> hth SamShel
-
Hi, You cannot use a normal form to submit to a third party URL and grab the data as after you submit the form, the execution will go to the third party page on which you dont have a control. Try CURL library in PHP. It will be very simple using CURL. For parsing XML you get you can check out PEAR Classes. HTH SamShel
-
Hi, I agree with lordfrikk. It is not possible. I assume you want 2 different forms to be submitted as you have 2 different logics to execute. You will have to merge them in one file and submit a merged form to that file. Thanks SamShel
-
Hello, I need to develop an application in PHP-GTK and need to support MDI. Please let me know if anybody has done such a thing before and if yes, how
-
Thanks Thorpe ! I was trying to milk an OX anyways. thanks for the tip.
-
Hello, Does anybody have an idea how to use AJAX in PHP-GTK ? A link/tutorial for the same would help a lot. Thanks SamShel
-
[code] <?php $database="mydatabase"; mysql_connect ("localhost", "myuser", "mypass"); @mysql_select_db($database) or die( "Unable to select database"); $sql = "SELECT DATE_FORMAT(updated, '%d %b %Y') AS updated FROM windows_atari2600"; $result = mysql_query($sql) or die("SELECT Error: ".mysql_error()); while ($get_info = mysql_fetch_row($result)){ print "<tr>"; foreach ($get_info as $field) print "<td>$field</td>\n"; print "</tr>\n"; } ?> [/code]
-
Even if u use strip_tags function you can allow only [nobbc]<br>[/nobbc] or <p> tags.
-
[code] $sql = "UPDATE koruproduct SET code = '$code', type = '$type', collection = '$collection', price = '$price', imagefull = '$imagefull', imagethumb = '$imagethumb', description = '$description', item_level = '$item_level' [/code] 1) Where did you close the doubte quotes. 2) There is no Where clause in the query 3) Echo the query before executing and paste it here please hth
-
I am not sure but i think it is not possible as PHP being a Server side language does get only the information about client only what is passed in HTTP headers. and i think user name is not passed. but still worth checking...
-
$date = date("Y-m-d"); $date_month = date("m"); is this what u need ?
-
What output do you get ? Can you paste the HTML you get in the View Source of the page ?
-
SIMPLE: Array variables not being passed in foreach() statement
samshel replied to intech's topic in PHP Coding Help
[code] echo "<pre>"; print_r($_POST['some_info']); echo "</pre>"; foreach($_POST['some_info'] as $some_info) { $info = ". $it_info ."; } [/code] try this, check if all data is posted properly or not. hth -
[code] echo "<form method=post action='remove.php'><table>"; while($row=mysql_fetch_array($result)) { echo "<tr><td>$row[1]</td><td><input type='submit' value='REMOVE'><input type='hidden' name='rmurl[]' value='$row[0]'></tr>";//can be 0 or 1 or 2 depending on the element where the url is stored } echo "</table></form>"; [/code] [code] $rmurl = "'".implode("','",$_POST['rmurl'])."'"; echo $rmurl; $dbname="project"; $dbc = @mysql_connect ('localhost', 'root', '') or die (mysql_error()); @mysql_select_db("$dbname"); $SQL = "DELETE FROM filterurl WHERE url in($rmurl)"; $result = mysql_query($SQL); header("Location: filterdisplay.php"); [/code]
-
Hello, The script needs checks for variables in GET and the form you submit has a POST method. Change the method of the form to 'GET'. hth
-
$percentage = 22; $total = 550; echo $percentage."% of ".$total." is ".($total * $percentage/100 );