|
Are you sure you saved the modified version of the code before running it? If it still says "$rs" then it must be using the version before you changed the name. It is almost guaranteed that you have some mismatched quotes in your SELECT string.
|
|
|
|
|
I have a table has two columns one which show a dropdown field for no of rooms (1,2,3 ) and the other which shows the price of the room selected with total nights ( EGP 200 ) i have this code but its not working well, can someone help me? :
>
check_in_date) && !empty($this->check_out_date)) {
$room_info = $room_db->getAvailableRooms($room_type_info['id'], $this->post_search_info);
$pprice = $room_info[0]['total_price'];
?>
$(document).ready(function() {
$("#target").kendoTooltip({
autoHide: false
});
});
getShortName() . ' ' .''. $this->escape($pprice).''; ?>
Show prices
>
check_in_date) && !empty($this->check_out_date)) {
?>
0
$room_info_arr) {
$price_sum = $this->price($this->escape($room_type_info['descount_price']));
$per_night_price_sum += $price_sum;
$selected = ($this->postValues['apartments_no' . $count] && in_array($room_info_arr['room_id'], $this->postValues['apartments_no' . $count]) ) ? 'selected="selected"' : '';
if(!$this->postValues['apartments_no' . $count] && $room_info_key == 1){
$selected = 'selected="selected"';
}
$room_id_value .= (empty($room_id_value)) ? $room_info_arr['room_id'] : ',' . $room_info_arr['room_id'];
$price += $room_info_arr['total_price'];
//$selected =
echo '' . $room_cnt . '';
$room_cnt++;
}
}
?>">
|
|
|
|
|
I am new in LAMP. I want to run a simple web app running python using Django and some good interface like mod_wsgi. I have googled a lot but I am not succesful. Please give me step by step process to do it. Please suggest appropriate server.
I am using windows 7.
|
|
|
|
|
Member 9493720 wrote: Please give me step by step process to do it. No one is likely to do that on a programming forum. You need to find some tutorials and samples for yourself and start studying the systems you want to use.
|
|
|
|
|
I am looking to build a portfolio of code samples that can show what I can do as a developer. However, I am not sure what types of things I can program. What are some projects that are relatively short to medium that I can build to help build a portfolio of code samples? I know people suggest having something that shows off knowledge in OOP but other than that I'm not sure what I can create. Thanks.
|
|
|
|
|
Brandi Boseman wrote: I am not sure what types of things I can program.
Brandi Boseman wrote: I'm not sure what I can create.
There seems to be a problem with your approach.
Have you done any coding? Share sample functions. It does not have to be anything big or long. Whoever ends up caring about the portfolio won't go through it in great detail anyway so show that you know the common way of naming variables and functions, that you can use proper looping techniques, that you don't waste lots of processing time, that your code is readable, comments are effective, etc, etc.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Yes I have, but the majority of it is either stuff for my day job ( which is owned by them and can't go in a portfolio ) or stupid things that don't show off my skill as a developer. the only think i have added to some code samples are a tic tac toe class which can handle a game of tic tac toe up to 10 squares and a function that will solve a text string equation ( if you put in " ( 5 + 3 ) / 3 - 2 it will give you the right answer. accounts for parentheses, exponentials etc but i feel like those aren't "enought"
|
|
|
|
|
The first thing anyone will/should care about is your experience. You say you have "skill as a developer" so I assume you have been doing this for a fair while.
Why create a portfolio then?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
i only ask because for job interviews a lot of employers want to see a code sample, but without any constraint or basis of what type of code sample they want to see i have no clue what to send them. i sent one out and they said my code work looked like i was more suited for a "junior" position, that was a user class which managed users, it had functionality to check to see if a user was logged in, logged out a user, create a new user including generating a password hash, logging in a new user, checking to see if a user was verified etc. standard functions. i used oop principles since that was done for a job that assigned a project to me that specifically said it had to be object oriented, and had member private, with accessor classes for things that needed to be accessed from outside the class.
i've been doing professional web development for 8 years now, my current job we use cakephp framework or wordpress depending on the site. i'm just perplexes as to what would be something good. the feedback i have gotten from my code samples was that i didn't look like i was up to the level they needed, ok, well what type of code sample do you want, what are you looking for, etc? if you give me a task i can do it, but if you say "show me code" i have no clue what to give you. i can show you plenty of code...
|
|
|
|
|
OK, that makes sense.
1. It may be worth you posting some of the samples you have provided so that people here can provide feedback and perhaps more up to date approaches. I have seen developers that worked 10+ years yet their approach was still juvenile such as not using more modern features of the language.
2. I see your dilemma and perhaps the LAMP world is different than the Microsoft world, but if you have programmed for 8 years I wouldn't care about code samples, I'd want to hear you talk through challenges and projects you have worked on. As a hiring manager, I'd learn much more by listening to you than by looking at code samples.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thanks. I've done that too ( showing it to other coders to get input ) I wish more hiring managers would take your approach, as the random-code-sample is a bit hard
|
|
|
|
|
Hi,
I am starting with Slideshare and trying to do a basic search using the below code but all I am getting is a blank page. why?
<?
function search($query)
{
$url="http://www.slideshare.net/api/2/search_slideshows";
$api_key="xxxxxxx";
$secret_key = "xxxxxxx";
$hash = hash('sha1',$secret_key.$time);
$lang="en";
$req = $url ."?api_key=".$api_key
."&hash=".$hash
."&q=".$query;
echo $req;
$xml = simplexml_load_file($req)
or die();
var_dump ($xml);
}
$query = "PHP";
echo search($query);
?>
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi,
I'm currently working on a small application that would allow users on our forum to upload/send some data to our database. To avoid that our users need to create a second account I wanted to use their existing account (from our current board) details to log in.
After searching the web I found a project from a couple of years back called ForumConnect (Open Source on Bitbucket) After contacting the owner of the project he informed me support for it discontinued a while back.
After doing some testing with all versions released (1,2 and 3) I'm stranding on different phases in every try.
v1 gets me a connection, but after checking the password hashes it returns a false result while they actually do match...
v2 doesn't get the connection when trying to ping the server
v3 has a completely different structure on the php file(s) used and got me puzzled
I'm currently in my second year of programming (evening classes) and the c# side looks to be fine for me to handle.
But since I lack advanced php knowledge I was wondering if there would be someone willing to take up the last version and refresh it with me?
Let me know if you're interested in figuring this out and we can get in touch.
Thanks in advance for taking a look at my post
Cheers,
Z
|
|
|
|
|
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
|
|
|
|
|
Magento and other shopping carts are there to make developing ecommerce applications easier and reduce development time. I have recently developed an ecommerce website from scratch and I can tell you its not easy. Not because the programming is hard but there is a lot of consideration and planning involved not to mention hours of testing.
|
|
|
|
|
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.
|
|
|
|