Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Surely if you just want to include db_query.php X times, then your just need to do this //now we expand it while(list($username,$check) = each($myArray)) { include('db_query.php'; echo '<br />'; }
  2. Sounds like you messed up the sub domain creation to me Simple example file: /public_html/main_domain.php <?php $data = "I am HERE"; URL: http://www.madtechiesupport.com/Test_domain.php file: /public_html/Test_domain.php <?php include "main_domain.php"; echo $data; URL: http://subdomain.madtechiesupport.com/Test_domain2.php file: /public_html/subdomain/Test_domain2.php <?php include "../main_domain.php"; echo $data;
  3. Error 5 - "Access is denied" on a service means exactly that "Access is denied", so check the permissions of the folder where the data is stored and the account that services starts that service, Also what version of windows are you using ?
  4. the "@access private" is for the documentation only, however you can't make the global function private, your need to put it into a class first, if your having problems where you including that function too may times and are getting an error then you could do this if (!function_exists('pred')) { function pred($msg) { return "<p class='content' style='color:red;'> $msg</p>"; } }
  5. I am hardly "flaming".. personally I don't care if the code worked or didn't work, I was only pointing out that your response was disrespectful! to someone who is spending his free time to help. But well as no one is going to respond, I guess I'm also done!
  6. Working until PHP6.. as ereg will be removed! as is "DEPRECATED as of PHP 5.3.0" If you know RegEx your be fine.. but by your questions i assume you don't know it, $depositamt = $_POST['depositamt']; if (!preg_match("^[0-9]+$", $depositamt)) should be $depositamt = $_POST['depositamt']; if (!preg_match('/^[0-9]+$/', $depositamt)) translated into English that says if the following does not match depositamt must have 1 or more number from the start to the end (nothing else)
  7. I don't quite understand.. however i have written a script to choose to vote yes,no, decide later Now for portability reasons it will ask who you are first, (John,Sam or Peter) these are the users, and instead of using a database i am using a session, So no database is involved on this example How close am i ? (probably way off) <?php $UsersDB = array(1=>'John',2=>'Sam',3=>'Peter'); $votes = array(1=>'Yes',2=>'No',3=>'Later'); session_start(); if(!empty($_GET['rest_user'])) $_SESSION['member_id'] = 0; //setup votes table if(!isset($_SESSION['votes'])||isset($_GET['rest_votes'])) $_SESSION['votes'] = array(); //Select user if(!empty($_POST['Members'])){ $uID = $_POST['Members']; }else{ //members ID $uID = !empty($_SESSION['member_id'])?$_SESSION['member_id']:0; } $_SESSION['member_id'] = $uID; //Make choice (exclude Later or no selection) if(!empty($_POST['vote']) && $_POST['vote'] != 3){ $choice = $votes[$_POST['vote']]; $_SESSION['votes'][$uID] = $choice; } $_SESSION['member_id'] = $uID; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>voteing</title> </head> <body> <!-- clear url--> <form action="?" method="post"> <?php if($uID==0){ //List members echo "<p>who are you ?</p>"; foreach($UsersDB as $id=>$name) echo '<label><input type="radio" name="Members" value="'.$id.'" id="Members" />'.$name.'</label><br />'.PHP_EOL; }else{ //member selected echo "Hello ".$UsersDB[$uID]."<br />\n"; //OKAY if(!isset($_SESSION['votes'][$uID])){ echo "<p>Please vote</p>"; foreach($votes as $id=>$choice) echo '<label><input type="radio" name="vote" value="'.$id.'" id="vote" />'.$choice.'</label><br />'.PHP_EOL; }else{ echo "You selected ".$_SESSION['votes'][$uID]."<br />\n"; } } if(!empty($_GET['view_votes'])){ //would be done froma query echo "<BR />-----------------<BR />\n"; $y=0;$n=0; foreach($_SESSION['votes'] as $userid => $vote){ echo $UsersDB[$userid]." voted $vote<br/>\n"; if($vote=='Yes') $y++; if($vote=='No') $n++; } echo "<BR /><strong>Total</strong><BR />\n"; echo "YES: $y<BR />\n"; echo "NO: $n<BR />\n"; echo "-----------------<BR />\n"; } ?> <input name="User" type="submit" value="submit" /><br /> <a href="?rest_user=1">select another user</a><br /> <a href="?rest_votes=1">clear votes</a><br /> <a href="?view_votes=1">show votes</a><br /> </form> </body> </html>
  8. No errors here. either try clearing your cache
  9. change <a href='file.php'> to <a href='file.php?mycell=<?php echo $cell['value'];?>'> then in file.php, you can get the value of $cell['value'] by using $_GET['mycell']
  10. that because you have the $starttime+$incubation, remember $starttime is now a string, so you need to convert to a time or as its the currect time just use time() ie $starttime = date("Y-m-d H:i:s")."<br>"; print_r($starttime); $endtime = date("Y-m-d H:i:s", time()+$incubation); print_r($endtime); EDIT also i am not sure if this topic is solved or not ! if its not then click "Topic Not solved" at the bottom.. or people will skip the thread
  11. efficacious, I am not getting in a flame war, but be honest, how would you respond, if Imaulle said the following be honest would you continue to help ? (note the actual response is below) I have help a lot of people here and people who reply with "didn't work" or "already tried that" are really not helping themselves, add some mocking into the mix.. and no know wants to helps them! when I started i remember someone helping me and when they told me to do something i thought.. lol yeah right.. but tried it anyways.. and it worked.. i read the code over and over then worked out why it work.. the fact of the matter is either if you ask for "help" then your need to work with that person not against them, if you want a solution then pay for it. you seam to know CSS quite well so only help would be required (compared to most who need the solution but won't pay for it an insist they just need help) okay that's my 2pence .. well a pound, --MadTechie
  12. well that's just ungraceful.. Let me get this straight you get stuck ask for help them throw it back, well that says a lot about you.
  13. oow someone pointed me here! a post with my name in the title and I'm not in trouble.. YAY.. Your very welcome
  14. lol, looks like you missed my edit
  15. remember to either fix the existing data manually and/or to re-upload a new photo night
  16. hence i concatenated the path and name, IF you are sure the full path is in that field, (check the database) your need up the varchar length (255) should do it, then re-upload the image, and test the new image (or update he database field manually) its gone 5am here.. so i am going to hit the sack EDIT: if your only using imagepath as the full path+name then your need to update the code <a href="image_show.php?id=<?php echo $row_Recordset1['id'];?>"><img src="/<?php echo $row_Recordset1['photopath'].$row_Recordset1['name'] ;?>" height="200" width="200"/></a> to <a href="image_show.php?id=<?php echo $row_Recordset1['id'];?>"><img src="/<?php echo $row_Recordset1['photopath'];?>" height="200" width="200"/></a> and echo " photo: <img src=\"/{$row['photopath']}{$row['name']}\" height=\"200px\" width=\"200px\" />"; to echo " photo: <img src=\"/{$row['photopath']}\" height=\"200px\" width=\"200px\" />"; however you NEED to update the photopath varchar length
  17. Humm that doesn't match the output
  18. OKay the last update should show the image on the page with the link Now update the photo line in the file image_show.php to echo " photo: <img src=\"/{$row['photopath']}{$row['name']}\" height=\"200px\" width=\"200px\" />"; EDIT: i really don't see the point in this question Yeah fairly easy to guess!
  19. okay.. problem #1 sorted Now We need a little more details about the paths So can you give up the url of the html file and a url of the images for example http://localhost/image_show.php?id=34 http://localhost/uploads/myimage.jpg Now it seams the image filename is also missing so try changing <a href="image_show.php?id=<?php echo $row_Recordset1['id'];?>"><img src=<?php echo $row_Recordset1['photopath'] ;?> height="200" width="200"/></a> to (the WHOLE line) <a href="image_show.php?id=<?php echo $row_Recordset1['id'];?>"><img src="/<?php echo $row_Recordset1['photopath'].$row_Recordset1['name'] ;?>" height="200" width="200"/></a>
  20. good point PFMaBiSmAd, the body would be parsed so $eventid would be actual id
  21. Yep, id wasn't sent Try this See updates //Added ID $query_Recordset1 = "SELECT `id`, `name`, `photopath`, `state` FROM photo"; //uPDATED <a href="image_show.php?id=<?php echo $row_Recordset1['id'];?>"><img src=<?php echo $row_Recordset1['photopath'] ;?> height="200" width="200"/></a> full code <?php require_once('myconn.php'); if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_Recordset1 = 40; $pageNum_Recordset1 = 0; if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; mysql_select_db($database_myconn, $myconn); //Added ID $query_Recordset1 = "SELECT `id`, `name`, `photopath`, `state` FROM photo"; $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1, $myconn) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); } $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1; ?> <div id="photos"> <table border=""> <?php $i=0; $numperpage=8; ?> <?php do { ?> <?php if ($i%$numperpage==0) echo "<tr>"; ?> <td align="center"> //uPDATED <a href="image_show.php?id=<?php echo $row_Recordset1['id'];?>"><img src=<?php echo $row_Recordset1['photopath'] ;?> height="200" width="200"/></a> <br/> <?php echo $row_Recordset1['name']; ?><br/> <?php echo $row_Recordset1['state']; ?></td> <?php $i++; if ($i%$numperpage==0) echo "</tr>"; ?> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </table> </div> </body> </html> <?php mysql_free_result($Recordset1); ?>
  22. I agree, for example PHP will use the name on an unset constance as the value here is a typical example, when it should be $_POST['name'] Technically both will work but .. come on... (well now that's out of my system, i'll wait for a response from Zelphics, sorry for the temporary hi-jack )
  23. Erm.. you put the link in the body of the email! $body = '<a href="/ticket.php?eventid=' . $eventid . '">Ticket</a>'; or re-phrase the question
×
×
  • 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.