 |
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-fou
|
|
|
|
 |
I am going to create a computerized enrollment system for my thesis. Typically, whenever I will use PHP as my programming language, the system about to create is always web-based. But in my case, I am going to use PHP for Intranet only and my adviser told me that it should be client server in terms of getting the records from the database. Is it possible?
|
|
|
|
 |
Yes. You can use PHP in such way (and no need of web for that). Search for PHP database access...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
 |
Is it the same just like client server in ASP.Net? I have not yet encountered that kind of scenario. Is there any processes/instructions that I need to follow?
|
|
|
|
 |
On the theoretical level there is no real difference...but in practice there is! The get exact answers you have to read about PHP and database and client-server...a lot!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
 |
Its has many Database tables compared with other carts db structure. Its very slow.
To write a magento module and access db, you need to use PHP ORM.
Direct sql queries and magento templates are even more complicated.
I dont understand why Clients prefer magento?
There are alternatives like Prestashop etc.
modified 14-Aug-14 15:03pm.
|
|
|
|
 |
That doesn't look like a question, unless you count the "why clients prefer magento" line, which isn't really something we can answer.
Rants about "why insert technology here sucks" belong in the Lounge.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
 |
Its not a Rant. I have explained how magento works.
If you have worked on magento, you will understand what i am saying is true.
|
|
|
|
 |
It's still not a question, though.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
 |
The html designer is giving me html templates and i should add php code to it.
Both PHP and html are mixing up and becoming very ugly.
Hard to maintain or make changes in the future.
How to format properly?
I know Template engines, but i think it adds additional complexity.
|
|
|
|
 |
By definition PHP and HTML should be mixed - that's the way PHP works. However the level of the mixing is up to you (or your template), you are the one who have to define what code is necessary to be in the HTML and what can be sit in pure PHP modules and called by the proper code from the HTML.
It's not clear from your question what HTML designer messing with your code, but in any case you can go for total control using some pure text editor ...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
 |
This is to expand upon the previously given answer. Yes, HTML and PHP are mixed but there are methods you can follow to split design from content which is usually the way to go whether you are doing all of the site development and then maintaining it yourself or if you're developing the site to be handed over to content people.
Here is a VERY simple/rough sample of how I try to achieve this myself:
<?php include "modules.php >
<html>
<head>
<title>My Title</title>
<!-- link to external css file to control the layout/design of DIVs
</head>
<body>
<div class="menu_column">
<?php user_menu(); >
</div>
<div class="content_column">
<!-- content writer: Please enter all of your content in the section below -->
<!-- End Content Section -->
</div>
</body>
</html>
Note: I had to remove the closing PHP tags in the example because it was messing up the rest of the entire post.
Now this is the PHP page which you would give to whomever handles the content of each page. They can just keep making copies of the file and name them how they wish to create the multiple pages that make up the site. Now you have:
MODULES.php
<?php
function user_menu() {
echo '
<!-- the PHP and HTML code that would make up your user menu which will then be
printed to the very spot where you called the function -->
';
}
?>
In some of my sites I have membership service. If the visitor is not logged into the site, the user_menu function will print out the HTML to create the login form. If they have an account and are logged in then the user_menu function will print a table of links involving their account. All of the checking whether or not someone is logged in is handled in the function located in modules.php.
Now, you could do this as many times as is necessary throughout your php files. Just tell the content manager to not touch anything around/within the PHP tags. This will GREATLY minimize the amount of code that you want the PHP interpretor to process being shown within each physical PHP file that someone else will be working with.
This is something of a cheap templating system. If you have PHP modules that do not print anything out to the browser then it isn't as important where you place the function calls amongst the HTML tags. But this will give you more solid control over placement of HTML elements/objects that are created by your PHP.
I believe that it is the easiest and most efficient way to separate design/content from program code without having to try to use a full-blown templating engine which would just create more headaches if you really do not need the kind of 'power' that SMARTY and other engines offer.
I hope this was not too difficult to understand and that it helps at least a bit.
|
|
|
|
 |
