Hello,
What's the correct way to implement the below concept via MySQL and PHP? Say a website has two groups/communities, both of which allow its users to ask Questions, answer Questions, and start Discussions, pertaining to the respective community. A user will choose which community he/she wishes to enter via below code(main.php):
<h...
It's a pretty simple question, I always have to go check here and then I hit my head and say it's so obvious. But really after a week of not using it I usually end up writing
for ($i = 1; $i++; $i <= 10;) {
echo $i;
}
some Mnemonic might help
...
Hi,
checkdnsrr only works for dot com domains?
If I use live.com (or any existing dotcom), the checkdnsrr returns a value of 1 (TRUE), but it always return a empty string for an existing dot net/org. It does not matter if the check is for A or MX or NS... records. Is the syntax correct or something else?
<?php
$dom ="live.net";
$ch...
Hi!
I want to connect to public facebook page or group and list all entries from the wall on a personal website. I will use PHP on my server so that would be the best solution for me. Or javascript.
Could anyone explain or perhaps give a working code on how to do this? Or just all steps nessesary for making this?
If its possible to han...
I want to do a print on a argument that is on the URL, like this(in this case it's Google):
http://bitoffapp.org/?http://google.com/
I want to get that and print it like this:
print("Go <a href='$url'>back</a> to the page you was before the login);
How can I do this?
...
After loading a model I the only way to get to the data seems to be very ugly.
$this->User->read(NULL, 49);
print $this->User->data['User']['email'];
Most frameworks have a much nicer way of accessing like
$User = new Model_User(49);
print $User->email;
Is there anyway to do this in CakePHP 1.2/3?
...
Hello,
I have to XML trees and would like to add one tree as a leaf to the other one.
Apparently:
$tree2->addChild('leaf', tree1);
doesn't work, as it copies only the first root node.
Ok, so then I tought I would traverse the whole first tree, adding every element one by one to the second one.
But consider XML like this:
<root>
...
Is there a way to set a $_POST['var'] without using form related field (no type='hidden') and using only PHP.
Something like
$_POST['name'] = "Denniss";
Is there a way to do this?
EDIT:
Someone asked me for some elaboration on this. So for example, I have page with a form on it, The form looks something like this
<form method='post'...
Hi there.
I've moved database from one host to another. I've used PMA to export and bigdump to import. The whole database have latin2 charset set everywhere where it's possible. However in database, special chars (polish ąęłó, etc.) are broken. When I used SELECT i see "bushes" - "Ä�" insetad of "ą". Then I've set document encoding to ...
This is a strange problem but it happens enough that I wanted to ask.
For some reason, sometimes the browser will force a php page to download to the browser and it always comes up with 0 bytes.
Mind you, I'm not trying to force the download and I'm very familiar with headers and forcing files to download intentionally, what I'm talkin...
So I know the exact path the node I would be attempting to remove. I am iterating through several xml files to update some of the content. In order to add some of the new content in, I must first delete the content that already exists.
Here is the code I attempted to use, but I'm receiving a Parse error: syntax error, unexpected T_UNS...
I'll start out by saying that I've never used SOAP before.
Anyway, Here's the code I'm trying to create.
<soapenv:Body>
<Circuits xmlns="http://www.qpricer.com/Services/Pricing">
<Circuit bandwidth="DS-3" port-billing-type="Flat" product="Dedicated Voice" term="1-Year">
<ns1:Loop npanxx="212255" xmlns:ns1="http://www.qpricer.com/...
How can wirte php script in flex application ? . at the same time this script can be asp.net,javascript ...
...
Hi all,
I'm trying to link posts in wordpress. Let me elaborate. In wordpress, you can set how many posts you want to show on a page. If, for example, you set that number to 1, and you have 10 posts, then you'll have 10 pages.
I have the following code that WORKS on the index.php (main posts page). It shows a link to older posts. Below...
Hi,
I use CodeIgniter as my web application framework. I used a simple Try/Catch and I sent a sample value to test it, and it failed!
I know I can use $this->db->escape() function to solve my data problem but I just want to know: Why TRY/CATCH can not catch this error!
Controler code:
$this->load->model('user_model');
$result...
I'm trying to split the following text:
<word>test</word><word>test2</word>
etc via the following reg ex:
preg_split(":</?word>:is", $html);
I get the result: test and test2 as the result, but what I need is to retrain the <word> and </word> tags, so instead of just test and test2, i get another 4 elements with the matching tags in ...
I am new to testing and trying to set it up in a Zend Framework application. The app is only available to logged in users. The login page uses a different layout than the rest of the app
LoginController.php contains:
public function init()
{
$this->_helper->layout()->setLayout('loginlayout');
parent::init();
}
However, sett...
So, I have this code that searches for a particular node in my XML file, unsets an existing node and inserts a brand new child node with the correct data. Is there a way of getting this new data to save within the actual XML file with simpleXML? If not, is there another efficient method for doing this?
public function hint_insert() {
...
Is there a way to view the variables set in each stack frame in a backtrace? I can come pretty close with a combination of debug_backtrace(true) to get the objects, get_object_vars on each object to get $this vars, the args key in each backtrace frame, and get_defined_vars to get globals, but any temporary variables set within a function...
So this is my code:
function function() {
$isbn = $_REQUEST["isbn"];
$price = $_REQUEST["price"];
$cond = $_REQUEST["cond"];
$con = mysql_connect("localhost","my_usernam", "password");
if (!$con) die('Could not connect:' . mysql_error());
mysql_select_db("my_database",$con);
$sql="INSERT INTO 'Books' (isbn, price, condition)
VALUES ('...