PHP - If Anyone Could Give Me Any Suggestions On This
How to do #3 by a PHP page instead? mainly so
that there wouldn't be a need to export the sql after doing #2 then import it into the online phpmyadmin(#3) #1. Convert database from foxpro to sql #2. Change some fields in the sql table #3. Upload to phpmyadmin Is it possible to create a code to export from the server and then import the sql online? like by making use of mysql_fetch_array() and insert into Similar TutorialsIn a Switch statement, can you give the Default: a specific name, maybe like this... switch ($resultsCode){ // Missing Primary Key. case 'COMMENT_MISSING_KEYS_2050': echo '<h1>System Error</h1>'; echo '<p>A Fatal Error has occurred. Please contact the System Administrator. (2050)</p>'; break; default 'DEFAULT_CATCHALL_ERROR_CODE_9999': echo '<p>You have reached the catch-all error code... (9999)</p>'; break; Debbie what i want is to upload my informations to database when i press the submit button. but if any field is empty it should show a text that all fields are required but in the same page(up or down to the form). However with this code my database is not working>informations are not send to the database. why?Any sggesstions? Code: [Select] <?php // Start a session for error reporting session_start(); //Connect to database require("includes/connect_to_mysql.php"); //check if the button is pressed if(isset($_POST['submit'])){ // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/png"); if (in_array($file['type'], $valid_types)) return 1; return 0; } // This variable is the path to the image folder where all the images are going to be stored // Note that there is a trailing forward slash $TARGET_PATH = "upload_form_images/"; // Get our POSTed variables $name = $_POST['name']; $surname = $_POST['surname']; $email = $_POST['email']; $city = $_POST['city']; $details = $_POST['details']; $price = $_POST['price']; $image = $_FILES['image']; // Sanitize our inputs $name = mysql_real_escape_string($name); $surname = mysql_real_escape_string($surname); $email = mysql_real_escape_string($email); $city = mysql_real_escape_string($city); $details = mysql_real_escape_string($details); $price = mysql_real_escape_string($price); $image['name'] = mysql_real_escape_string($image['name']); // Build our target path full string. This is where the file will be moved do // i.e. images/picture.jpg $TARGET_PATH .= $image['name']; // Make sure all the fields from the form have inputs if ( $name == "" || $surname == "" || $email == "" || $city == "" || $details == "" || $price == ""|| $image['name'] == "" ) { $_SESSION['error'] = "Te gjithe fushat duhet plotesuar"; echo "Te gjithe fushat duhet plotesuar"; header("Location: upload_form.php"); exit; } // Check to make sure that our file is actually an image // You check the file type instead of the extension because the extension can easily be faked if (!is_valid_type($image)) { $_SESSION['error'] = "Fotografite duhet te jene te formateve jpg, jpeg, bmp, gif, ose png"; header("Location: upload_form.php"); exit; } // Here we check to see if a file with that name already exists // You could get past filename problems by appending a timestamp to the filename and then continuing if (file_exists($TARGET_PATH)) { $_SESSION['error'] = "Ju lutem nderroni emrin e fotos."; header("Location: upload_form.php"); exit; } /* // See if that product name is an identical match to another product in the system $sql = mysql_query("SELECT id FROM upload_form WHERE name='$name' LIMIT 1"); $productMatch = mysql_num_rows($sql); // count the output amount if ($productMatch > 0) { $_SESSION['error'] = 'Ju lutem nderroni emrin sepse egziston ne databaze'; header("Location: upload_form.php"); exit(); } */ // Lets attempt to move the file from its temporary directory to its new home if (move_uploaded_file($image['tmp_name'], $TARGET_PATH)) { // NOTE: This is where a lot of people make mistakes. // We are *not* putting the image into the database; we are putting a reference to the file's location on the server $sql = "insert into people (name, surname, email, city, details, price, filename) values ('$name', '$surname', '$email', '$city', '$details', '$price', '" . $image['name'] . "')"; $result = mysql_query($sql) or die ("Futja e te dhenave ne databaze DESHTOI: " . mysql_error()); echo "Shtimi i te dhenave u krye me SUKSES"; exit; } else { // A common cause of file moving failures is because of bad permissions on the directory attempting to be written to // Make sure you chmod the directory to be writeable $_SESSION['error'] = "Shtimi i te dhenave NUK u krye me Sukses. Ju lutem provoni perseri"; header("Location: upload_form.php"); exit; } } ?> <!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>Qiraja.com</title> <link rel="stylesheet" href="css/style.css" type="text/css" media="all" /> <!--[if lte IE 6]><link rel="stylesheet" href="css/ie6.css" type="text/css" media="all" /><![endif]--> <!--[if IE]><style type="text/css" media="screen"> #navigation ul li a em { top:32px; } </style><![endif]--> </head> <body> <!-- Header --> <div id="header"> <div class="shell"> <!-- Logo --> <h1 id="logo"><a href="#">Company Name</a></h1> <!-- End Logo --> <!-- Navigation --> <div id="navigation"> <ul> <li><a href="#">Prishtine<span><em></em></span></a></li> <li><a href="#">Prizren<span><em></em></span></a></li> <li><a href="#">Ferizaj<span><em></em></span></a></li> <li><a href="#">Peje<span><em></em></span></a></li> <li><a href="#">Mitrovice<span><em></em></span></a></li> <li><a href="#">Gjilan<span><em></em></span></a></li> <li class="last"><a href="#">Gjakove<span><em></em></span></a></li> </ul> </div> </div> </div> <div id="slider"> <div class="shell"> <!-- Slides --> <div class="slides"> <ul> <!-- Slide --> <li> <form action="upload_form.php" enctype="multipart/form-data" name="myForm" id="myform" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="center">Name</td> <td width="80%"><label> <input name="name" type="text" id="name" size="25" /> </label></td> </tr> <tr> <td align="center">Surname</td> <td><label> <input name="surname" type="text" id="surname" size="25" /> </label></td> </tr> <tr> <td align="center">Email</td> <td><label> <input name="email" type="text" id="email" size="25" /> </label></td> </tr> <tr> <td align="center">City</td> <td><select name="city" id="city"> <option value=""></option> <option value="Prishtine">Prishtine</option> <option value="Prizren">Prizren</option> <option value="Ferizaj">Ferizaj</option> <option value="Peje">Peje</option> <option value="Mitrovice">Mitrovice</option> <option value="Gjilan">Gjilan</option> <option value="Gjakove">Gjakove</option> </select></td> </tr> <tr> <td align="center">Cmimi</td> <td><label> <input name="price" type="text" id="price" size="10" /> € </label></td> </tr> <tr> <td align="center">Fotografite</td> <td><label> <input type="file" name="image" id="image" /> </label></td> </tr> <tr> <td> </td> <td align="right"><label> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> <input type="submit" name="submit" id="submit" value="Shto te dhenat" /> </label></td> </tr> </table> </form> </li> <!-- End Slide --> <!-- Slide --> <li> <div class="slide-info"> <h2><span>Reklamo</span> Shtepine</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. Sed turpis sem, interdum sit amet egestas a, mattis non libero. Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam.</p> <p>Quisque quis vestibulum turpis. Sed venenatis ipsum laoreet elit pulvinar vitae pharetra massa dignissim. Curabitur ligula sapien, auctor ut porttitor a, ultricies lobortis dui. Suspendisse lacinia tellus a diam rutrum rhoncus. </p> <a href="#" class="more">read more</a></p> </div> <span class="slide-image image1"></span> </li> <!-- End Slide --> <!-- Slide --> <li> <div class="slide-info"> <h2><span>Reklamo</span> Apartmanin</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. Sed turpis sem, interdum sit amet egestas a, mattis non libero. Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam.</p> <p>Quisque quis vestibulum turpis. Sed venenatis ipsum laoreet elit pulvinar vitae pharetra massa dignissim. Curabitur ligula sapien, auctor ut porttitor a, ultricies lobortis dui. Suspendisse lacinia tellus a diam rutrum rhoncus. </p> <a href="#" class="more">read more</a></p> </div> <span class="slide-image image1"></span> </li> <!-- End Slide --> </ul> </div> <!-- End Slides --> </div> </div> <!-- End Slider --> <!-- Slider Nav --> <div id="slider-navigation"> <div class="shell"> <ul> <li><a href="index.php" class="active">Kthehu ne fillim<strong>Home</strong><em class="ico1"></em></a></li> <li><a href="upload_form.php">Shto<strong>Upload</strong><em class="ico2"></em></a></li> <li class="last"><a href="contact_form.php">Kontakti<strong>Contact</strong><em class="ico3"></em></a></li> </ul> </div> </div> <!-- End Slider Nav --> <!-- Main --> <div id="main"> <div class="shell"> <!-- Cols --> <div class="cols"> <div class="cl"> </div> <!-- Col --> <div class="col"> <h3>Sed Turpis sem</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. Sed turpis sem, interdum sit amet egestas a, mattis non libero.<br /><a href="#" class="more">read more</a></p> <p>Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam. <br /><a href="#" class="more">read more</a></p> </div> <!-- End Col --> <!-- Col --> <div class="col"> <h3>Ligula amet augue</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. <br /><a href="#" class="more">read more</a></p> <p>Sed turpis sem, interdum sit amet egestas a, mattis non libero. Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam. <br /><a href="#" class="more">read more</a></p> </div> <!-- End Col --> <!-- Col --> <div class="col col-last"> <h3>Ligula amet augue</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. <br /><a href="#" class="more">read more</a></p> <p>Sed turpis sem, interdum sit amet egestas a, mattis non libero. Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam. <br /><a href="#" class="more">read more</a></p> </div> <!-- End Col --> <div class="cl"> </div> </div> <!-- End Cols --> </div> </div> </body> </html> Hi I was playing with a poll, but for some reasons it won't email me(the bottom most part). Where did I go wrong? Also any suggestions on how to improve this? Thanks your the best guys! <?php include('config.php'); $name = strip_tags($_POST['name']); $email = $_POST['email']; $qst_id=strip_tags($_POST['qst_id']); //if no ajax $opt = strip_tags($_POST['opt']); $s_id = $_SERVER['REMOTE_ADDR']; //validate email if (!preg_match('/^.+@.+\..{2,3}$/',$email)); { $email = 'email was blocked'; } if (strlen($name) >= 50) { $name = 'name was blocked'; } if ($opt == '') { $vote ="no"; } elseif (($opt=='Yes') || ($opt=='No')) { $qt=mysql_query("insert into plus_poll_ans(s_id,qst_id,opt) values('".$s_id."','".$qst_id."','".$opt."')"); } else { $vote = "no"; } echo "<font size='2' face='Verdana' color='#000000' style='font-size:1.2em;'> Declaration of Faith</font>"; $qst_id=1; // change this to change the poll /* Find out the question first */ $fg=mysql_query("select qst from plus_poll where qst_id='".$qst_id."'"); $row=mysql_fetch_object($fg); echo "<br><b><br>$row->qst</b><br>"; // display the question /* for percentage calculation we will find out the total number of answers ( options submitted ) given by the visitors */ $rt=mysql_num_rows(mysql_query("select ans_id from plus_poll_ans where qst_id='".$qst_id."'")); /* Find out the answers and display the graph */ $query="select count(*) as no,qst,plus_poll_ans.opt from plus_poll,plus_poll_ans where plus_poll.qst_id=plus_poll_ans.qst_id and plus_poll.qst_id='".$qst_id."' group by opt desc "; $rs=mysql_query($query); //count the answers by yes or no $count= "SELECT opt, count(opt) FROM plus_poll_ans GROUP BY opt desc"; $result = mysql_query($count) or die(mysql_error()); //separate the results while($row = mysql_fetch_array($result)){ $total_opt[] = $row['count(opt)']; } // Print out result echo "<table cellpadding='0' cellspacing='0' border='0' width='100%' >"; $i = 0; while($noticia = mysql_fetch_array($rs)){ echo "<tr> <td width='5%' bgcolor='#F1F1F1'> <font size='1' face='Verdana' color='#000000'>$noticia[opt]</font></td>"; $width2=$noticia['no'] *10 ; /// change here the multiplicaiton factor ////////// $ct=($noticia[no]/$rt)*100; $ct=sprintf ("%01.2f", $ct); // number formating echo " <td width='20%' bgcolor='#F1F1F1'> <font size='1' face='Verdana' color='#000000'>($ct %)</font></td><td width='60%' align='left' bgcolor='#F1F1F1'> <img src='graph.jpg' height=10 width=$width2>"; echo "</td><td width='15%' align='right'>"; echo "<font size='1' face='Verdana' color='#000000'>".$total_opt[$i]; echo " votes"; echo "</font></td>"; echo "</tr>"; echo "<tr> <td bgcolor='#ffffff' colspan=2>"; echo "</td>"; echo "</tr>"; $i=$i+1; } echo "<tr><td></td><td></td><td><font size='1' face='Verdana' color='#000000'>Total Votes:</font></td><td align='right'>"; //count the total votes $count = 'select count(ans_id) from plus_poll_ans'; $count = mysql_query($count); $count = mysql_fetch_array($count); $total_count = $count['count(ans_id)']; echo "<font size='1' face='Verdana' color='#000000'>".$total_count." votes</font>"; echo "</td></tr>"; echo "</table>"; echo "</font>"; if ($vote!='no') { $to = 'person1@example.com, person2@example.com'; $subject = 'Someone just made a declaration of faith'; $message = "Someone from the ip address ".$s_id; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: Vote Detector <website@example.com>'. "\r\n"; if ($name!='') { $message = $message." with the name ".$name; } if ($email!='') { $message = $message." with email ".$email; } $message = $message." voted "."yes<br/>"; $message = $message."total number of people who declared their faith: ".$total_count." people<br/>"; $message = $message."with a total of ".$total_opt[0]." people saying yes"; $message = $message." and a total of ".$total_opt[1]." people saying no<br/>"; mail($to, $subject, $message, $headers); } ?> Hi, Hope this is the right place for this... I have php routines that print itineraries. For some reason the timestamp (1351378800) returns the same date Sunday 28th October (2012) as the time stamp (1351465200). $count = 0; while ($count <= ($nights+1)) { echo date ('l', $startdate1)." (".$startdate1.")"; echo "<br>"; echo date ('jS F', $startdate1); $startdate1 += 86400; // more code } Any ideas? Many thanks, Peter I am trying to learn PHP basics, and I just cant figure out a way to insert color when certain conditions are met. In my code below, I want to print out red color on lets say, odd numbers from 20-49. Appreciate your help big time! <?php for ($i=20; $i<=49; $i++){ echo "$i<br>"; } ?> Hey, I would like to get some practice in the following areas: - arrays (including multidimensional and associative) - functions and their return values I would appreciate it if anyone could give me/point me to some exercises/challenges. Thanks! I wanna give error messages if the user dont enter their name, email or comments. I trıed to do it but mine didnt work. Please help me do it. Index.php page Code: [Select] <html> <head> <title>Guestbook</title> </head> <body> <font color="#CC0000" size="+2">Please sign our guestbook</font> <br \> <br \> <?php echo "<form name=\"Guestbook\" action=\"confirm.php\" method=\"post\">\n"; echo "<table bgcolor=\"#DAE5CD\">\n"; echo " <tr>\n"; echo " <td valign=\"top\">Name: </td>\n"; echo " <td><input type=\"text\" name=\"name\" size=\"25\" value=\"Your Name\"></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td valign=\"top\">E-mail:</td>\n"; echo " <td><input type=\"text\" name=\"email\" size=\"25\" value=\"example@mail.com\"></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td valign=\"top\">Comments:</td>\n"; echo " <td><textarea rows=\"5\" cols=\"30\" name=\"comments\">Comments</textarea></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td></td>\n"; echo " <td align=\"right\"><input type=\"submit\" name=\"submit\" value=\"Submit\"> <input type=\"reset\" value=\"Clear\"> </td>\n"; echo " </tr>\n"; echo "</table>\n"; echo "</form> "; ?> </body> </html> confirm.php page Code: [Select] <html> <head> <title> Submission receieved! </title> </head> <body> <font size="+2" color="#00B0EB">Your submission has been sent successfully!</font><br /> <br /> <?php //extract($_REQUEST); if (!isset($_POST["$submit"])) { if (empty($_POST["name"])) { echo "Please enter your name!"; } else if (empty($_POST["email"])) { echo "Please enter your E-mail"; } else if (empty($_POST["comments"])) { echo "Please enter some text"; } } ?> <table bgcolor="#DAE5CD" width="%50" cellpadding="5"> <tr> <td valign="top" width="75">Name : </td> <td> <?php echo $_POST["name"];?> </td> </tr> <tr> <td valign="top">E-Mail : </td> <td> <?php echo $_POST["email"]; ?> </td> </tr> <tr> <td valign="top">Comments :</td> <td> <?php echo $_POST["comments"]; ?> </td> </tr> </table> </body> </html> This is what I am using and it returns the entire schedule for the whole league... if ($display == "schedule") { $schedule = $ffn->getSchedule(); echo '<h4>Season Schedule</h4>'; echo '<p>Season: ', $schedule->Season, '</p>'; foreach($schedule->Games AS $game) { echo '<p>'; echo 'Week: ', $game->Week, ' ', $game->AwayTeam, ' at ', $game->HomeTeam, ' on ', date("M j, Y", strtotime($game->GameDate)), ' at ', $game->GameTime, ' ', $schedule->Timezone; echo '</p>'; } } BUT what I would like to do is search the info and only post info for one team... I have tried this... if ($display == "schedule") { $schedule = $ffn->getSchedule(); echo '<h4>Season Schedule</h4>'; echo '<p>Season: ', $schedule->Season, '</p>'; foreach($schedule->Games AS $game) if (AwayTeam == 'DAL") { echo '<p>'; echo 'Week: ', $game->Week, ' ', $game->AwayTeam, ' at ', $game->HomeTeam, ' on ', date("M j, Y", strtotime($game->GameDate)), ' at ', $game->GameTime, ' ', $schedule->Timezone; echo '</p>'; } } ELSE IF (HomeTeam == 'DAL') if ($display == "schedule") { $schedule = $ffn->getSchedule(); echo '<h4>Season Schedule</h4>'; echo '<p>Season: ', $schedule->Season, '</p>'; foreach($schedule->Games AS $game) { echo '<p>'; echo 'Week: ', $game->Week, ' ', $game->AwayTeam, ' at ', $game->HomeTeam, ' on ', date("M j, Y", strtotime($game->GameDate)), ' at ', $game->GameTime, ' ', $schedule->Timezone; echo '</p>'; } } Else echo "No Games Scheduled" Problem is it's not working... how can I just pull the info for DAL and only display that info. The info is coming from an XML file... Thanks in Advance! Hello there, Thank you for taking the time to visit my thread. I've been brainstorming for the past few days trying to establish the best method of a content management system. I'm curious since you are all highly advanced PHP coders what you think the best method of content management is I would like it to be presented in the URL in the following method: file.php?v=example So please share your ideas remember there is never a stupid suggestion I want to hear all your possibilities please! This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=308872.0 i have made my own website suggestion box but when i start typing in on my websites search box google chrome automatically suggests other words and you can't see underneath. I don't want this to happen to other people viewing my website. Is there any sort of code i an put on my website to stop this? hi Guys..............i am final year student and i need to submit a project that should me medium to large size and i want to build it on PHP so it would be very kind if you can kindly suggest me topics for the same however there is just one restriction the process that i cannot build anything like management systems or social networking websites the idea should be new and catchy and ya one more thing no e-com websites as well.....................looking ahead for your advice..................thank you. I'm getting a '500 Internal Server' and 'Premature end of script headers..' errors in the process of uploading a file. This occurs consistently with files > 2MB but also (very occasionally) w/ smaller files. The target directories are beneath the web root folder, so I don't think it's a permissions issue. I've set the following in my php5.ini: post_max_size = 8M, upload_max_filesize = 8M max_input_time = 360 max_execution_time = 360 Trace code/logging reveals that the error occurs even before my upload code is entered (which uses (move_uploaded_file()). So what would cause that? Any suggestions on how to debug this are very much appreciated! Hi all, I need some help. My ob_get_contents() is empty and gives me a empty file everytime. I tried different cache script it is still the same. I have also tried fwrite($fp, 'hello') In this case, it successfully writes to the file. But when i use ob_start and ob_get_contents, it will be empty. can anyone please advice. My simplified script is here <?php // Settings $cachedir = 'cache/'; // Directory to cache files in (keep outside web root) $cachetime = 600; // Seconds to cache files for $cacheext = 'html'; // Extension to give cached files (usually cache, htm, txt) // Ignore List $ignore_list = array( '/rss.php', '/search/' ); // Script $page = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; // Requested page $cachefile = $cachedir . md5($page) . '.' . $cacheext; // Cache file to either load or create $ignore_page = false; for ($i = 0; $i < count($ignore_list); $i++) { $ignore_page = (strpos($page, $ignore_list[$i]) !== false) ? true : $ignore_page; } $cachefile_created = ((@file_exists($cachefile)) and ($ignore_page === false)) ? @filemtime($cachefile) : 0; @clearstatcache(); // Show file from cache if still valid if (time() - $cachetime < $cachefile_created) { //ob_start('ob_gzhandler'); @readfile($cachefile); //ob_end_flush(); exit(); } // If we're still here, we need to generate a cache file ob_start(); ?> All My HTML AND PHP CODES TO RUN THE SITE <?php // Now the script has run, generate a new cache file $fp = @fopen($cachefile, 'w'); // save the contents of output buffer to the file @fwrite($fp, ob_get_contents()); @fclose($fp); ob_end_flush(); ?> Alright, this is the code that i cant seem to get working. Its supposed to update the pin_lock field in my database. I have two databases that it needs to read from, the Account database to verify the login, then the Game database to modify the pin_lock field. It comes up that its sucessfully modified the entry but when i check it, its still the same as it was before. session_start(); if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') { print("<center>Incorrect verification code!"); die(); } require_once('config.php'); mysql_select_db($accdb); $accountid=$_POST['accountid']; $pass=$_POST['pass']; $email=$_POST["email"]; $idnumber=$_POST["question"]; $phone=$_POST["answer"]; session_start(); if(!$_POST["accountid"]) { print("<center>Account ID Field Empty!"); die(); } if(!$_POST["email"]) { print("<center>E-mail Address Field Empty!"); die(); } if(!$_POST["question"]) { print("<center>Security Questions Field Empty!"); die(); } if(!$_POST["answer"]) { print("<center>Answer Field Empty!"); die(); } if(!ereg("^[0-9a-z]{4,12}$",$accountid)) { print("<center>Account ID Only letters from \"a\" to \"z\" and numbers, lenght of 4 to 12 characters"); die(); } if(!ereg("^[0-9a-z]{4,14}$",$pass)) { print("<center>Password Only letters from \"a\" to \"z\" and numbers, lenght of 4 to 14 characters"); die(); } if(!ereg("^[0-9a-zA-Z_]{4,128}$", (strtr($email, Array('@'=>'','.'=>''))))) { print("<center>E-mail Only letters a to z and special chars @ . are allowed!"); die(); } if($_POST["pass"]!=$_POST["pass2"]) { print("<center>Passwords do not match!"); die(); } $ac = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid'"))); if (!$ac) { print("<center>Account ID does not exist!"); die(); } $em = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid' AND email='$email'"))); if (!$em) { print("<center>E-mail is incorrect!"); die(); } $q = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid' AND idnumber='$idnumber'"))); if (!$q) { print("<center>Security Question is incorrect!"); die(); } $an = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid' AND phone='$phone'"))); if (!$an) { print("<center>Answer is incorrect!"); die(); } $ac = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid'"))); mysql_select_db($gamedb); $temp["query"] = sprintf("UPDATE cq_user SET lock_key='0' WHERE account_id='$selectedid'"); if (!mysql_query($temp["query"])) { die(mysql_error()); } else { print("<center>You bank pin has been removed!"); } Any ideas what is wrong with it? Hello, I have made a PHP script that will feed an existing XML file. The file stores song details like, title, name of singer etc ... Now the file structure is like this for the moment: Code: [Select] <?xml version="1.0" encoding="UTF-8"?> <music> <song> <title>Without me</title> <artist>Eminem</artist> <url>songs/coreIssues.mp3</url> <image>img/den.jpg</image> <discspeed>11</discspeed> </song></music> But I need it to be: Code: [Select] <?xml version="1.0" encoding="UTF-8"?> <music> <song mainTitle="Eminem - Without me"> <title>Without me</title> <artist>Eminem</artist> <url>songs/coreIssues.mp3</url> <image>img/den.jpg</image> <discspeed>11</discspeed> </song></music> I need it to be like that so if I want to delete a song from the list I just check for the element which will have a unique mainTitle and then delete that element with all it's details. Now, I've searched on Google for some solutions but didn't find any yet. Anyone here knows how to do this? Thanks! Is it possible to feed the browser a default save as name for the image when outputting to the browser, instead of it defaulting to the .php file name? So, instead of myimage.php I could use imagename.jpg or whatever I want. Hi everyone, first thanks for caring to read my post! I am very very new to php but have a really good idea for a site so thought this could be a good chance to finally learn. The site is basically going to be a simple yet very well structured and organised repository for articles with the ability for users to post comments at the bottom of each article (logged in users). The users can also post articles and select which sections they want to put them in. The admin could then review all submissions and accept and then put them in the order in which they best fit (since the articles will usually be relevant to different stages and should be placed in order of assumed knowledge, if that makes sense) Kind of like a tutorials site with content being submitted. I imagine a really uncluttered site that looks more old school than web 2.0. From the first page is just like a simple search engine and underneath a kind of sitemap with each topic showing how many articles are in each. Then as you click into the topic area you are shown another sitemap like display of the articles in this which are perhaps some sectioning to define the type of article it is. As I say, I am quite new so I wondered if you had some suggestions of the top 'aids' to achieving this, and how you would suggest I progress to get it all setup? Or indeed any frameworks already that fit my needs? I hope to be active here and look forward to being to give something back some day. Edit: after reading this through,, I realise I just described a kind of wiki, but thats not really what I had in mind- more just how the old school basic but very clean and functional sites were back in the day (meaning no disrespect to any of the newer ones!). Thank you for reading. Hello,
I went through the forum, its geat but I think missing one feature,
There should be a forum about having general conversations and if someone wanted to talk about taking suggestions to help him/her across the world of programming, that would be very great.
Thanks.
Hello, This whole time working online and what not, I always end up using PayPal as a payment method. How to I use credit cards as a payment method ... for free? Can someone please explain the process of payment via credit cards Thanks |