is it possible to make INSERT all checkbox values into database when there is not even one checkbox being checked since im using array_diff as shown below?
my problem currently facing is,
when there is a checkbox being checked, it will insert into checked_table and the remainder options which did not selected will insert into unchecked_table.
howewer, when all checkbox didnt being selected, and click on submit button, the value didnt send to my database unchecked_table.
<pre lang="PHP"><?php
include('connect.php');
$checked = ($_POST['date']);
$unchecked = ($_POST['nondate']);
$diff = array_diff($unchecked,$checked);
if(isset($_POST['date']))
{
foreach ($_POST['date'] as $dateValue)
{
$insert="INSERT INTO checked_table ($colm_ladate) VALUES ('$dateValue')";
mysql_query($insert);
}
echo header("location:home.php");
}
if (isset($_POST['nondate']))
{
foreach ($diff as $dateValue2)
{
$insert2="INSERT INTO unchecked_table($colm_lrdate) VALUES ('$dateValue2')";
mysql_query($insert2);
}
echo header("location:home.php");
}
?>
|
|
|
|
 |
how to create invoices in PHP?
|
|
|
|
|
 |
but here I was a beginner, who just understand the basic of PHP
|
|
|
|
 |
Then go and buy a book and study it, or find some online courses. It is not possible to provide an answer to such a broad question.
|
|
|
|
 |
