PHP - Starting A Project, Need Some Direction Please
I am starting a project that will encompass the following-
A forum script that will later be tied into it's own custom content management system. But I have some questions before I get too deep into starting: 1. What is the "most" secure way to code a forum system? 2. Shall I rely on 1 person to code or open it to the public to help too (open source)? 3. Which features of forum scripts do you like and why? 4. How should the plugin system (hooks) be designed? 5. Template system - what is the easiest way to make theming simple? These are just some of the basics that I am pondering at the moment. I know these may sound noobish but I would rather start this project the right way, instead of having it coded wrong etc.....and having to re-do everything down the road. Similar TutorialsI want to create a shopping cart system for my website, but a simple shopping cart. I don't want a registration form or anything like that, just a way to add or delete a product..... so, how am I going to achieve this? I don't know! I don't know what I am even suppose to be looking for. Though, I do suspect I need to learn something called "PHP sessions" to store a cookie on someones computer to keep the shopping cart active. I use MySQL for my database, so I am guessing I will need to also create some form of temporary storage table as well. To be honest, I am shitting myself and have feared this task for over a month, but I am brave and going to take the plunge. In my head I can picture the process actually being very simple: a cookie is stored on someones computer > adding to cart simply is a HTML form that PHP then adds to MySQL > on purchase PHP calls the data from MySQL and forwards it to the payment gateway API. ... but I am only asking for advice on the PHP session and storing the cart in MySQL... The payment API will be a simple matter of PHP pulling information from MySQL and forwarding it to the API. Can someone please point me to the right.... concept... or something? I have not coded much for a while, and when I did it was minimal. I played with PHP5 and MySQL a little, but that was a couple of years ago. The last website I built was in 2004 and it was tables upon tables in html. I am starting to learn all over again, can anyone recommend a good starting place or book for what might as well be a beginner. Thanks Bill I'm just starting to research xml and I need to know if there's a specific name I should be looking for. I'm trying to read data from an xml file which is easy when all the tags are different but I've got a test file of students where alot of the data is the same. For instance: <STUDENTS> <STUDENT> <FIRSTNAME>Micheal</FIRSTNAME> <LASTNAME>Dorne</LASTNAME> <GRADE>10</GRADE> <MATHSCORE>89</MATHSCORE> <TEACHER>Flinn</TEACHER> </STUDENT> <STUDENT> <FIRSTNAME>Terry</FIRSTNAME> <LASTNAME>Williams</LASTNAME> <GRADE>11</GRADE> <MATHSCORE>78</MATHSCORE> <TEACHER>Edwards</TEACHER> </STUDENT> <STUDENT> <FIRSTNAME>Kimberly</FIRSTNAME> <LASTNAME>Jenson</LASTNAME> <GRADE>10</GRADE> <MATHSCORE>92</MATHSCORE> <TEACHER>Flinn</TEACHER> </STUDENT> </STUDENTS> I've reached a point where I need to acquire data from an xml file structured similar to this and need to know where to start. I could be looking for all the data on one specific student or acquiring a list of all student names that have the same teacher for example. I'd appreciate it if someone could point me the right direction with this. Thanks. H guys, I have created a quiz, however what i would like to do is have something that keeps an eye on the quiz. For example if someone is taking the quiz however get 4 incorrect answers in a row then it will abort the quiz. is it something like a for loop for example.... im not sure? The code i already got is a basic quiz however im just looking on expaning it more. Thanks for any help, i appreciate it! Code: [Select] <?php session_start(); $_SESSION['dclty'] = $_POST['dclty']; ?> <?php if ($_SESSION['dclty'] == "beg") ?> <script> window.open("extrahelp.php", height=300,width=300); </script> <?php if ($_SESSION['dclty'] == "int") ?> <script> window.open("pointers.php", height=300,width=300); </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Forensics E-learning Package</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="wrapper"> <div id="header"> <div id="toplinks"> </div> </div> <div id="menu"> <ul> <li><a class="selected" href="home.html">Home</a></li> <li><a href="initialquiz.php">Initial Quiz</a></li> <li><a href="about.php">About</a></li> </ul> </div> <div id="content"> <div id="main"> <h1>Initial Quiz</h1><BR /> <form name="Forensics Test" method="post" action="detection.php"> <h1>Protection</h1> <hr /> <b>1. What does an IDS do? <BR /><BR /></b> <UL> <? if($attempted == true && !isset($q1)) { echo 'bgcolor="#FFFFCC"'; } ?> <input type="radio" name="q1" id="q1a" value="1" />An IDS evaluates a suspected intrusion once it has taken place and signals an alarm<BR><? if($q1 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q1" id="q1b" value="2">An IDS blocks intrusions before it happens and signal an alarm<BR><? if($q1 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q1" id="q1c" value="3">An IDS blocks all intrusions before it happens and monitors the network, however does not signal an alarm.<BR><? if($q1 == "1"){echo "checked=\"checked\"";} ?></UL><hr /> <b>2. What does a Firewall do?<BR /><BR></b> <UL> <? if($attempted == true && !isset($q2)) { echo 'bgcolor="#FFFFCC"'; } ?> <input type="radio" name="q2" id="q2a" value="1">Firewalls limit access once the intrusion is within a network and then signals an alarm.<BR><? if($q2 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q2" id="q2b" value="2">Firewalls limit access between networks to prevent intrusion and do not signal an attack.<BR><? if($q2 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q2" id="q2c" value="3">Firewalls limit access to a network and prevent all intrusions. An alarm to the user is raised.<br><? if($q2 == "1"){echo "checked=\"checked\"";} ?></UL><hr /> <p><b>3. What does Tripwire do?</b> </p> <UL> <? if($attempted == true && !isset($q3)) { echo 'bgcolor="#FFFFCC"'; } ?> <input type="radio" name="q3" id="q3a" value="1">Tripwire does not protect from intrusions however signals an alarm to the user that network intrusions are occurring.<BR><? if($q3 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q3" id="q3b" value="2">Tripwire does not perform system integrity checks in terms of file change, however does prevent access to a network unless otherwise stated.<BR><? if($q3 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q3" id="q3c" value="3">Tripwire helps identify changes in files. Tripwire records a set of information about all the important files in your server in case of a change.</p><? if($q3 == "1"){echo "checked=\"checked\"";} ?> <BR> </UL><hr /> <p><b>4. What type of files does a traditional anti-virus protect you from?</b> </p> <UL> <? if($attempted == true && !isset($q4)) { echo 'bgcolor="#FFFFCC"'; } ?> <input type="radio" name="q4" id="q4a" value="1">Viruses and tracking cookies<BR><? if($q4 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q4" id="q4b" value="2">Rootkits and Viruses<BR><? if($q4 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q4" id="q4c" value="3">Worms and Rootkits<BR><? if($q4 == "1"){echo "checked=\"checked\"";} ?> </UL><hr /> <p><b>5. What does an Anti-root kit protect you from?</b> </p> <UL> <? if($attempted == true && !isset($q5)) { echo 'bgcolor="#FFFFCC"'; } ?> <input type="radio" name="q5" id="q5a" value="1">Anti-rootkit protects from only viruses, key loggers and backdoors.<BR><? if($q5 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q5" id="q5b" value="2">Anti-rootkit protects from viruses, backdoors, spyware and key loggers as a collection.<BR><? if($q5 == "1"){echo "checked=\"checked\"";} ?> <input type="radio" name="q5" id="q5c" value="3">Anti-rootkit protects from only viruses and backdoors.<BR><? if($q5 == "1"){echo "checked=\"checked\"";} ?> </UL> <HR><BR /><BR /> <input type="submit" value="Go to Next Section" /> </form> </div> <div id="right"> <h2>Right Menu</h2> <div class="rightitem"> <ul> <li><a class="selected" href="home.html">Home</a></li> <li><a href="initialquiz.php">Initial Quiz</a></li> <li><a href="about.php">About</a></li> </ul> </div> </div> </div> <div class="clearbottom"></div> <div id="footer"> <p id="legal"> </p> </div> </div> </div> </body> </html> Hi guys, I, not sure if this post belongs here as I have no idea what the cause of my problem is. However I'm hoping i can post the problems i have and one of you guys might be able to point me in the right direction as to where the problem is. Anyway up until a few days ago i had a system set up using php and mysql for customers to login to there accounts, buy and sell items etc. Every time a client would buy or sell an item a conformation email would automatically be generated and sent out with all the correct info already saved in the email. This system would also save the buy or sell information and a system administrator could login and view this info. The problem I have right now is that, none of this information is being saved any more, and the emails are not being generated. A client can do anything they want but no details are being saved. This problem just came out of nowhere, one day its was working fine, as it has been for well over a year now and then BANG! Its not working any more. Another strange thing is that I cant even seem to login into the administrator area on any other browser than firefox? I have really no idea why that is. I would also like to add that I have made no changes to the php code or the sql data prior to this problem. and lastly I think i should mention that this same system is on another completely different server, and the system has the exact same problem. If anybody has any clues to this one, or point me in the right direction I would be most grateful, as it has me completely stumped. Thank you very much in advance. Alright I didn't really know what to name the thread but w/e. I'm working on writing a blog, just for the purpose of something to apply what I'm learning it's not for production. I need someone to point me in the general direction of how the front page would look where after a post is made its on top and the older posts are below it: -- new post -- old post -- old post I don't want the code just a general direction of how I should go about it. Thanks much. So i've been wanting to expand my php horizons if you will and finally break of my fear of OOP. Here's a simple connection script i built, however i'm kind of stuck on a part of it. user passes username/password. i instantiate the mysqlcon class and call the connect function. the connect function attempts a connection to the database. if successful, pass on the username and password to the authenticator class. call the authenticate function. select user based on username/passwrod criteria. if found return "Confirmed" otherwise "Denied" here's my issue, i'm assuming that my Code: [Select] return $this->ok variable is returned back to the mysqlcon class. however how can i return that variable once more back outside of the object class so that i can continue with my script assuming authentication was confirmed. Here's my code... thanks for the help! <?php ## OOP PRACTICE ## class mysqlcon { function connect($user,$pass) { //Note: Connect to the database $db = mysql_connect("localhost", "usr","psw") or die(mysql_error()); if(mysql_select_db("database",$db) or die(mysql_error())) { $auth = new authenticator(); $auth->authenticate($user,$pass); } } } class authenticator { var $ok = "Confirmed"; var $ex = "Denied"; function authenticate($user,$pass) { //Note: User user and pass variables to check for user in table $qry = "SELECT * FROM users WHERE username = '$user' AND password = '$pass'"; $sql = mysql_query($qry) or die(mysql_error()); $cnt = mysql_num_rows($sql); if($cnt > 0) { return $this->ok; } else { return $this->ex; } } } $con = new mysqlcon(); $con->connect($_POST['username'],$_POST['password']); ?> PS: the classes are in class.php and the instantiation are in index.php. I just placed them together for easy of viewing. I've been at this for days, and the more I read the more confusing it gets. What I want to achieve is: I have a XHTML form with 5 user input fields - These a name subject cust_email telephone details I need to create a PHP script that will on user click - submit a email that has this format (secured if possible: From= cust_email Subject= "Customer requested information on" +subject eMail body= name + "requests information on" + subject /n + details /n + "Contact information" /n +telephone +email. So the body would look some how like this: Jane Smith requests information on Botox Hello I'm interested in botox injections please contact me with pricing and availability. Thank you. Contact information. (888)555-1212 Jsmith@hotmail.com Can you or anyone of the users in this wonderful forum HELP. I'm a print designer and I can assist you guys with anything you may need in print. But web is all to new and I'm struggling. Thank you, thank you very much. OK guys so I have my final project for school due next quarter and Its a database management application. I'm dont the upload edit delete scripting but now I need to do the search feature on the front end. I have a basic understanding of the search abilities in PHP but what i'd love to do is create something like Istockphoto.com and many other inventory sites that allow for a "search" field and also a filter. I'd assume there needs to be global variables that will set and adjust the query as things are checked or filled out. does anyone know of any examples/tutorials/demos that I can browse to start figuring this out? Thanks Hello, I defnitely don't consider myself a coder but have been installing and troubleshooting pre-made php scripts for a few years now and figure now is a good time to learn as I'm quite sick of having to rely on outsourced help I am currently trying to create a simple (hope so) script that will run on a cron every other minute to insert a specific piece of data each time a new member joins and it should only insert the data once based on criteria. Here's what I'm trying to do exactly with a php script check members table if field signup_date is TODAY's Date and if user_balance field is 0.00 then alter/update user_balance field 25.00 Now, I've hit a bit of a roadblock with getting the MySQL query format correct. The SIGNUP_DATE field in the database is DATETIME format and the like with wildcard thing isn't working for me. Is there anyone who can point me in the right direction with the proper wildcard date format? It'd be a great help. Anything at all is massively appreciated. Here's the code I have so far...the echo is in there so I can see if it's working correctly. I'm pretty sure I haven't got the right function to display the result of the query either but I think I can figure that out pretty easily. Code: [Select] <?php $today = date("Y-m-d"); mysql_connect("localhost", "DBUSER", "DBUSER") or die(mysql_error()); mysql_select_db("DBNAME") or die(mysql_error()); $sql1 = mysql_query("SELECT USER_NAME FROM members WHERE SIGNUP_DATE LIKE '$today%"); if($sql1 == false) { user_error("Query failed: " . mysql_error() . "<br />\n$query"); } elseif(mysql_num_rows($sql1) == 0) { echo "<p>Sorry, no rows were returned by your query.</p>\n"; } $memberseligible = mysql_fetch_array($sql1); echo "$memberseligible"; ?> Not sure how to approach this ... I have a form where someone will select a city from a dropdown (over 80 cities currently, will be expanding to more). Each city falls in one of three categories (i.e. small, medium, large). After the user submits the form I need to determine what city the user selected and the size (small, medium, or large). Should I store the size in an array for each city name? That sounds wrong to me; or is it? I could use a switch statement I guess to check if 'New York' was selected and then set the city size to large, but that seems like excessive code also. Am I close? If you could point me in the right direction so I could read up on it, that would be awesome. Thanks! I am creating a system for my students. I teach Photography and I want to do more online integration for my class. As of right now I have a whole system in which the students have their on accounts on my site. Now the challenging part for me. I need students to upload photos to me, and I will critique them. My questions for this forum a 1. Should I have a line of code that creates a folder per user to upload photos to? 2. Should I have the photos stored in the SQL database? 3. Are there any scripts out there that can be easily adapted for this idea? Adam Hello, I have been studying PHP for less than a year so please be gentle. I am building an agency website where users can add themselves etc. What I want to do now is allow clients to collect a list of these users which they can submit to the site along with a job description. What I actually need help with is sending the usernames to a 'collection' page. I want to allow the client to move between the profile pages selecting the users they like the look of and then be able to go to the 'cart/collection' page and see their list. I have a basic knowledge of sessions just no real idea how to pass variables/arrays. Any help would be much appreciated. Cheers - Lee. started learning php yesterday at w3schools was looking for a great forum to ask questions as i go along. bumped into phpfreaks. looking forward to mastering the art
Code: [Select] <form action="meetme.aspx" method="post" id="form1" name="form1"> <input type="hidden" name="add_id" value ="28667977"> <input type="hidden" name="next26" value ="26883214,28590733,28654666,28681535,27273243,28576166,28613584,28591951,28515273,28541847,18296015,28594117,27206532,21878719,28590233,28663167,5039360,28636411,28569000,28645007,28587048,28569415,7815397,26626891,28671149,28570991"> <input type="hidden" name="p_Id" value ="28667977"> <INPUT TYPE="image" SRC="image/yes.png" NAME="votea" VALUE="1 <INPUT TYPE="image" SRC="image/maybe.png" NAME="voteb" VALUE="2'> <INPUT TYPE="image" SRC="image/no.png" NAME="votec" VALUE="3"> </form> I got this from datesite, But it suits my needs for something else. Exclude the 3 link options, I just want to use one. as a Next page button. and another as a back pagebutton. I made pagination already but I dont want that, I noticed pagination always keeps the same page, and just adds page numbers. But the same original page. The code above im assuming will allow to move to next new entire page with the new metas, and title and be botted by the search engines as a separate pages. And also keeping track of the next pages in que out of the entire specified db. So the question above is.. is there a page/website/tutorial.. terminology for this? pagination is pagination, is this like "form forwarding?? or something" ...So I can use.. Code: [Select] $sql = "SELECT COUNT(*) as Num FROM `mydb` Where models = ' 2012' and have it list all the values of say 'models' but keep them in memory passing to the next page and the next until they have all been viewed. Sorry if what im typing is overkill and you already knew what I asking in the first view of the code above lol. lemme know thanks! But I need help in an issue I have been having for awhile now. Some reason when I try to call for online status it does not work sometimes i can get it to show the default code 1 which means online. But I am trying to get it to say Online and Offline and so on. I do not get what I am doing wrong my website using mysql so not sure if its having trouble reading the database or what. here is the code...
<?php class steam { public $api = STEAM_API; public $returnUrl = URL; public $user = array(); function __construct() { $this->setUserInfo(); } function isLoggedin() { if(isset($_SESSION['steam'])) { return true; } return false; } function showLogoutButton() { echo "<br /><a href=\"logout.php\">Logout</a>"; //logout button } function steamlogin() { require_once(INCLUDES.'/openid.php'); try { // Change 'localhost' to your domain name. $openid = new LightOpenID($this->returnUrl); //dump($openid); if(!$openid->mode) { if(isset($_GET['login'])) { $openid->identity = 'http://steamcommunity.com/openid'; header('Location: ' . $openid->authUrl()); } echo "<a href=\"?login\"><img src=\"http://steamcommunity-a.akamaihd.net/public/images/signinthroughsteam/sits_small.png\"></a>"; } elseif($openid->mode == 'cancel') { echo 'User has canceled authentication!'; } else { if($openid->validate()) { $id = $openid->identity; $ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/"; preg_match($ptn, $id, $matches); $_SESSION['loginid'] = $matches[1]; //die('Here'); header('Location: index.php'); exit; } else { echo "User is not logged in.\n"; } //die('here we are'); } } catch(ErrorException $e) { echo $e->getMessage(); } } function doLogout() { if(isset($_POST['steamid'])) { unset($_POST['steamid']); } header('Location: index.php'); exit; } function setUserInfo() { global $DB; if($this->isLoggedin()) { // Grab the info from the session $userData = $DB->getUserById($_SESSION['steam']); if(isset($userData['steamid'])) { $this->user = $userData; } else { unset($_SESSION['steam']); die('Could not get user'); } } elseif(isset($_SESSION['loginid'])) { $url = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$this->api.'&steamids='.$_SESSION['loginid']; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $url); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec($ch); curl_close($ch); $content = json_decode($content, true); $_SESSION['steam'] = $_SESSION['loginid']; // Set the database values $values = array( 'steamid' => $content['response']['players'][0]['steamid'], 'communityvisibilitystate' => $content['response']['players'][0]['communityvisibilitystate'], 'profilestate' => $content['response']['players'][0]['profilestate'], 'personaname' => $content['response']['players'][0]['personaname'], 'lastlogoff' => isset($content['response']['players'][0]['lastlogoff']) ? $content['response']['players'][0]['lastlogoff'] : '', 'profileurl' => $content['response']['players'][0]['profileurl'], 'avatar' => $content['response']['players'][0]['avatar'], 'avatarmedium' => $content['response']['players'][0]['avatarmedium'], 'avatarfull' => $content['response']['players'][0]['avatarfull'], 'personastate' => $content['response']['players'][0]['personastate'], 'timecreated' => $content['response']['players'][0]['timecreated'], 'onlineoffline' => $this->user['personastate'] == 1 ? 'Online' : 'Offline', 'status' => $this->getOnlineStatus() ); if($values['lastlogoff'] == '') { $values['lastlogoff'] = 'NA'; } else { $values['lastlogoff'] = date("m/d/Y", $values['lastlogoff']); } // Are updating the user info or adding them? $userExists = $DB->getUserById($_SESSION['steam']); if(isset($userExists['steamid'])) { // We have this user, lets update their info $DB->update('users', $values, array('steamid' => $_SESSION['steam'])); } else { // New user, lets insert them $id = $DB->insert('users', $values); } unset($_SESSION['loginid']); $this->setUserInfo(); } } function getOnlineStatus($values) { switch($this->user['onlineoffline']) { case '0': default: $state = 'Offline'; break; case '1': $state = 'Online'; break; case '2': $state = 'Busy'; break; case '3': $state = 'Away'; break; case '4': $state = 'Snooze'; break; case '5': $state = 'Looking to trade'; break; case '6': $state = 'Looking to play'; break; } return $state; } ?>This is basically my entire code that calls the steam api. Here is the echo function I use to try and call it on a profile.php page... echo "<br /><strong>Online:</strong> " . $steam->user['onlineoffline'] . " ";So I would really appreciate it if someone can help me. I been trying to figure out this for the past week and its starting to drive me nuts and loose motivation on my project. Everything else works great minus this one issue. I have pretty much asked everywhere I can think of and no help. I use a function to call my database hint the global $DB; in my functions just to give you anymore information I can. $steam variable I believe is coming from my class at the very top of my code that is were $steam comes from. Thanks Edited by soslidesigns, 12 August 2014 - 01:50 PM. So I started learning how to code php with usercake. I then went to use different things like fileNice for directory listing and I went to make a music lister with music player running mainly (EDM) .mp3's.
I have uploaded a copy of my music.php file and I would love some help on how to develop my site further!
https://github.com/3...aster/music.php
This is the part I need help developing:
<?php function getUploadedFiles($directory){ $folder = opendir($directory); while ($file = readdir($folder)) { if($file !== '.' && $file !== '..') { $filename = $directory.''.$file; $file_array[] = array('filename' => $file); } } return $file_array; } $music = getUploadedFiles('../Music/EDM'); foreach($music as $value) { echo '<div class="well well-sm">'; echo '<li class="list-group-item list-group-item-success"><div class="alert alert-success" role="alert"><a href="../Music/EDM/'.$value['filename'].'"title="Play .$value" class="sm2_button"></a> '.$value['filename'].'</div></li>'; echo '<p><a href="../Music/EDM/'.$value['filename'].'"><button type="button" class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-headphones"> </span> Listen</button></a> '; echo '<a href="../Music/EDM/'.$value['filename'].'" download><button type="button" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-cloud-download"></span> Download</button></p></br></a></p>'; echo '<p><a class="btn btn-default" href="#" role="button">View details »</a></p>'; echo '</div>'; } ?>I would love to figure out how to use "echo '<p><a class="btn btn-default" href="#" role="button">View details »</a></p>';" to show time of when song was added, so Time last modified ? Hopefully I can learn how to set individual counters instead of them being the same for all the songs :/ Here is a link to the site with everything running: http://thebatcave.x10.mx/dev/music.php Tell me what you think ? Edited by 321System123, 10 August 2014 - 08:45 PM. I can't for the life of me understand how to perform this so I need some professional help here. I have a large array that contains some garbage every Nth and Nth + 1 element that needs to go away. array_filter doesn't work with keys but anyhow, i wouldn't know how to design the function. My keys are numeric, starting from 0. The keys I want to remove are part of this sequence: 8, 9, 18, 19, 28, 29 ... Can someone help me design a generic function to remove these keys? function filter_keys($array, $n, $offset) {} $new_array = filter_keys($array, 10, 8 ); I would maybe have to run this function twice, once for 8 offset and once for 9 offset. Hi, I'm a php newbie, with some mysql experience. I have a mysql database as follows: Database=watch, Table=events - fields id, reportno, sdate, comments What I need is: 1. A dropdown list to display reportno from mysql database. 2. Depending on which reportno I choose, I'd like to open a popup(or separate) page to display the stored information. Tks in advance for any help Why do I get the following results (specifically the second example)? I thought it would be documented under https://www.php.net/manual/en/language.types.string.php, however, the word "ampersand" doesn't appear. Also, looked at logical operators, but found nothing. Thanks function test(string $string){ printf('%s %s %s 0'.PHP_EOL, gettype($string), $string, $string==0?'==':'!='); } test('123'); test('@123'); test('1@23'); test('123@');Quote
string 123 != 0
|