Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. infact thats wrong the reason for the conditional statement is preg_match will return the number of match's while $regs returns the array.. so i format them like this if (preg_match('%www\.blah\.com/([^/]*)(.*)%i', $data, $regs)) { $path = $regs[1]; $page = $regs[2]; } else { $path= ""; $page = ""; } echo $path; echo $page;
  2. Please do NOT bump your post unless an hour has passed and in reply no use MySQL or a flat file like everyone else!
  3. implement what exaclty (got an example?)
  4. do you mean this $data = "www.blah.com/ken2k7/page1.php"; if (preg_match('%www\.blah\.com/([^/]*)([^/]*)%i', $data, $regs)) { $result = $regs[1]; } echo $result;
  5. theirs aworkaround but due to the security risks most have been coved as their classed as exploits and as any that may know, i couldn't say as they are a major secuirty risk. think about it your viewing a page and any file on your HDD could be taken without you knowing.. this is why its read only
  6. Oh boy.. thats due to the server setup.. try to override it change $im_src = imagecreatefromjpeg($pic_name); to set_time_limit ( 0 ); //reset timeout timer ini_set('memory_limit', '30M'); $im_src = imagecreatefromjpeg($pic_name); let hope you don't join GaryDT's thread
  7. Erm your trying to set a form file element.. thats which is always readonly so can't be done as its a security risk..
  8. can you post the page ? in code tags (#)
  9. to update i think you want this for($i=0;$i<mysql_num_rows($earnings);$i++) { $row=mysql_fetch_assoc($earnings); $updateEarnings = $updateEarnings + $row[earnings];//add up amount } $updateEarnings = $updateEarnings + $_POST['tokens']; $result = mysql_query("UPDATE users SET $placeEarnt ='$updateEarnings' WHERE username = '$username'") or die(mysql_error()); revised (try this also) $placeEarnt = $_POST['placeEarnt']; $earnings = mysql_query("SELECT SUM($placeEarnt) as TotalAmount FROM users WHERE username = '$username'")or die(mysql_error()); $row=mysql_fetch_assoc($earnings); $updateEarnings = $row['TotalAmount'] + $_POST['tokens']; $result = mysql_query("UPDATE users SET $placeEarnt ='$updateEarnings' WHERE username = '$username'") or die(mysql_error());
  10. OK cool heres the solution <?php $game_time = $row['game_time'] if ( is_null($game_time) ) { echo "TBA" ; } else { echo $game_time ; }
  11. i think i know what the problem is client_list.php while ($crumb1 = mysql_fetch_array( $categorycrumb)) { echo "<a href=\"client_list.php?category=$category_num class=breadcrumb\">{$crumb1['title']}</a>"; } client_filter.php: Print "<a href=index.php class=breadcrumb>Home</a> :: "; while ($crumb1 = mysql_fetch_array( $categorycrumb)) { echo "<a href=client_list.php?category=$category_num class=breadcrumb>{$crumb1['title']}</a> :: "; } while ($crumb2 = mysql_fetch_array( $subcategorycrumb)) { echo "<a href=client_filter.php?category=$category_num&sub_category=$sub_category_title class=breadcrumb>{$crumb2['title']}</a>"; } // end while missing quotes ie <a href='client_list.php?category=$category_num' class='breadcrumb'>{$crumb1['title']}</a>
  12. i have a bad solution which i didn't want to say but if you need any solution.. <?php $game_time = $row['game_time'] var_dump($game_time); //add this line die;// add this line if ($game_time == '00:00:00') { echo "TBA" ; } else { echo $game_time ; } whats returned
  13. can you post the mod_rewrite
  14. LOL, yeah kinda had that thought awhile back.. but any idea, whats up with the server ?
  15. my bad.. i thought i added that link on the php.net! :-\
  16. Wrong section, you need the freelance section ALSO: if this is YOUR site then why not just edit the database directly! sounds a little scammy
  17. try this <div id="leftcontent"> <form><?php echo "<select name=\"names\">\n"; while($sub = mysql_fetch_array( $sub_list )) { echo "<option name=\"".$sub['id']."\">".$sub['title']."</option>\n"; } echo "</select>\n<br />"; ?></form> <form id="form1" name="form1" method="post" action=""> submit <input type="submit" name="Submit" value="Submit" /> </form> </div> i closed the select and added a break EDIT: as a note your form doesn't have a name, action, etc!
  18. ~cougths~ http://www.pcre.org/ http://uk2.php.net/pcre
  19. its not a problem with the php code its to do with the html setup of the page
  20. If using SQL then have a hyperlink like lists.php?sort=name&order=asc then just use those in your SQL statement.. make sense ?
  21. a [:alnum:] version <?php $data = "test"; if (eregi('^[[:alnum:]]{4,6}$', $data)) { # Successful match } else { # Match attempt failed } ?>
  22. ok you need to add some quotes i think thats all of them! <?php session_start(); if(!empty($namauser) AND !empty ($passuser)) { include "../dbconnect.php"; echo "<H3 align=center>Add Picture</H3> <FORM enctype='MULTIPART/FORM-DATA' METHOD='POST' ACTION='input_pic.php'> <table align=center border=0> <tr><td>Title: </td> <td><INPUT TYPE='TEXT' SIZE=60 NAME='title'></td></tr> <tr><td>Category: </td> <td><SELECT NAME='category'> <OPTION VALUE='0' SELECTED>--Choose Category--"; $tampil=mysql_query("SELECT * FROM category ORDER BY id"); while($data=mysql_fetch_array($tampil)) { echo "<OPTION VALUE='$data[id]'>$data[name]"; } echo "</OPTION></SELECT></td></tr> <tr><td>Upload:</td> <td> <input type='file' name='fupload'></td></tr> </table> <INPUT TYPE='SUBMIT' VALUE='Add'> </FORM><a href='foto2.php'>Show and delete pictures</a><BR> <a href='logout.php'>logout</a>"; }else{ echo "You have to login before adding new items<BR>"; echo "<a href='form_login.php'>Login</a>"; } ?> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; } body { background-color: #993300; } a { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #00FF00; font-weight: bold; } a:link { text-decoration: none; } a:visited { text-decoration: none; color: #FFFF00; } a:hover { text-decoration: underline; color: #FFFFFF; } a:active { text-decoration: none; } --> </styl
  23. $_SESSION['Posted_values'] = array(); foreach($_POST as $fld => $val) $_SESSION['Posted_values'][$fld] = $val; is the same as doing this $_SESSION['Posted_values'] = $_POST; which copies the $_POST array into the session 'Posted_values' not sure how else to explain it!! EDIT: nice one Wuhtzu
  24. step by step.. erm your need to do a search for that as no 2 apps will be the same!
  25. the php manual php.net!
×
×
  • 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.