I Need to create this XML using PHP:
<con:ContractOptions>
<con:ContractOption>
<con:Id>49</con:Id>
<con:Description>Diesel/Turbo</con:Description>
<con:IsSurcharge>false</con:IsSurcharge>
<con:NetCost>150.00</con:NetCost>
</con:ContractOption>
<con:ContractOption>
<con:Id>50</con:Id>
<con:Description>AWD/4WD</con:Description>
<con:IsSurcharge>false</con:IsSurcharge>
<con:NetCost>100.00/con:NetCost>
</con:ContractOption>
<con:ContractOption>
<con:Id>51</con:Id>
<con:Description>Commercial Vehicle</con:Description>
<con:IsSurcharge>false</con:IsSurcharge>
<con:NetCost>75.00</con:NetCost>
</con:ContractOption>
</con:ContractOptions>
Here is the section of my PHP code to build that XML:
$ContractOptionFields = array(
"con:Id" => $OptionId,
"con:Description" => $Surcharge_Description,
"con:IsSurcharge" => $IsSurcharge,
"con:NetCost" => $OPTION_NetRate
);
$ContractOptions = array(
"con:ContractOption" => new SoapVar($ContractOptionFields, SOAP_ENC_OBJECT)
);
$arcontract = array(
"con:ContractOptions" => new SoapVar($ContractOptions, SOAP_ENC_OBJECT), ...
My code will only produce one set of contract options like this:
<con:ContractOptions>
<con:ContractOption>
<con:Id>49</con:Id>
<con:Description>Diesel/Turbo</con:Description>
<con:IsSurcharge>false</con:IsSurcharge>
<con:NetCost>150.00</con:NetCost>
</con:ContractOption>
</con:ContractOptions>
How do I build more than one option into this XML using my PHP code sample? Do I need to use a PHP for Loop? Not sure how to set this up.
Thanks for your assistance.
|
|
|
|
 |
what,s the new app today that demanded using php....????
|
|
|
|
|
 |
how to work on chat app by using php........plz tell the coding
|
|
|
|
 |
Please do your own research, Google will find you many samples.
|
|
|
|
 |
Message Automatically Removed
|
|
|
|
 |
Dear All, I have already json file that have data EmpCode and EmpName. But how can I show the data in text box on my web page.Please help me.Here are my code. <pre lang="text"> <html> <head> <title>Employee</title> <?php function getemployee() { $url = "http://localhost/1004.json"; $json = file_get_contents($url); $data=json_decode($json, TRUE); return $data; } ?> </head> <body> <form method="post"> Emp Code:<input type=text name="text1" /> <br> Emp Name:<input type=text name="text2" /> <br> <input type="submit" onclick="'<?php' getemployee(); '?>'" value="Get"/> </form> </body> </html> </pre>
|
|
|
|
 |
<input type="text" name="text2" value="<?
echo $json = getemployee();
$json->var
?>"/>
obj is your Variable name
use print_r(getemployee()) view json Structure;
|
|
|
|
 |
Dear All,
I'm a win app programmer but a very fresher in web. Now I have to do with web, so I am studying in web with PHP. I have to figure out the problem that I want to show data from Sql Database on PHP web page via web service by generating JSON file. I don't use the internet. All are in local only. I create web page two text box and one button. I type 01 employee code in textbox1 and click the button to get employee name from sql db. There are function in web services. When the button click, PHP page will send 01 to web service and then the function in web service will get the emp name from sql db and returns json file and finally PHP page will be read json file and show emp name in textbox2. So I can't control one round procedure PHP, Web Service, JSON and Sql db. Please help me. Very thanks everyone. I hope with great wish for that. Please.
Thanks you all
|
|
|
|
 |
use function to send response to browser in json format or just echo response array in json public function send_response($response_data){ //$resonse_date is of array type echo json_encode($response_data); } catch json response in ajax callback for success . $.ajax({ url: 'php service call' , type : 'POST',// type of call GET ,POST data : JSON.stringify(params),//pramas array success :function(data) {//call back functin //reponse data in json format //put here your logic }, error : function(data){alert('if any error');} });
|
|
|
|
 |
I m installed sqlserver for my final project... i wanot installed properly.. i uninstalled it.. no i m installng it again but getting the following error when i click on the icon of "SQL Server Management Studio Express".. plz help me.. i would be very thnkful to you.
"The automatically saved settings file ' C:\Users\Bilal\Documents\ SQL Server
Management Studio Expres\Settings\CurrentSettings-2014-06-18.vssettings' cannot be found.You can change this file on the 'Import and Export Settings' Tools Options Page. the IDE will use the most recent settings for this session."
|
|
|
|
 |
Hi,
f anyone tried a PHP framework, which you'll recommend please?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
 |
None!
Frameworks are good, if you get in the area of content management, otherwise they are just a waste of time.
|
|
|
|
 |
Hi guys! I need your help !
I'm doing a form in PHP and a want to display in my dropdownlist name column from my DB and save the name_id of that name selected from dropdownlist in DB.
Here is my code
if(isset($_POST["submit"]))
{
$bookshop_id = mysql_real_escape_string($_POST["bookshop_id"]);
$book_id = mysql_real_escape_string($_POST["book_id"]);
$quantity = mysql_real_escape_string($_POST["quantity"]);
mysql_query("INSERT INTO `books_bookshop`(`bookshop_id`,`book_id`,`quantity`)
VALUES ('" . $bookshop_id . "','" . $book_id . "','" . $quantity . "')")
or die ("Book could not be registered.");
}
?>
|
|
|
|
 |
<form method="post" action="#">
<label for="bookshop_id">Bookshop Name</label>
<select style="width:148px;" id="bookshop_id" name="bookshop_id" value="bookshop_id" >
<?php
$query = mysql_query("SELECT `name`,`bookshop_id` FROM `bookshop`");
while ($row = mysql_fetch_array($query))
{
?>
|
|
|
|
 |
<option>
<?php echo $row["name"]; ?>
</option>
<?php } ?>
</select>
</td>
</tr>
<tr><td><select name="book" id="book" value="book">
<?php $query = mysql_query("SELECT `name` FROM `books`");
while ($row = mysql_fetch_array($query)){?>
<option><?php echo $row["name"]; ?></option>
<?php } ?>
</select>
<tr>
<td><input type"submit" name="submit" value="Register book"></td>
</tr>
</table>
</form>
|
|
|
|
 |
Why have you posted three messages? It looks like you have answered your own question.
Use the Edit link at the bottom of your original, add the extra code and description, and delete the other two messages.
|
|
|
|
 |
have a tree menu(category,subcategory,sub-subcategory...) its all in a single table and uses parentID to determine layout of the menu. would like to now be able to update the menu by adding new menus(not on the server side). have a dropdown list of the menus where you select the parent from existing menus from the table(if you select none,then creates a new category in the table else inserts under matching parent based on parentID).need help parsing the selection from drop down menu to the parentID column in the table. am new at this so hope my question makes sense. Reggie
|
|
|
|
 |
Use PHP and angularjs to generate dynamic menu. 1.php service read your data send response in json format. 2.Angular app init with menu item. your html code like (menu.html) <pre> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> <style> *{ margin ; padding ; } body{ font:15px/1.3 'Open Sans', sans-serif; color: #5e5b64; text-align:center; } a, a:visited { outline:none; color:#389dc1; } a:hover{ text-decoration:none; } section, footer, header, aside, nav{ display: block; } /*------------------------- The menu --------------------------*/ nav{ display:inline-block; margin:60px auto 45px; background-color:#5597b4; box-shadow 1px 1px #ccc; border-radius:2px; } nav a{ display:inline-block; padding: 18px 30px; color:#fff !important; font-weight:bold; font-size:16px; text-decoration:none !important; line-height:1; text-transform: uppercase; background-color:transparent; -webkit-transition:background-color 0.25s; -moz-transition:background-color 0.25s; transition:background-color 0.25s; } nav a:first-child{ border-radius:2px 0 0 2px; } nav a:last-child{ border-radius 2px 2px 0; } nav.home .home, nav.projects .projects, nav.services .services, nav.contact .contact{ background-color:#e35885; } p{ font-size:22px; font-weight:bold; color:#7d9098; } p b{ color:#ffffff; display:inline-block; padding:5px 10px; background-color:#c4d7e0; border-radius:2px; text-transform:uppercase; font-size:18px; } </style> <!-- Adding the ng-app declaration to initialize AngularJS --> <script type="text/javascript"> var menuApp = angular.module('menuApp', []); menuApp.controller('menuCtrl', function ($scope,$http) { $scope.active = 'Blog'; $scope.description = '' $scope.menuList = [ { 'name': 'Home', 'description': 'Home page.' }, { 'name': 'Projects', 'description': 'projects page.' }, { 'name': 'Services', 'description': 'services page.' }, { 'name':'Contact', 'description':'contact page.' } ]; $scope.activeMenu = function(menu){ $scope.active = menu.name; $scope.description = menu.description; }; $scope.loadMenu = function() {
$http({ method: 'GET', url: 'menu.php' //url contain your php service which return data in json format }).success(function(data) { $scope.menuList = data; }).error(function() { }); } // $scope.loadMenu(); }); </script> <div id="main" ng-app="menuApp"> <!-- The navigation menu will get the value of the "active" variable as a class. The $event.preventDefault() stops the page from jumping when a link is clicked. --> <div ng-controller="menuCtrl"> <nav class="{{active}}" ng-click="$event.preventDefault()" ng-repeat="menu in menuList"> <!-- When a link in the menu is clicked, we set the active variable --> <a href="#" class="{{menu.name}}" ng-click="activeMenu(menu)">{{menu.name}}</a> </nav> <!-- ng-show will show an element if the value in the quotes is truthful, while ng-hide does the opposite. Because the active variable is not set initially, this will cause the first paragraph to be visible. --> <p ng-hide="active">Please click a menu item</p> <p ng-show="active">You chose <b>{{active}}</b> </p> <span ng-show="active"> <b>{{description}}</b></span> </div> </div>
</pre> //your ajax call get response from php service while page load and populate your menu as per your choice.
|
|
|
|
|
 |
Why post it here again! It's not accepted to cross-post, specially when you already got some answers in Q&A;!!!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
 |
Hi
I didn't get any answers since. I thought I had posted it in the wrong session; This is why I reposted it here. Sorry;
Any idea to my problem;
|
|
|
|
 |
You got some! answer. If this isn't good enough than comment there!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
 |
The Joomla docs are very basic, so I'm asking for directions to other resources on what is involved and what I must do to create a Joomla module. The module must manage merchants and vouchers, two custom content types I presume, and members, built in I presume. I need to create/manage these, and create capture and maintenance screens for vouchers and merchants. What are the high level tasks required to do this? The coding and creation of the basic module package I can manage, but how does it all fit together etc? I'm .NET, and have only done WordPress plugins on the LAMP side.
|
|
|
|
 |
Hi... I am using input box to user enter date which is the my db table. When user input date and click submit button it shows report,up to this works fine. From here I want to show 10 items per page with previous next button. How do I do?
|
|
|
|
 |
Report? using which tool? Always include those details in your question.
Basically you could achieve that using options like formula. Do Google search using "Your reporting tool + paging", you'll get tons of results.
Or if you're using any direct output by HTML, use filter(s). Check these articles(not related to php)
Efficient paging using SQL script[^]
Paging GridView with ROW_NUMBER()[^]
|
|
|
|
 |
Hi,
I would like to ask if anyone tried upload a photo using PHP and HTML.
I don't want to use Browse and Upload buttons. I just want the user to click on Upload which will browse then upload immediately to a dynamic folder.
are there any good free plugins available? or your recommend to code it?
Thanks,
Technology News @ www.JassimRahma.com
|
|
|
|
 |
use ftp right?write(program) a can upload's website,right?use the html 5 and javascript code,right?,im a beginner and im a chinese.i have alway practise my english
|
|
|
|
 |
Here is a link that may lead you to an answer you seek.
https://code.google.com/p/html5uploader/[^]
This should allow users of your site to drag and drop a file from their OS to be uploaded to your site in their browser. This will create a button to 'browse' but then they should not have to click an upload button and therefore you should not have to display an upload button.
You can have it save to a 'dynamic' directory/folder by manipulating the save directory in the PHP page that is shown on that site's page. Let's assume that that want files save into a directory named after the user but all user's folders are inside a directory called user_uploads. You will have to set it to an "id" that, obviously, would be unique to each user of your site. If users have a unique username then it could be $username or if they have a unique ID number associated with their account then it could be $user_id .
First change the name of the upload folder to what you want...as described above I am going with user_uploads:
$upload_folder = 'user_uploads';
Then you would have to do an additional change to the lines shown below to add it to the dynamic folder with the user's unique ID.
if(file_put_contents($upload_folder/$username.'/'.$headers['UP-FILENAME'], $content)) {
echo 'done';
}
For safety's sake I would either create a new directory named with a registering members unique ID upon creation of a new account or at least right before the second code shown to make sure that they actually have an existing directory to download into. Although it might be better to go with the second option here as you may have a lot of members who do not want to upload anything and therefore you could end up with a whole lot of empty directories sitting in that parent directory. Creating the directory (with appropriate permissions to store and show images) right before the upload process could ensure that only those users/members that actually want to upload something will have a folder.
You can download the 3 files plus the .js file from that link above. However, the link to demo this in action appears to be broken. But it's pretty simple and straightforward so it shouldn't take too much work to change a couple variables, upload to your server and test it yourself.
If you have a problem with this then just try searching the web for PHP HTML5 uploading for other possible options.
Many people are working with HTML5, PHP and JQuery to create such things. Just be aware that such things can be dependent upon a user having particular version numbers of particular browsers and you should make note of it accordingly on your site.
|
|
|
|
 |
Hi,
I have a two mirror sites,
http:I am trying to use the SOAP V2 in both the sites. Its working fine in ‘http:But in ‘http:When I open the SOAP URL ‘http:Not able to get what the exact error is. Pls help if possible.
|
|
|
|
 |
I just had these error a few days before. The problem was with the hosts file of the server. The domain name (in your case domain) wasn't in the hosts file so it PHP wasn't able to resolve it...
You can do one these things to fix it:
1. Add new entry to hosts file
2. change url to localhost or ip
3. change url to relative
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
 |
Where do i look for the host file to make an entry into the file? I access the site folder from Plesk control panel.
|
|
|
|
 |