PHP - Building .net Apps?
In php how could I build a .net application?
So I have a source that I want to build in .net, but i'm not sure how... Similar TutorialsHey guys so I am making an online App website. So I need to it to be so some apps will be added by default. Then users can search for apps and "install" apps but really just have them show up on the homepage. So how would the database design work like have a field that is updated to 1 if the user has it installed and 0 if its not. And then do like an if statement to pull all the fields with 1 where username='$username'. And when it pulls it should I add like a URL field to it to so when it pulls the app information there will be a link to the app url. Could somebody please help me with what I should do because I am really confused on what design and if statements I should use
I just built a new app and I used the same shopping cart class I created in a previous app. This way when I add something in the old app's shopping cart, it also shows up my new app's cart Any ideas how can I solve this ? Hey all
I have been building sites for a long time and I am pretty confident in modern frameworks like Bootstrap etc. I have played about with JQuery Mobile and UI. I know how to make mobile sites from a front end side. I understand that I can upload my site to PhoneGap and turn it into a native app.
However, I would love to know how to make useful apps that dont just display static text. E.g. using things like Google Places API.
I know how to make mobile sites easily enough that display info. I just don't really understand how to link that up with dynamic data from APIs etc. How to feed that content back to the user.
For a vasic example, say I wanted to have a simple app that had a search box. You enter 'PIZZA' into it and it comes back with a result of all local pizza spots. How would I do that?
If someone could point me in the right direction for where I could experiment with this I would be really grateful . I have my dns set so that it uses google servers to handle my email. I have a spf record: Host: @ TXT Value: v=spf1 include:_spf.google.com ~all However if I want to send mail using the php mail function how do I do this? because it is getting seen a spam because I assume it is not being seen as coming from google servers but from my websites server?... what do I do in this case? I was wondering about developing simple client side graphical apps.
I was thinking of using php with an ODBC connection to the data store.
The data store might be a text file in CSV format or something similar. (maybe even a spreadsheet)!
I was wondering what would be a very simple minimally useful web server to run on the client?
The client would probably be MS Windows XP/7.
What are your thoughts?
Dear Friends,
I have 3 different Applications under the same server. Please, could you help me to share info between them?
App1 is a "User Admin Application". Here the user should do the login. After the login, the User should be able to open App2 or/and App3 I like to set up websites for people who don't have the know how to do it themselves, I mainly set them up wordpress sites cuz thats pretty easy for them to modify and maintain themselves. To save myself time, I decided to learn how to do it with Composer (what a brilliant tool that it). Can anyone who uses composer for this kinda thing, can you post your composer.json files here. Also, if anyone can show me a better way of doing things, it'd be much appreciated. Heres the one I made:
{ "name": "acme/brilliant-wordpress-site", "description": "My brilliant WordPress site", "repositories":[ { "type":"composer", "url":"http://wpackagist.org" } ], "require": { "johnpbloch/wordpress": ">=3.8.0", "wpackagist-plugin/captcha":">=3.9", "wpackagist-plugin/tinymce-advanced":">=4.0.0", "wpackagist-plugin/wordpress-importer":"*", "wpackagist-theme/hueman":"*", "wpackagist-theme/eclipse":"*", "wpackagist-theme/raindrops":"*" }, "extra": { "installer-paths": { "mysite": ["johnpbloch/wordpress"], "mysite/wp-content/plugins/{$name}": ["type:wordpress-plugin"], "mysite/wp-content/themes/{$name}": ["type:wordpress-theme"] } }, "autoload": { "psr-0": { "Acme": "src/" } } }I think I'm doing this in a silly way though. I read about these composer installer things on github, but I didn't figure out how to use them so instead I used the installer-paths key to make the autoloader put the files in the right place. Heres a composer.json file I found which is better cuz it uses a post installation script: { "require": { "wordpress/core": "3.5.2", "wordpress/twentytwelve": "1.1", "wordpress/akismet": "2.5.7", "wordpress/google-sitemap-generator": "3.2.9", "wordpress/google-analytics-for-wordpress": "4.3.3", "wordpress/wordpress-importer": "0.6.1" }, "repositories": [ { "type": "composer", "url": "https://raw.github.com/wordpressoncomposer/composer-repository/master/" }, { "type": "vcs", "url": "https://github.com/wordpressoncomposer/installer" } ], "scripts": { "post-install-cmd": "Wordpress\\Composer\\InstallerTasks::wpConfig" }, "extra": { "wordpress_coredir": "wordpress/core", "wordpress_wp_contentdir": "wordpress/wp-content", "wordpress_wp_config": { "site_url": "http://localhost", "db_host": "localhost", "db_user": "root", "db_pass": "", "db_name": "wordpress" } }, "minimum-stability": "dev" }I'm gonna start using these scripts once I figure out how to use them. Where are the scripts stored? I haven't a clue what this autoload thing is all about either, is it a tool for moving files into the appropriate directories? See how the first file gets wordpress from packagist, and the second one gets it from github. Is there a difference? If I was to add that post-install-cmd key to the first composer.json file, would it still work? In other words, do both repositories contain identical packages. Hi guys, I have recently been asked by a freinds to turn his web-site in to a CMS web site and i was just wondering if implementing it in php is the write way to go about it. I have never realy build anything like a CMS so if you guys have tips for me that would be spot on. Hey guys, I'm not exactly sure what the term used for this is, but I'll try explaining it very thoroughly. My site I'm building is this: http://r-gaming.net/urban-rp/home/ On index.php file, I would like it so you if you're logged in (I have a logged in system already scripted), you're able to post current news. Something like this: http://ls-rp.com/ Would anyone willing to help me by linking a tutorial to code this method 'latest news' tool? Would be greatly appreciated. Crayon Hi All, I have an array like this where the cars are the first level of the array, and the owners are children of that first level: [Car 1] ----[Owner 1] [Car 2] ----[Owner 2] [Car 2] ----[Owner 3] [Car 2] ----[Owner 4] I want to convert it to: [Car 1] ----[Owner 1] [Car 2] ----[Owner 2] ----[Owner 3] ----[Owner 4] So I started making this script: $cars = array(); foreach($owners as $owner) { if(!in_array($owner['Car'], $cars)) { $cars[] = $owner['Car']; } echo array_search($owner['Car'], $cars, true); $cars[array_search($owner['Car'], $cars)]['Owner'][] = $owner['Owner']; } The result of this is the same as the beginning result, any ideas what could be causing that? If I use this code: $values = range(0, 10); echo "<select name=\"my_field\">\n"; foreach($values as $v) { echo "<option value=\"$v\">$v</option>\n"; }echo "</select>\n"; to generate a dropdown, it will offer options from 1 thru 10. Is there any way to make them increment by .50 (ie: 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, etc.? Greetings freaks, I am trying to figure out how to build an array for the following purpose, and have just been spinning my wheels as it's a very new topic to me. I have a database with a table and the following important rows: ID, Parent, and Name. In this table, Parents are given the value 0 for 'Parent' and a unique 'ID' & 'Name' - children are given all unique 'ID' and 'Name' with the value for Parent being 'ID' of the Parent they belong to. Example: ( as 'ID', 'Parent', 'Name') 1, 0, John & 2, 1, Jane / 3, 0, Mark & 4, 3, Mary & 5, 3, Mindy. As you can see, the second names in each example (the children) are connected to their parents by the 'Parent' row, whereas the first names (the parents) are not associated with anybody else. What I would like to do is build an array that associates every child to the parent ([Parent] => child1 ). Simple MySQL grants me an array for the parents: $parent_pull = mysql_query('SELECT * FROM `table` WHERE Parent = 0') while($row = mysql_fetch_array($parent_pull)){ $name[] = $row['Name']; $id[] = $row['ID']; } Now, I want to be able to use the $id[]s to build arrays WHERE Parent = $id[]. I have tried in loops with $id[$i] & $i++ to cycle the array values, but PHP tells me there mysql_fetch_array() expects parameter 1 to be resource, boolean given ... on line 32. $i = 0 while($i < 10){ $child_pull = mysql_query('SELECT * FROM `table` WHERE Parent = $id[$i] '); $child = mysql_fetch_array($child_pull); $child[] = $child['Name']; <-- Line 32 $i++; } How would I go about pulling all the children and associating them with their parents? Hi Guys I am trying to build a menu sing the code below, I can get the main headings, the problem arises when I try and produce the sub menus. Can someone please tell me where I am going wrong, or a better way of getting the desired result Code: [Select] <?php function submenu() { $submenu_sql=mysql_query("SELECT * FROM `tbl_menu` where `parent_menu_id` = '$menu_row[menu_id]'"); if(mysql_num_rows($submenu_sql)>0) { echo('<ul>'); while ($submenu_row=mysql_fetch_assoc($submenu_sql)) { echo('<li><a href="'.$submenu_row['link'].'">'.$submenu_row['menu_display'].'</a></li>'); } echo('</ul>'); }; } $menu_sql=mysql_query("SELECT * FROM `tbl_menu` where `parent_menu_id` = '0'"); if (mysql_num_rows($menu_sql)>0) { echo('<div id="accordian">'); while ($menu_row=mysql_fetch_assoc($menu_sql)) { echo('<div class="panel_container"> <h3><a href="'.$menu_row['link'].'">'.$menu_row['menu_display'].'</a></h3> <div class="panel_body">'); submenu(); echo('</div> </div>'); } echo('</div>'); } ?> I am getting the following error Notice: Undefined variable: menu_row in /home/sites/j-slink.co.uk/public_html/includes/menu.php on line 4 The desired result is to produce a menu with the following layout Code: [Select] <div id="accordion"> <div class="panel_container" id="panel1"> <h3 id="visible">Home</h3> <div id="panel1-body" class="panel_body"> </div> </div> <div class="panel_container" id="panel2"> <h3>Music</h3> <div id="panel2-body" class="panel_body"> <div> <ul> <li>Calling Card Mixing Tape</li> </ul> </div> </div> </div> <div class="panel_container" id="panel3"> <h3>Panel 3</h3> <div id="panel3-body" class="panel_body"> <div> This is the contents of this panel. </div> </div> </div> <div class="panel_container" id="panel4"> <h3>Panel 4</h3> <div id="panel4-body" class="panel_body"> <div> This is the contents of this panel. </div> </div> </div> <div class="panel_container" id="panel5"> <h3>Panel 5</h3> <div id="panel5-body" class="panel_body"> <div> This is the contents of this panel. </div> </div> </div> </div> Thanks in advance I was thinking how can I make a script that will build strings incrementing through each letter starting with "a" and ending with "zzzzzz" or what ever ending length I want such as 12. So if your were to output everything, you could find the words: "dog" "spider" "superman" "hippo" etc What would be the best way to do this, so I don't have to have a loop that is 500 blocks deep to show a word that is 500 letters example Quote a ... z aa ab ac ... az ba bb bc ... ... aaa aab aac Hey guys, I'm currently trying to make a tutorial website, and I'd like to have a fairly simple blog / news page that I can update with pictures and news stories. I would also like people to be able to comment on these postings. I'm pretty new to PHP but i made a simple blog using a php handler and a database table, but I was just wondering is there some 3rd party application I can use to manage my website with like users and articles and such without having to use their website layout? Like, programs such as WordPress and PHP-Fusion, Joomla etc, dont let you use your own html and css pages do they? I want to keep my website but have something purely in the background for me to manage the content and maybe like paste some script to my actual pages or whatever. Im just lost is all I need a little guidance =] Thanks a bunch. Hi people. I'm building a quiz with one correct answer out of possible 4. My problem is that after I choose a random answer (which is the correct one) I have problems with choosing random 3 wrong answers which are not the same as answer 1 (they all come from the same table). My first mysql query gives me back 1 row my second mysql query gives me back 15 row (there were 16 - 1 which is the correct one). How can take only 3 rows out of that second query and output them into variables that I can later echo into a form? Can you help me understand this problem or can you propose an alternative method to deal with this? Here are my two queries: Code: [Select] // Fetch random answer (correct) $query = "SELECT * FROM psychofarm_brand WHERE `id`=".$randomNumber; $result = mysql_query($query); $row = mysql_fetch_array($result); // Fetch wrong answer $query2 = "SELECT * FROM psychofarm_gen WHERE `id`!=".$randomNumber; $result2 = mysql_query($query2); $row2 = mysql_fetch_array($result2); I hope this is clear. Thanks Why is the proper way to call a class is to call a method at the same time? For example Code: [Select] $class = new SomeClass(); $class->some_method(); I understand why you would do this but lets say you just have a simple class that you pass some data. The class than processes the data in some way than returns it. It is my understanding if you were to make a class likes this. Code: [Select] class SomeClass{ function __construct($data){ //process data// return $data; } } That this code is considered an improper way of doing this because you should never return data from the __construct. So would this follow code be the proper way to handle this? Code: [Select] class SomeClass{ function __construct($data){ $this->some_method($data); } function some_method($data){ //process data// return $data; } } Any good explanation on the proper way to handle this would be greatly appreciated. When I am making simple classes to do a specific task it would seem more efficient not having to know about any particular method inside the class. Here's my build a querty code... Code: [Select] $sql = "UPDATE $tablename SET DIST_PART_NUM = '$dist_part_num', DIST_PUB = '$dist_pub', MFR_PART_NUM = '$mfr_part_num', MFR_PUB = '$mfr_pub', ITEM_DESC = '$item_desc', ITEM_STD_DESC = '$item_std_desc', ITEM_COPY = '$item_copy', COST = '$cost', GP_MULT = '$gp_mult', ITEM_IMAGE = '$item_image', ITEM_URL = '$item_url', COUNTRY_OF_ORIG = '$country_of_orig', CATEGORY_ID = '$category_id', PICGROUP_KEY = '$picgroup_key', UPC_CODE = '$upc_code', LEADTIME = '$leadtime', UNITS = '$units', LENGTH = '$length', WIDTH = '$width', HEIGHT = '$height', WEIGHT = '$weight', FLAG_HAZARDOUS = '$flag_haz', FLAG_LTL = '$flag_ltl', FLAG_NON_RETURNABLE = '$flag_non', CAMPAIGN_KEY = '$campaign_key', "; foreach($atr as $key => $value) { $sql .= $value . "='" . addslashes($_POST[$value]) . "',"; } $sql2 = rtrim($sql,","); $sql2 .= " WHERE DIST_PART_NUM = '$partnumber' OR MFR_PART_NUM = '$partnumber'"; Now the query get's built 100% fine that's not the issue... my issue is that sine if the table fields are named something like #_of_shelves... and the # sign causes a MySQL error... You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 26 How can i allow for the # sign, or any other character that can cause issues like () . , * ~ etc.... i tried encompassing the field name with single quotes 'fieldname' and with those slanted ones `tablename` but that did not help. Any ideas? Thanks! I am building a shopping cart with PHP and working with a tutorial (http://jameshamilton.eu/content/simple-php-shopping-cart-tutorial) I am putting together the cart and there is some coding $sql = sprintf("SELECT name, description, price FROM php_shop_products WHERE id = %d;", $product_id); That i do not understand. Here it is "WHERE id = %d;" I have never seen this before and am wondering what it means or how to work with this syntax This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=352102.0 |