PHP - Web Servers And Database Structures Design
I have spent lots of time trying to design a nice structure for my project and I would like some feedback to what you guys think, please note this is the first time I've ever done anything like this.
About My Project
I am creating a service where advertisers can search through a catalog of websites they want to directly advertise on. Once they have found a website, they can upload an image, pay the fees and start advertising on that website instantly.
I have designed an image of how I think the structure should look, I have designed it this way for efficiency but I am pretty sure I could improve with some help. If you need more info or have any questions, please ask.
Project Structure Design Image
Thanks for reading, what do you think about this structure? Can I improve it?
Edited by itsliamoco, 26 July 2014 - 09:34 PM. Similar TutorialsHow do you check if a MySQL or MySQLi server is available through php. I'm trying to make a short script that makes sure the users server can run the application. Like all the popular ones do Okay, not sure what exactly I need but I need to store data in a MySQL database. The financial data for each user has to be stored for each day. I.e. User 1 has 20 financial data columns say (rent, maintenance, wages, shopping... etc). I need to store each of those separately so they can be displayed in a report. There is more than one user. Most likely a couple of hundred users although it needs to work for up to a few thousand users. Also, each user's daily financial data has to be stored against the date of that data so the user can see the change in finances between day X and day Y for example. So far my best idea has been to create a table for each user and then in that table store the financial data in the columns against the date as the primary key. Does anyone have a better way for this or should I do this? I have designed a database for my institute. Here I have attached my design for better understanding.
I am expecting your reviews who are professional for the database design.
Thank You.
Attached Files
Database Design for Institute Registration.jpg 61.29KB
0 downloads This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=357188.0 This is a more general schema design question as opposed to specific queries.
I'm designing a database which tracks the production status of 2 (and in the future maybe 2 or so more) completely different products. So let's call these products productA and productB. I have a page where the user can see the progress of either of the products.
This concerns these 3 tables:
productA(id, order_id, status)
productB(id, order_id, status)
production_status(id, status, ordering, type)
The status is number based PER product so that it can move up a chain of statusses in its production process. So if a product is in status with ordering 10 it's done (assuming there are 10 production steps). So at ordering 1 its production just started. The status field contains at which production step it is which will be visible on the page. Now this is where i get stuck. I somehow have to differentiate between statusses so I know which statusses belong to which product. I put type in so it could filter for either productA or productB, but also for future products. But working with strings is not such a smart idea I think. I could make 2 more seperate tables, but I'm not sure how well that would scale.
So my question is what a good approach would be.
Some background info: I'm building a Joomla component for a small company. Like I said they want to track the status of these products. Every time a production person unpublishes said item on its production view inside the component, the product moves to the next status
Edited by Ortix, 13 May 2014 - 04:14 AM. So, built a classifieds site.
The link is something like this: mysite.com/category/subcategory/1234
The category & subcategory don't do anything, they are just for vanity.
My question is about the '1234'. The number corresponds to an "id" which is a unique key in my database.
When people make a post, I use LAST_INSERT_ID() to get the most recent post and generate the URL.
So basically, my urls correspond 100% to database ID's, for better or worse. These go up by 1 with each post. I anticipate some potential numbering issues when I eventually delete posts.
Would it be a better idea to generate these unique IDs some other way, or is this acceptable design?
Thanks.
Edited by arbitrageur, 19 November 2014 - 11:13 AM. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=327717.0 Hi: I have a login file where a user goes to a db based on the dbtype selected. Now $dbtype1 links to a db on Server 1 ( that is the server on which this script is running and $dbtype2 links to a db on Server 2 I created a connection-link file connectlink.php as under but while $dbtype1 works without a problem , $dbtype2 gives me an error 'no access to db' and user dbun1@localhost not found on db1.db . What am I missing in the connectlink.php file please ? Thanks login.php =========== <? ...... if($_POST['submit']){ $dbtype = $_POST['dbtype']; if ($dbtype == 'type1') { $section = 'type1'; require("../x/type1/type1.php"); } if ($dbtype == 'type2') { $section = 'type2'; require("../x/type2/connectlink.php"); //the dir 'x' is a common name on both the servers'' } //then it processes $userfile and give this Click <a href="'.$section.'/'.$userFile.'?Userid='.$userid.'"> here ?> connectlink.php ============== <? //this file contains db info, log and checks if user is authorised to access the db - ist check. error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR); $dbusername2='a'; $dbpassword2='b'; $dbname2='c'; $servername = 'ip address of server or localhost ?'; $link2=mysql_connect ("$servername","$dbusername2","$dbpassword2", true); if(!$link2){ die("Could not connect to MySQL");} mysql_select_db("$dbname2",$link2) or die ("could not open db".mysql_error()); $dbusername1='d'; $dbpassword1='e'; $dbname1='f'; $servername = 'localhost'; $link1=mysql_connect ("$servername","$dbusername1","$dbpassword1", true); if(!$link1){ die("Could not connect to MySQL");} mysql_select_db("$dbname1",$link1) or die ("could not open db".mysql_error()); $sql = "SELECT * FROM Users WHERE Userid='$userid'",$link2; $result = mysql_query($sql); if ($myrow = mysql_fetch_array($result)){ $login_success = 'Yes'; $status = "On"; .... $sql2= "insert into Log (....) values(.....)",$link2;; $result2 = mysql_query($sql2) or die ('no access to database: ' . mysql_error()); // echo mysql_error(); } } else { $failureMessage = '<p class="data"><center><font face="Verdana" size="2" color="red">Login Failure. You are not authorised to access this database .<br /></font></center></p>'; print $failureMessage; $logoutMessage = 'Click <a href="../NEWDBS/mainlogout.php"> here </a>to logout </p>'; print $logoutMessage; exit; } ?> I'm developing a kind of social network. I've got a question, say it to grow very quickly, I would have to run it across multiple servers to support all users, but I have no idea how I would do it. I'm basically using PHP / MySQL. Could anyone give me a hand? Thanks. I am trying to transfer some data from one Servers DB to a new server with cleaner tables. When i run my code the transfer seems to be working but the script just keeps running and never give the desired responses. First it collects the data (for testing i limited results by 1) then checks to see if the app is in the new DB, if so then it updates its contents. If not then it adds it. It seems to work for both updates and inserts but i must still be missing something. Thanks for any help. Code: [Select] <?php function getTime() { $a = explode (' ',microtime()); return(double) $a[0] + $a[1]; } $Start = getTime(); ###################################################################### $connection1 = mysql_connect('','',''); if (!$connection1){ die('Could not connect: ' . mysql_error()); } $db_selected1 = mysql_select_db('', $connection1); if (!$db_selected1) { die ('Could not connect: ' . mysql_error()); } //if(isset($_REQUEST['appcounting'])){ //$appcounting = ($_REQUEST['appcounting'] + 1); //$appnext = 1; //$appgroup = $appcounting + $appnext; //echo "Checked app $appcounting-$appgroup.<br />\n"; //} //else{ //$appcounting = 0; //$appnext = 1; //} $count = 0; $appinfo = mysql_query("SELECT app_id, ipayAppID, Status, MID, BusinessContactName, BusinessContactPhone, BusinessEmail, BusinessWebsite, BusinessName, BusinessAddress, BusinessCity, BusinessState, BusinessZip, BusinessTaxID, BusinessMailingAddress, BusinessMailingCity, BusinessMailingState, BusinessMailingZip, agent_id, CreateTime, StatusChangeTime, ReceiveTime, ReviewTime, PayrollApprovalTime, PayrollPayTime, ApproveTime, DeclineTime, CancelTime, CancelDesc, PendingTime, PendingDesc FROM app ORDER BY app_id DESC LIMIT 0, 1") or die('SELECT ' . mysql_error()); while($row = mysql_fetch_array($appinfo)) { $app_id[] = $row['app_id']; $ipayAppID[] = $row['ipayAppID']; $Status[] = $row['Status']; $MID[] = $row['MID']; $BusinessContactName[] = $row['BusinessContactName']; $BusinessContactPhone[] = $row['BusinessContactPhone']; $BusinessEmail[] = $row['BusinessEmail']; $BusinessWebsite[] = $row['BusinessWebsite']; $BusinessName[] = $row['BusinessName']; $BusinessAddress[] = $row['BusinessAddress']; $BusinessCity[] = $row['BusinessCity']; $BusinessState[] = $row['BusinessState']; $BusinessZip[] = $row['BusinessZip']; $BusinessTaxID[] = $row['BusinessTaxID']; $BusinessMailingAddress[] = $row['BusinessMailingAddress']; $BusinessMailingCity[] = $row['BusinessMailingCity']; $BusinessMailingState[] = $row['BusinessMailingState']; $BusinessMailingZip[] = $row['BusinessMailingZip']; $agent_id[] = $row['agent_id']; $CreateTime[] = $row['CreateTime']; $StatusChangeTime[] = $row['StatusChangeTime']; $ReceiveTime[] = $row['ReceiveTime']; $ReviewTime[] = $row['ReviewTime']; $PayrollApprovalTime[] = $row['PayrollApprovalTime']; $PayrollPayTime[] = $row['PayrollPayTime']; $ApproveTime[] = $row['ApproveTime']; $DeclineTime[] = $row['DeclineTime']; $CancelTime[] = $row['CancelTime']; $CancelDesc[] = $row['CancelDesc']; $PendingTime[] = $row['PendingTime']; $PendingDesc[] = $row['PendingDesc']; $count++; } mysql_close($connection1); ###################################################################### $connection2 = mysql_connect('','',''); if (!$connection2){ die('Could not connect: ' . mysql_error()); } $db_selected2 = mysql_select_db('', $connection2); if (!$db_selected2){ die ('Could not connect: ' . mysql_error()); } $number = 0; $count_insert = 0; while($number <= $count) { $findapp = $app_id[$number]; $one = mysql_query("SELECT AppID FROM Apps WHERE `AppID`='$findapp'") or die('FIND ' . mysql_error()); $num_rows = mysql_num_rows($one); if ($num_rows == 1){ $myBusinessContactName = $BusinessContactName[$number]; $myBusinessContactName = addslashes($myBusinessContactName); $myBusinessName = $BusinessName[$number]; $myBusinessName = addslashes($myBusinessName); $myBusinessCity = $BusinessCity[$number]; $myBusinessCity = addslashes($myBusinessCity); $myBusinessMailingCity = $BusinessMailingCity[$number]; $myBusinessMailingCity = addslashes($myBusinessMailingCity); $myPendingDesc = $PendingDesc[$number]; $myPendingDesc = addslashes($myPendingDesc); $myCancelDesc = $CancelDesc[$number]; $myCancelDesc = addslashes($myCancelDesc); $myBusinessAddress = $BusinessAddress[$number]; $myBusinessAddress = addslashes($myBusinessAddress); $myBusinessMailingAddress = $BusinessMailingAddress[$number]; $myBusinessMailingAddress = addslashes($myBusinessMailingAddress); mysql_query("UPDATE Apps SET `IpayAppID`='$ipayAppID[$number]', `Status`='$Status[$number]', `MID`='$MID[$number]', `ContactName`='$myBusinessContactName', `ContactPhone`='$BusinessContactPhone[$number]', `ContactEmail`='$BusinessEmail[$number]', `ContactWebsite`='$BusinessWebsite[$number]', `DBA`='$myBusinessName', `BusinessAddress`='$myBusinessAddress', `BusinessCity`='$myBusinessCity', `BusinessState`='$BusinessState[$number]', `BusinessZip`='$BusinessZip[$number]', `BusinessTaxID`='$BusinessTaxID[$number]', `MailingAddress`='$myBusinessMailingAddress', `MailingCity`='$myBusinessMailingCity', `MailingState`='$BusinessMailingState[$number]', `MailingZip`='$BusinessMailingZip[$number]', `Agent1ID`='$agent_id[$number]', `CreateTime`='$CreateTime[$number]', `StatusChangeTime`='$StatusChangeTime[$number]', `ReceivedTime`='$ReceiveTime[$number]', `ReviewedTime`='$ReviewTime[$number]', `PayrollApprovalTime`='$PayrollApprovalTime[$number]', `PayrollPayTime`='$PayrollPayTime[$number]', `ApproveTime`='$ApproveTime[$number]', `DeclineTime`='$DeclineTime[$number]', `CancelTime`='$CancelTime[$number]', `CancelDesc`='$myCancelDesc', `PendingTime`='$PendingTime[$number]', `PendingDesc`='$myPendingDesc' WHERE AppID='$app_id[$number]'") or die('UPDATE ' . mysql_error()); $number++; } elseif(isset($app_id[$number]) && isset($BusinessName[$number])){ echo "Transfered App $findapp<br />\n"; $myBusinessContactName = $BusinessContactName[$number]; $myBusinessContactName = addslashes($myBusinessContactName); $myBusinessName = $BusinessName[$number]; $myBusinessName = addslashes($myBusinessName); $myBusinessCity = $BusinessCity[$number]; $myBusinessCity = addslashes($myBusinessCity); $myBusinessMailingCity = $BusinessMailingCity[$number]; $myBusinessMailingCity = addslashes($myBusinessMailingCity); $myPendingDesc = $PendingDesc[$number]; $myPendingDesc = addslashes($myPendingDesc); $myCancelDesc = $CancelDesc[$number]; $myCancelDesc = addslashes($myCancelDesc); $myBusinessAddress = $BusinessAddress[$number]; $myBusinessAddress = addslashes($myBusinessAddress); $myBusinessMailingAddress = $BusinessMailingAddress[$number]; $myBusinessMailingAddress = addslashes($myBusinessMailingAddress); mysql_query("INSERT INTO Apps (AppID, IpayAppID, Status, MID, ContactName, ContactPhone, ContactEmail, ContactWebsite, DBA, BusinessAddress, BusinessCity, BusinessState, BusinessZip, BusinessTaxID, MailingAddress, MailingCity, MailingState, MailingZip, Agent1ID, CreateTime, StatusChangeTime, ReceivedTime, ReviewedTime, PayrollApprovalTime, PayrollPayTime, ApproveTime, DeclineTime, CancelTime, CancelDesc, PendingTime, PendingDesc) VALUES ('$app_id[$number]', '$ipayAppID[$number]', '$Status[$number]', '$MID[$number]', '$myBusinessContactName', '$BusinessContactPhone[$number]', '$BusinessEmail[$number]', '$BusinessWebsite[$number]', '$myBusinessName', '$myBusinessAddress', '$myBusinessCity', '$BusinessState[$number]', '$BusinessZip[$number]', '$BusinessTaxID[$number]', '$myBusinessMailingAddress', '$myBusinessMailingCity', '$BusinessMailingState[$number]', '$BusinessMailingZip[$number]', '$agent_id[$number]', '$CreateTime[$number]', '$StatusChangeTime[$number]', '$ReceiveTime[$number]', '$ReviewTime[$number]', '$PayrollApprovalTime[$number]', '$PayrollPayTime[$number]', '$ApproveTime[$number]', '$DeclineTime[$number]', '$CancelTime[$number]', '$myCancelDesc', '$PendingTime[$number]', '$myPendingDesc')") or die('INSERT ' . mysql_error()); $number++; $count_insert++; } } if($count_insert == 0){ echo "All apps have been found.<br />\n"; exit; } mysql_close($connection2); ###################################################################### $End = getTime(); echo "Time taken = ".number_format(($End - $Start),2)." secs<br />\n"; //header('Refresh: 60; url=transfer_apps.php?appcounting=$appcounting'); ?> Hi All, I created a website which runs perfectly on one server but now I transferred the website to another server I get all kinds of errors like, Undefined variables and so on. How is this possible. I thought it was all in the code. Marco I have release notes on my server, at example.com/release.txt. My software points to this file so people can see the notes: Code: [Select] file_get_contents( http://example.com/release.txt ); Why -- since all sites are on the internet -- can most of my customers see the file but some cannot? Just seems odd to me. Could some servers be turning that off or something? Doesn't seem like a problem on my server. Hello wize PHP dudes. I'm a fairly advanced PHP user, but I'm confused by STRTOTIME producing different results on two identical servers. Both running PHP Version 5.2.6-3. - Server 1: echo date("Y",strtotime('1763-03-24 00:00:00')); returns '1763' - Server 2: echo date("Y",strtotime('1763-03-24 00:00:00')); returns '1970' Why do you reckon Server 1 seems not to worry about the Unix Epoch date limit, and happily computes the 1763 date? I would really like Server 2 to do the same thing, but having gone through the php.ini I can't see any difference. I would really like Server 2 to start working with older dates. I don't want a workaround, as server 1 has been working with just strtotime for years. I can't remember doing anything different on setup. Weird! Thanks. Hi there, Everyday I run a php script on a database to extract certain information I need and save to a text file. I then need to be able to send this file to another server without needing for manual intervention. i.e. the script will integrate sending the file to another server. Can anyone point me in the right direction to get started? Thanks! Hello everybody!
I'm here today with a mystery i can't solve...
The problem i'm having is that i need to be able to transfer mysql data from one server to another one.
Retrieving data from the one database is easy, but making it transfer to another server is not that easy for me.
I have it printing out the data ATM
This is how i retrieve data from one server:
<?php $dbhost = ""; $dbname = "eg_xenforo"; $dbuser = ""; $dbpass = ""; $conn = mysqli_connect("$dbhost","$dbuser","$dbpass","$dbname") or die("Error " . mysqli_error($conn)); $sql= "SELECT username FROM xf_user WHERE FIND_IN_SET('9',secondary_group_ids) UNION SELECT username FROM xf_user WHERE FIND_IN_SET('10',secondary_group_ids) UNION SELECT username FROM xf_user WHERE FIND_IN_SET('12',secondary_group_ids)"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { // output data of each row while($row = mysqli_fetch_assoc($result)) { $name = $row['username']; echo "$name <br>"; } } else { echo "0 results"; } ?>This is what i get as result: CosmonautBob ooglebrain JamieKG Quinnter16 Jordan Zoehamp skynet1123 misscupcake1306 Sir CrimsonThese are usernames that should be added onto another server in a database table. Any suggestions? Thanks in advance! I'm more of a php hobbiest having learned most of what I use from experimenting on our page. I just switched servers from Total choice hosting to Godaddy and now some of my functions are not working. The 2 biggest a On our where to play page the default that loads is our All page and that works but then people are supposed to be allowed to change types at the top and then hit select and pull up that page. The function loads up the folder properly but when you press Select City it just reloads the All page. I still have access to the old server till the end of the month in order to get files and anything else that I may have forgotten to copy over. Is there maybe a php file I should have brought over and forgot? The other big difference I noticed my old page was stored in public_html the new one is stored in the root directory. The page was originally created outside and I have maintained it for the last 5 years so I have been following behind the old code and didn't do the foundation myself. Thank you for any help you can give. The Code I have for these functions is: <?php echo "<form method=POST action=$PHP_SELF> <select name=\"selected_city\"> <option value=\"\"></option>"; //check files in directory if ($handle = opendir('locations/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo $file; $file = substr($file, 0, -4); echo "<option value=" . $file . ">$file</option>"; } } closedir($handle); } ?> </select> <input type="submit" name="submit" value="Select City" /> </form> <?php DEFINE('LOG_DIR', $_SERVER['DOCUMENT_ROOT'].'/locations/'); //if this is the first visit to this page, display the default city. if ($submit){ if($_POST['selected_city'] == ""){ echo "<p>No city selected, please try again.</p>"; exit; } $selected_city = $_POST['selected_city']; } else{ //default city - must match csv filename exactly prior to appending extension $selected_city = "All"; } echo "<p>$selected_city</p>"; $filename = $selected_city . ".csv"; $file = file(LOG_DIR.$filename); ?> The other big announce is that our front page has a news feed that I update through another page that edits and deletes and adds to the notepad file that is read by the front page. I have the notepad files permissions set to 777 but when I use the update it doesn't do anything. The code for this page is: <?php include "header.php" ?> <td width="75%" id="maincontain" class="main"> <?php include "adminbar.php" ?> <hr /> <?php if($action == "edit" && isset($HTTP_POST_VARS['password'])) { if($HTTP_POST_VARS['password'] == "gonews") { //Recompile that line with the pipe symbols so we can reinsert it $line = $HTTP_POST_VARS['date'] . "|" . $HTTP_POST_VARS['title']; $line .= "|" . $HTTP_POST_VARS['news']; $line = str_replace("\r\n","<BR>",$line); $line .= "\r\n"; $line = stripslashes($line); $data = file('news.txt'); $data[$id] = $line; //the next line makes sure the $data array starts at the beginning reset($data); //now we open the file with mode 'w' which truncates the file $fp = fopen('news.txt','w'); foreach($data as $element) { fwrite($fp, $element); } fclose($fp); echo "Item Edited!<BR><BR>\n"; echo "<a href=\"$PHP_SELF\">Go Back</a>\n"; exit; } else { echo "Bad password!\n"; exit; } } if($action == "edit") { $data = file('news.txt'); $element = trim($data[$id]); $pieces = explode("|", $element); //the next line is to reverse the process of turning the end of lines into breaking returns $news = str_replace("<BR>","\r\n",$pieces[2]); echo "Make the changes you would like and press save.<BR>\n"; echo "<FORM ACTION=\"$PHP_SELF?action=edit\" METHOD=\"POST\" NAME=\"editform\">\n"; echo "Title:<BR>\n"; echo "<INPUT TYPE=\"text\" SIZE=\"30\" NAME=\"title\" value=\"".$pieces[1]."\"><BR>\n"; echo "The News:<BR>\n"; echo "<TEXTAREA NAME=\"news\" COLS=\"40\" ROWS=\"5\">".$news."</TEXTAREA><BR><BR>\n"; echo "Password:<BR>\n"; echo "<INPUT TYPE=\"password\" SIZE=\"30\" NAME=\"password\"><BR>\n"; echo "<INPUT TYPE=\"hidden\" NAME=\"date\" VALUE=\"".$pieces[0]."\">\n"; echo "<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$id\">\n"; echo "<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Save\"><BR>\n"; echo "</FORM>\n"; exit; } if($action == "delete" && isset($HTTP_POST_VARS['password'])) { if($HTTP_POST_VARS['password'] == "nonews") { $data = file('news.txt'); //this next line will remove the single news item from the array array_splice($data,$id,1); //now we open the file with mode 'w' which truncates the file $fp = fopen('news.txt','w'); foreach($data as $element) { fwrite($fp, $element); } fclose($fp); echo "Item deleted!<BR><BR>\n"; echo "<a href=\"$PHP_SELF\">Go Back</a>\n"; exit; } else { echo "Bad password!\n"; exit; } } if($action == "delete") { echo "<H2>You are about to delete the following news item.</H2>\n"; $data = file('news.txt'); $element = trim($data[$id]); $pieces = explode("|", $element); echo $pieces[2] . "<BR>" . "<b>Posted by " . $pieces[1] . " on " . $pieces[0] . "</b>\n"; echo "<BR><BR>\n"; echo "Are you sure you want to delete this news item? If so, enter the password and click on Delete.<BR>\n"; echo "<FORM ACTION=\"$PHP_SELF?action=delete\" METHOD=\"POST\" NAME=\"deleteform\">\n"; echo "Password:<BR>\n"; echo "<INPUT TYPE=\"password\" SIZE=\"30\" NAME=\"password\"><BR>\n"; echo "<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$id\">\n"; echo "<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Delete\"><BR>\n"; echo "</FORM>\n"; ?> </td> </tr> </table> <br /> <?php include "footer.php"; exit; } ?> <?php $data = file('news.txt'); //next line removed to make everything else easier in the admin script //$data = array_reverse($data); foreach($data as $key=>$element) { $element = trim($element); $pieces = explode("|", $element); echo "<strong>" . $pieces[1] . "</strong> - <font color=\"DF9D00\" size=\"1\">" . $pieces[0] . "</font><BR>" . $pieces[2] . "<br /><br />"; echo " <a href=\"$PHP_SELF?action=delete&id=$key\">Delete</a>\n"; echo " <a href=\"$PHP_SELF?action=edit&id=$key\">Edit</a>\n"; echo "<hr><BR>\n"; } echo "<HR>\n"; echo "<H4><u>Add News</u></H4>\n"; if($HTTP_POST_VARS['submit']) { if($HTTP_POST_VARS['password'] == 'gonews') { if(!$HTTP_POST_VARS['title']) { echo "You must enter a Title"; exit; } if(!$HTTP_POST_VARS['news']) { echo "You must enter some news"; exit; } if(strstr($HTTP_POST_VARS['title'],"|")) { echo "Title cannot contain the pipe symbol - |"; exit; } if(strstr($HTTP_POST_VARS['news'],"|")) { echo "News cannot contain the pipe symbol - |"; exit; } $fp = fopen('news.txt','a'); if(!$fp) { echo "Error opening file!"; exit; } $line = date("m.d.y") . "|" . $HTTP_POST_VARS['title']; $line .= "|" . $HTTP_POST_VARS['news']; $line = str_replace("\r\n","<BR>",$line); $line .= "\r\n"; $line = stripslashes($line); fwrite($fp, $line); if(!fclose($fp)) { echo "Error closing file!"; exit; } echo "<b>News added!</b>\n"; } else { echo "Bad Password"; } } ?> <FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="newsentry"> Your Title:<BR> <INPUT TYPE="text" SIZE="30" NAME="title"><BR> The News:<BR> <TEXTAREA NAME="news" COLS="40" ROWS="5"></TEXTAREA><BR><BR> News Password:<BR> <INPUT TYPE="password" SIZE="30" NAME="password"><BR> <INPUT TYPE="submit" NAME="submit" VALUE="Post it!"><BR> </FORM> </td> <?php include "footer.php" ?> Hello,
I've installed a Debian x64 minimal package and a control panel on my VPS, but after I install the name servers, the domain doesn't reach my VPS's name servers for some reason.
The minimal package comes only with the tools to run the Debian server which means it had no sudo and such.
But previously when I had Centos on before switching to Debian, it did reach the name servers.
Which in this case I suspect that it's a server-side problem, could there be any ?
When I try to connect to the domain it says that the website is not available.
I am using zpanel and the default DNS records that the zpanel generates.
P.S. I tried to find the reason why it doesn't work but I couldn't find any solution, all I found is suggestions to add www A record which also didn't work.
And yes, I did wait 24 hours and even more.
Hi, I have a domain called domain-whois-lookup.com It is having 6 NS records, you can verify that at domaintools.com/domain-whois-lookup.com I have a following code : Code: [Select] <?php $result = dns_get_record("domain-whois-lookup.com", DNS_NS); echo count($result); echo "<p></p>"; print_r ($result['0']); echo "<p>================</p>"; for($i=0; $i<=count($result); $i++) { // @print_r ($result["$i"]); @$target_ns = $result["$i"]; echo "<p></p>"; print_r ($target_ns["target"]); echo "<p></p>"; } ?> After executing this, it shows only 4 records instead of 6, why ? One more thing is many times, first name server (e.g. ns1) shows as 2nd and 2nd NS as first, why ? Hi I am hoping someone can help. My hosting company has just moved my website to a different server, and I noticed that it was giving me blank pages, I added in some debug and now I am getting undefined variable errors and I don't know why or how to fix it. The Page which has broken currently gets its information from the database from the url. RewriteRule ^reviews/([^/]*)\/$ /bingosite.php?h1=$1 [L] The code in the broken page that is throwing out undefined variable errors is the following: <? $query = mysql_query("SELECT * FROM link where linktype='bingo' and h1 ='".StripUrl101(ucwords($h1))."'"); { while($row =mysql_fetch_assoc($query)) extract($row);?> <? if ($linkType=="bingo") { ?> <?php echo "$h1"; ?> <? } } ?> I have used this code for years so it could be that it is old but as I only know basic PHP I am very stuck and the hosting company isn't being very helpful. Just to add if I write <? $query = mysql_query("SELECT * FROM link where linktype='bingo' and h1 ='Quick Bingo'"); { while($row =mysql_fetch_assoc($query)) extract($row);?> The results for Quick Bingo appear on the page. However it needs to work dynamically like it was doing before. If anyone can help it would be appreciated. Thanks Rachael Edited by rachae1, 17 May 2014 - 04:29 PM. Hi, I am using the following PHP email code, and when I send it to my Gmail account it works fine, but some servers are blocking this email and are not being received. How can I tweak it to make it more compatible? Code: [Select] $headers = "From: $row_o_email[email] \r\n"; $headers .= "BCC: $row_o_email[email] \r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $to = $row_e['email']; mail($to, "subject", " email body ", $headers); |