
conan318
Members-
Posts
195 -
Joined
-
Last visited
Never
Everything posted by conan318
-
is something like this possiable? if so can you help with the correct syntax thanks echo '<td><a href="javascript: window.open('cal.php', 'window_name', 'width = '500', height = '500');">Check Calender and Events</a>;
-
<?php $ext_a = explode(".", $_FILES['uploadedfile']['name']); $ext = $ext_a[1]; /* hashes the file name with the date and time to genrate a uniue file name*/ $img=md5($_FILES['uploadedfile']['name'] . date("m.d.y H:m:s")) . "." . $ext; $target_path = "back/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $insert_user=mysql_query("INSERT INTO main.back (img) VALUES ('$img')") ; if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } all working now i just got to put in a check to make sure its a img file being uploaded
-
I know what error means the only variable i have set is $img but i am unclear where the name is variable is meant to be coming from. and the script i have working on my other page does not set a name variable. i was amusing the name was coming form the $_files global variable.
-
i just changed the code to this and named my submit button submit and now getting same error. Notice: Undefined index: name in C:\wamp\www\Kurri\background.php on line 37 <?php mysql_connect("localhost", "admin", "admin")or die("cannot connect"); mysql_select_db("main")or die("cannot select DB"); if(isset($_POST['submit'])){ $img=$_POST['img']; /* explode breaks down the string*/ $ext_a = explode(".", $_FILES['img']['name']); $ext = $ext_a[1]; /* hashes the file name with the date and time to genrate a uniue file name*/ $img=md5($_FILES['img']['name'] . date("m.d.y H:m:s")) . "." . $ext; $target = "img/"; $target = $target .basename($img); /* Now we will write a query to insert user details into database */ $insert_user=mysql_query("INSERT INTO main.background (img) VALUES '$img')") ; //Writes the photo to the server if(move_uploaded_file($_FILES['img']['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['name']['img']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } }
-
sorry i posted the error in the code // Notice: Undefined index: img in C:\wamp\www\Kurri\background.php on line 9 and Undefined index: name in C:\wamp\www\Kurri\background.php on line 36 then gives the message file has been upload but the file has not been uploaded.
-
background.php 2 undefined errors i use this same script else where on my site and have <?php mysql_connect("localhost", "admin", "admin")or die("cannot connect"); mysql_select_db("main")or die("cannot select DB"); $img=$_POST['img'];// Notice: Undefined index: img in C:\wamp\www\Kurri\background.php on line 9 /* explode breaks down the string*/ $ext_a = explode(".", $_FILES['img']['name']); $ext = $ext_a[1]; /* hashes the file name with the date and time to genrate a uniue file name*/ $img=md5($_FILES['img']['name'] . date("m.d.y H:m:s")) . "." . $ext; $target = "img/"; $target = $target .basename($img); /* Now we will write a query to insert user details into database */ $insert_user=mysql_query("INSERT INTO main.background (img) VALUES '$img')") ; //Writes the photo to the server if(move_uploaded_file($_FILES['img']['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['name']['img']). " has been uploaded, and your information has been added to the directory"; //Notice: Undefined index: name in C:\wamp\www\Kurri\background.php on line 35 } else { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } mb-admin.html <div class="appearance"> <form method="post" action="background.php" enctype="multipart/form-data"> <label for="img">Change Background Image</label> <input type="file" name="img" /><br /> <input type="submit" value="submit" /> </form> </div>
-
ahhh the echo did the trick thanks again.
-
is the style element meant to be in the head of the document cause i have tryed it there with no luck either. if i add the image in css file it works fine. but for some reason i cant embed it. strange
-
here a good simple step by step tutorial i used to make my login system http://www.phpeasystep.com/phptu/6.html
-
Hi i am trying to write a small script to change the background img from my admin small panel i am making im not getting errors nor is the background img for my content changing. if i echo $background it display the img url correctly. can anyone see what where its going wrong thanks again $background; $data = mysql_query("SELECT * from main.background ORDER BY id DESC LIMIT 1;") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { $background='img/'.$info['img']; // have also tryed $background="img/".$info['img']; } ?> <!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> <LINK REL="SHORTCUT ICON" HREF="img/fav.png"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="mb.css" rel="stylesheet" type="text/css" /> <title>Mongrel Bastards</title> </head> <body> <style type="text/css"> .content{ background-image:url('<?php $background ?>'); height:2500px; width:1008;} </style>
-
i am having a css problem where i am trying to pull mutable records from the database but they wont display right. i need them to display vertically one under the next. atm there displaying kinda on top of each other the css. thank you .next_rideb{ width:200px; border-style:groove; margin-left: 750px; margin-top:455px; } .next_ride{ width:200px; background-color:#FFF; border-style:groove; padding: 5px; position:absolute; } The Php <div class="nextrideb"> <?php $dMonth = $_REQUEST["month"]; $dYear = $_REQUEST["year"]; $data = mysql_query("SELECT * from main.mbadmin WHERE mbadmin.month=$dMonth AND mbadmin.year=$dYear ORDER BY day DESC LIMIT 10;") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { Echo "<div class='next_ride'>"; Echo "Next Ride Updated On"; Echo "<br>"; echo $info['mk'] ; echo "<hr>"; echo "<br>"; Echo $info['nextride'] ; Echo "<br>"; Echo "<hr>"; Echo "</div>"; } echo "<br>"; ?> </div> <?php
-
wait for that was not it lol i changed the date on my computer thats why its not working lol i am a tool lol
-
yup true.. but that was not the problem needed $date= $dMonth-1; all good now thanks
-
Should be str8 forward got it to work once then add the code to my main page and wont work now $dMonth = $_REQUEST["month"]; $dYear = $_REQUEST["year"]; $data = mysql_query("SELECT * from main.mbadmin WHERE mbadmin.month=$dMonth AND mbadmin.year=$dYear ORDER BY day DESC LIMIT 1;") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { echo $info; Echo "<div class='next_ride'>"; Echo "Next Ride Updated On"; Echo "<br>"; echo $info['mk'] ; echo "<hr>"; echo "<br>"; Echo $info['nextride'] ; Echo "<br>"; Echo "<hr>"; Echo "</div>"; }
-
i found a calender tutorial though the link you gave me and the calender works fine and like the look of it. but i need some advice on how i can modify so i can highlight which day it is and how i can turn it into an event calender. <div class="cal"> <?php $monthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n"); if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y"); $cMonth = $_REQUEST["month"]; $cYear = $_REQUEST["year"]; $prev_year = $cYear; $next_year = $cYear; $prev_month = $cMonth-1; $next_month = $cMonth+1; if ($prev_month == 0 ) { $prev_month = 12; $prev_year = $cYear - 1; } if ($next_month == 13 ) { $next_month = 1; $next_year = $cYear + 1; } ?> <html> <body> <table width="200"> <tr align="center"> <td bgcolor="#999999" style="color:#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" align="left"> <a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $prev_month . "&year=" . $prev_year; ?>" style="color:#FFFFFF">Previous</a></td> <td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $next_month . "&year=" . $next_year; ?>" style="color:#FFFFFF">Next</a> </td> </tr> </table> </td> </tr> <tr> <td align="center"> <table width="100%" border="0" cellpadding="2" cellspacing="2"> <tr align="center"> <td colspan="7" bgcolor="#999999" style="color:#FFFFFF"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></strong></td> </tr> <tr> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>M</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>W</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>F</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> </tr> <?php $timestamp = mktime(0,0,0,$cMonth,1,$cYear); $maxday = date("t",$timestamp); $thismonth = getdate ($timestamp); $startday = $thismonth['wday']; for ($i=0; $i<($maxday+$startday); $i++) { if(($i % 7) == 0 ) echo "<tr>\n"; if($i < $startday) echo "<td></td>\n"; else echo "<td align='center' valign='middle' height='20px'>". ($i - $startday + 1) . "</td>\n"; if(($i % 7) == 6 ) echo "</tr>\n"; } ?> </table> </td> </tr> </table> </div>
-
thanks will give it a go
-
does anyone know a good php event calender tutorial? im looking to make a event calender where the events can be updated though the admin section of my page.
-
<form method="post" action="lastride.php" enctype="multipart/form-data"> <h2>Last ride report<h2> <textarea name="last" rows="10" cols="100"> Add your last ride report here </textarea> <?php mysql_connect("localhost", "", "")or die("cannot connect"); mysql_select_db("main")or die("cannot select DB"); $data=$_POST['last']; $data = mysql_real_escape_string($data); $mk=date("Y/m/d"); $insert_nextride=mysql_query("INSERT INTO main.last (id,ridereport,date) VALUES ('','$data','$mk')"); if($insert_nextride) { echo "Next Ride updated"; header("location:mb-admin.html"); die();} else { echo "error in registration".mysql_error(); } ?> ridereport not inserting data into the database but the date is. thinking its something to do with that data not being passed from the from. had it working yesterday and now its broken lol
-
Echo "<a href='{$info['link']}'>.$info['name']</a>"; Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\Kurri\login_success.php on line 64
-
i just used this $data = mysql_real_escape_string($data); and is all working good
-
topic solved once again thanks mate
-
does the varchar not allow qoutes?? example August 28th an Out N' back from the Station departing 8 AM. Then, September 11th and October 16th We also have a fair crew riding Wollomi Wild Ride so sign up on line this give's an error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2011/08/05')' at line 1 remove the qoute ' and it works fine August 28th an Out N back from the Station departing 8 AM. Then, September 11th and October 16th We also have a fair crew riding Wollomi Wild Ride so sign up on line
-
thanks mate added session start
-
thanks again guys the short tag <? was causing the problem all is well again