PHP - General Comm And Suggestions
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.
Similar TutorialsHey guys, I'm kind of a n00b with PHP and i'm trying to practice by building a mock e-comm site, but i'm having a problem with my admin login form. When the information is submitted the form just clears and doesn't redirect me to the index.php file i have set-up. My knowledge of php isn't where i'd like it to be yet, so i'm here for help! I'll post the code for bpoth the admin login page and the index.php file. ADMIN LOGIN PAGE | | V <?php session_start(); if (isset($_SESSION["username"])) { header("location: index.php"); exit(); } ?> <?php if (isset($_POST["username"]) && isset($_POST["password"])){ $username = $_POST["username"]; // filter everything but numbers and letters $password = $_POST["password"]; // filter everything but numbers and letters include "../storescripts/connect_to_mysql.php"; $sql = mysql_query("SELECT id FROM admin WHERE username='$username' AND password='$password' LIMIT 1"); $existCount = mysql_num_rows($sql); // count the row nums if ($existCount == 1) { // evaluate the count while($row = mysql_fetch_array($sql)){ $id = $row["id"]; } $_SESSION["id"] = $id; $_SESSION["username"] = $username; $_SESSION["password"] = $password; header("location: index.php"); exit(); } else { echo 'That information is incorrect, try again <a href="index.php">Click Here</a>'; 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>Store Admin Area</title> <link rel="stylesheet" type="text/css" href="../css/main_style.css" /> </head> <body> <div id="wrapper"> <div id="text"><br /> <div align="left" style="margin-left:100px; margin-top:100px;"> <h2>Please Login To Manage The Store</h2> <br /><br /> <form id="form1" name="form1" method="post" action="admin_login.php"> <strong>Username</strong> <input name="username" type="text" id="username" size="40" /> <br /><br /> <strong>Password</strong> <input name="password" type="password" id="password" size="40" /> <br /> <br /> <input type="submit" name="button" id="button" value="Login" /> </form> </div> </div><!--closes wrapper--> </body> </html> INDEX.PHP FILE | | V <?php session_start(); if (!isset($_SESSION["username"])) { header("location: admin_login.php"); exit(); } $usernameID = preg_replace('#[^0-9]#i', '', $_SESSION["id"]); $username = preg_replace('#[^A-Za-z0-9]#i', '', $_SESSION["username"]); $password = preg_replace('#[^A-Za-z0-9]#i', '', $_SESSION["password"]); include "../storescripts/connect_to_mysql.php"; $sql = mysql_query("SELECT * FROM admin WHERE id='$usernameID' AND username='$username' AND password='$password' LIMIT 1"); // query the person $existCount = mysql_num_rows($sql); // count the row nums if ($existCount == 0) { // evaluate the count echo "Your login session data is not on record in the database."; 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>Store Admin Area</title> <link rel="stylesheet" type="text/css" href="../css/main_style.css" /> </head> <body> <div id="wrapper"> <div id="text"><br /> <div align="left" style="margin-left:100px; margin-top:100px;"> <h2>Hello store manager, what would you like to do today?</h2> <p><a href="inventory_list.php">Manage Inventory</a><br /> <a href="#">Manage Blah Blah </a></p> </div> <br /> <br /> <br /> </div><!--closes wrapper--> </body> </html> Any help and suggestions are greatly appreciated! Thanks! Hi to all the members of this great community, This is my first post here and I am new in PHP and in general web programming, my background is in C and C++ programming languages that's why I want to make some comments with regards to PHP and getting your feedbacks. In C++ one exercise considered that someone knows the basics of the language is to implement a general dynamic queue that is the client programmer can put an arbitrary number of objects into a queue and using templates you can instantiate different queues holding different kind of objects. I have grasped the most important parts of the language and I am pondering if you can effectively implement something like the above using PHP. I have googled this, and I have seen so far just a very simple implementation in PHP. He has defined his queue using an array having a fixed size and he just moved an index up and down through the array while inserting and poping elements from the queue. if you want to implement a dynamic queue the only way it comes to my mind just off the top of my head is to use the the construct [] to add dynamically element at the end of the queue and when you want to pop up an element you just have to unset(your current queue which is an array) create another array (smaller by one element than the previous one) copy the elements at the appropriate positions I just wanted, people with a C++ programming experience to give me some feedback about this topic and to give me some basic idea how could we implement a general queue in PHP. For example could we implement a queue w/o using an array? I would appreciate any comment. Greetings from Greece I have a general questions. 1. I have a list of products. 2. I have a list of each of the 50 states. 3. I have a list of "professions". I need to setup something called "State Verbiage". However, this is going to be on a per product, per state, per profession level. So each profession is mapped up to each state and product. So product #1, in State #4, for profession #2 would have verbiage. Any combination of the three would have different verbiage. Any advice on the easiest way to set this up, would be appreciated. This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=321915.0 Hi, I am really plugging into how to write functions in PHP. But I was going to delve into a user management program and try to create it, but dont want to be the older version of what I was before if you like, where I just type in for the sake of typing in code so I thought I would question what their doing. But a peice of code, a very small snippet, this came up: @mysql_connect What does this actually mean with the @ sign infront of the mysql_connect function? Seen this a few times but just never appreciated what the at sign means, any help is wonderfully appreciated of course. Thanks, Jeremy 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 there just wanted to ask you a general question regarding referenced variables and functions in PHP. I have this code: function theRefFunction(&$var){ $var = $var +1; return $var; } $a = 50; echo $thisvalue = theRefFunction($a); Just for learning purposes, as allot of times beginning PHP seriously developers who want to improve on memory consumption in PHP find this tricky, is there any point in using an example like this? I.e. would I really need the &$var as the parameter for the function called 'theRefFunction()'? Just wondered thats all, if not what would be a better way for really using it? It's just so I can go onto maybe doing a loop in it and setting it as a real example like working out tax and stuff like that, just for learning purposes, won't yet be using it. Just wanted to build up as I said earlier a library of things I have done and make maybe my own tutorial site. I look forward to any replies, Jeremy. Sorry for the non code lingo, but I am wondering if I can pull a word from an array and use it to get a value from another array.
I am making a simple dodgeball game engine. I want the coaches strategy to pick a certain attribute to base who to throw to. Here is the team array:
//silverbacks 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! 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? This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=308872.0 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. 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 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! 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 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=326040.0 I'm ready for the next step on my site, which is learning how to filter results down with a second search. The scenario is: A viewer searches for a plant by 4 variables to describe the leaf. After submit, they go to the results page, with 200 paginated results. (This is where I've gotten to) Now, on that same page, they choose to further narrow their results by searching those 200 results for plants that have purple flowers. Maybe they get 40 results and can use another variable to narrow further - and so on. What's the best way to set this up? I've been looking into temporary tables, but it seems to be a challenge because the table deletes the moment they leave that page or close the connection? Sessions seem like another possibility, but I read there's security issues. What's the best way to set this up? Just re-query the database with the entire set of variables from both the first and second searches? is it quicker to build some type of permanent table with a timestamp that I can use to delete it after the user has gone away? I'm in the process of making a PHP/MYSQL game and I'm trying to figure out the best way to set the database up specifically to deal with items. All day I have been wrestling with how to do this. How do I link items to players? How do I keep track of who has what items? I know this question isn't at all specific sorry for that, it's hard to explain exactly what I mean thought text. 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 |