-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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;
-
Please do NOT bump your post unless an hour has passed and in reply no use MySQL or a flat file like everyone else!
-
Re-populating text fields for Image Upload?
MadTechie replied to Solarpitch's topic in PHP Coding Help
implement what exaclty (got an example?) -
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;
-
Re-populating text fields for Image Upload?
MadTechie replied to Solarpitch's topic in PHP Coding Help
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 -
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
-
Re-populating text fields for Image Upload?
MadTechie replied to Solarpitch's topic in PHP Coding Help
Erm your trying to set a form file element.. thats which is always readonly so can't be done as its a security risk.. -
Re-populating text fields for Image Upload?
MadTechie replied to Solarpitch's topic in PHP Coding Help
can you post the page ? in code tags (#) -
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());
-
OK cool heres the solution <?php $game_time = $row['game_time'] if ( is_null($game_time) ) { echo "TBA" ; } else { echo $game_time ; }
-
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>
-
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
-
can you post the mod_rewrite
-
LOL, yeah kinda had that thought awhile back.. but any idea, whats up with the server ?
-
[SOLVED] How to do this without using globals
MadTechie replied to AV1611's topic in PHP Coding Help
my bad.. i thought i added that link on the php.net! :-\ -
script to automaticly fill in fields on a website
MadTechie replied to sillysillysilly's topic in PHP Coding Help
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 -
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!
-
~cougths~ http://www.pcre.org/ http://uk2.php.net/pcre
-
its not a problem with the php code its to do with the html setup of the page
-
If using SQL then have a hyperlink like lists.php?sort=name&order=asc then just use those in your SQL statement.. make sense ?
-
a [:alnum:] version <?php $data = "test"; if (eregi('^[[:alnum:]]{4,6}$', $data)) { # Successful match } else { # Match attempt failed } ?>
-
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
-
$_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
-
Approach to authentication when integrating an app
MadTechie replied to tlavelle's topic in PHP Coding Help
step by step.. erm your need to do a search for that as no 2 apps will be the same! -
[SOLVED] How to do this without using globals
MadTechie replied to AV1611's topic in PHP Coding Help
the php manual php.net!