Jump to content

samshel

Members
  • Posts

    837
  • Joined

  • Last visited

Everything posted by samshel

  1. 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>
  2. avoid it altogether !
  3. //$diff is the difference $intyears = (int) ($diff/365); $intRemainingDays = fmod($diff,365); $str = ""; if($intyears > 0) $str .= $intyears." Years and "; $str .= $intRemainingDays." Days"; ?>
  4. 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
  5. Hi, check if this works. <?php $indays = 970; echo $intyears = (int) (970/365); echo " Years and ".$intRemainingDays = fmod(970,365); ?>
  6. 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; } ?>
  7. Hi, It should work.Try not specifying a mode. By default it should be 777. May be it works SamShel
  8. Hi What Soap Client Class are you using? Can you please provide some more code?
  9. 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
  10. Hi, try this <td><input name="type" type="text" readonly="true" Value="<?php echo $row['type']?>" /></td> hth SamShel
  11. 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
  12. 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
  13. 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
  14. Thanks Thorpe ! I was trying to milk an OX anyways. thanks for the tip.
  15. 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
  16. [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]
  17. Even if u use strip_tags function you can allow only [nobbc]<br>[/nobbc] or <p> tags.
  18. [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
  19. 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...
  20. $date = date("Y-m-d"); $date_month = date("m"); is this what u need ?
  21. What output do you get ? Can you paste the HTML you get in the View Source of the page ?
  22. [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
  23. [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]
  24. 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
  25. $percentage = 22; $total = 550; echo $percentage."% of ".$total." is ".($total * $percentage/100 );
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.