I am using php codeigniter and i am trying to import my contacts from my gmail and yahoomail exactly like twitter... I dont know how to get started? Any suggestion?
I know how to write program in PHP and implementation of MVC model. but I really want to practice coding like the coding in real world??? I was wondering is there any specific example or book which can show me the tricks or logic and the way professional programmers consider about coding??? Do I need to learn frameworks like Zend ???
hi
I've tried a few php IDEs , but still searching for the FASTEST one
all Java based IDEs are too slow, I have 2 computers to work, my home pc which is too fast, and my laptop witch is good , but cant handle a heave software.
and I have to work on them both, so I'm looking for the best free ide which is fast
I'm not talking about text-editors , because I already have np++ and its great, but looking for extra features to help me save time..
any tips?
I am currently building a site and all the books I have read on PHP so far are just on functionality and not much on security. Is there a book that deals specifically with making your code/site secure? I don't want to go public and the next day have all my code changed or my database erased by SQL injection.
thanks
Ok, I'm looking for the fastest possible way to read all of the contents of a file via php with a filepath on the server, also these files can be huge. So it's very important that it does a READ ONLY to it as fast as possible.
Is reading it line by line faster than reading the entire contents? Though, I remember reading up on this some, that reading the entire contents can produce errors for huge files. Is this true?
Hello,
I am creating a simple MySQL query that will be built from the user selecting options from 2 dropdowns.
The issue I am having is that I would like each drop down to default that if they do not actually choose an option, do not filter by that dropdown parameter.
So, if they come in, and simply hit submit without choosing from a dropdown they should see everything. If they come in and pick from only one of the dropdowns, the query will basically ignore filtering by the other dropdown.
I tried making <OPTION VALUE='any'>Choose but my query didn't know what to do with the 'any' and just shows no results.
Here is my code. Thank you very much for whatever help you can provide.
FORM
<form method="POST" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<select name="GameType">
<OPTION VALUE='any'>Choose Game Type
<option value="Game1">Option 1</option>
<option value="Game2">Option 2</option>
<option value="Game3">Option 3</option>
</select>
<select name="Instructor">
<OPTION VALUE='any'>Choose Instructor
<option VALUE="InstructorA">Instructor A</option>
<option value="InstructorB">Instructor B</option>
<option value="InstructorC">Instructor C</option>
</select>
<input type='submit' value='Search Videos'>
</form>
MYSQL
<?PHP
connection stuff
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
$SQL = "SELECT * FROM Videos WHERE GameType=\"{$_POST['GameType']}\" AND Instructor=\"{$_POST['Instructor']}\"";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
echo $db_field['ShortDescription'] . ", ";
echo $db_field['LongDescription'] . ", ";
echo $db_field['GameType'] . ", ";
echo $db_field['NumberOfPlayers'] . ", ";
echo $db_field['Instructor'] . ", ";
echo $db_field['Stakes'] . ", ";
echo $db_field['UserPermissionLevel'] . ", ";
echo $db_field['DateCreated'] . "<BR>";
}
mysql_close($db_handle);
}
else {
print "Database NOT Found ";
mysql_close($db_handle);
}
?>
i need in an php file three drop down boxes or multiple select boxes.
the entries from these boxes are in a mysql database.
the single problem is that the entries in the thrid box depend on the second, and the entries in the second depend on the first.
can someone help? know any examples?
$arr = array('superman','gossipgirl',...);
$text = 'arbitary stuff here...';
What I want to do is find the first/last occurencing index of each word in $arr within $text,how to do it efficiently in PHP?
I have a PHP web application on an intranet that can extract the IP and host name of the current user on that page, but I was wondering if there is a way to get/extract their Active Directory/Windows username as well. Is this possible?
Hello Guys,
We have been using PHP/MySQL for our web application which has been growing a lot, the database is around 4-5GB and one of the table is 2GB sometimes, hence slowing down whenever any queries to that table is called.
Should we just try to optimize, or are we using MySQL above its limit? Will switching our web app to .NET/MSSQL resolve the issues?
Thanks
Hi,
I'm trying to use PHP to create a file containing a list of phone numbers.
It's working OK however if the phone number begins with zero, the digit is dropped from the excel file.
Does anyone know how to set the formatting correctly so that it remains in place?
Any advice appreciated.
Thanks.
Iam a little bit confused by php function declare.
What exactly is an single tick, i thought 1 tick = one line of code?
But if i use:
function myfunc() {
print "Tick";
}
register_tick_function("myfunc");
declare(ticks=1) {
echo 'foo!bar';
}
The script prints :
"Tick" 2 Times??
Hello,
We have a need to access a DB that only allows one connection at a time. This screams "singleton" to me. The catch of course is that the singleton connection will be exposed (either directly or indirectly) via a web-service (most probable a SOAP based web-service - located on a separate server from the calling app(s) ) - which means that there may be more than one app / instance attempting to connect to the singleton class.
In PHP, what is the best way to create a global singleton or a web-service singleton?
TIA
I am building a system, mostly for consolidating learning but will be used in practice.
I will try and verbally explain the part of the E-R diagram I am focusing on:
Each cadet can have many uniformID's
Each Uniform ID is a new entry in table uniform, so cadets (table) may look like:
id | name | ... | uniformID
1 | Example | ... | 1,2,3
uniform table:
id | notes | cadet
1 | Need new blahh | 1
2 | Some stuff needed | 1
3 | Whatever you like | 1
On second thought, looks like I wont need that third column in the db.
I am trying to iterate through each id in uniformID, code:
<?php
$cadet = $_GET['id']; // set from URL
$query = mysql_query("SELECT `uniformID` FROM `cadets`
WHERE id = '$cadet' LIMIT 1")
or die(mysql_error()); // get uniform needed as string
// store it
while ($row = mysql_fetch_array($query)) {
$uniformArray = $row['uniformID'];
}
echo $uniformArray . " ";
$exploded = explode(",", $uniformArray); // convert into an array
// for each key in the array perform a new query
foreach ($exploded as $key => $value) {
$query(count($exploded));
$query[$key] = mysql_query("SELECT * FROM `uniform` WHERE `id` = '$value'");
}
?
As I say, this is mainly for consolidation purposes but I have come up with a error, sql is saying:
Fatal error: Function name must be a string in C:\wamp\www\intranet\uniform.php on line 82
line 82 is:
$query[$key] = mysql_query("SELECT * FROM `uniform` WHERE `id` = '$value'");
I wasn't sure it would work so I tried it and now i'm stuck!
EDIT:
Thanks to everyone who has contributed to this! This is now the working code:
foreach ($exploded as $key => $value) {
//$query(count($exploded));
$query = mysql_query("SELECT * FROM `uniform` WHERE `id` = '$value'");
while ($row = mysql_fetch_array($query)) {
echo "<tr>
<td>" . $row['id'] . "</td>
<td>" . $row['note'] . "</td>
</tr>";
}
}
Added the while and did the iteration by nesting it in the foreach
I am new to coding and would just like to know a bit more about frameworks. How does a framework help you code and what exactly is it? Such as Zend for php.
Money, Staff, Skill and preference to open source or commercial is neutral. Lets take the best of the best programmers (for arguments sake) and think about this:
What will perform better overall:
PHP & MySQL
or
ASP.Net & Microsoft SQL
(I don't want biased answers, just
looking for Performance, and Speed).
I want to run this function but show the result in a table row
strlen($cat_row['sms']
This is what i came up with but it is not working:
echo "<tr><td bgcolor=#626E7A>".**strlen($cat_row['cars']**."</td></tr>";
How do you show result of a php function in a table row? i am trying to format the output some how.
please help
I have to build an application using Maven for PHP that has multiple modules.
The scenario in which the maven seems to not work is this: I have a common module and a client module depending on the first one.
When doing "mvn site" on the client module which depends on the common module, the test fails to see the paths to the common module. Is there a flow in my build or this is just not possible?
Hey,
I'm working on some old(ish) software in PHP that maintains a $cache array to reduce the number of SQL queries. I was thinking of just putting memcached in its place and I'm wondering whether or not to get rid of the internal caching. Would there still be a worthwihle performance increase if I keep the internal caching, or would memcached suffice?
Hi All,
Using Reflection in PHP I can dynamically create a object like so
$target = 'core_domain_Person';
$reflect = new ReflectionClass($target);
$obj = $reflect->newInstance();
I would like to replicate this same concept in JavaScript is there a way to do this out of the box? Or is there a way to replicate what Reflection is doing?
Hello Friends!
I want to develop a shopping cart in php. I also want to integreate online payment facility using paypal.
Which allows payment thrugh credit card and decbit card.
So Please tell me how to integreate paypal in my own shopping cart to achive secure transaction?
Thank You!