|
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.
|
|
|
|
|
Hi,
You have to move on to the next level, a framework. I can recommend you take a look at CodeIgniter framework or Smarty. Simple, fast and robust for small and medium complexity apps. For enterprise I would go with Zend framework.
|
|
|
|
|
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....????
|
|
|
|
|