lastkarrde
Members-
Posts
165 -
Joined
-
Last visited
Never
Everything posted by lastkarrde
-
What is your query?
-
I've never heard of __set_state() before..
-
Is this in some proxy software? Or are you trying to block web requests (from curl etc.) from being issued?
-
Well, usually you can only access object properties if they are defined: <?php class Person { public $name; public $age; public $title = 'Sir'; } $p = new Person(); echo $p->title; //Sir $p->name = 'Atticus'; echo $p->name; //Atticus $p->age = 48; echo $p->age; //48 ?> The magic method __set() (usually combined with __get() ) allows you to define and access object properties dynamically. <?php class Person { public $data = array(); public function __set($name, $value) { $this->data[$name] = $value; } public function __get($name) { if(isset($this->data[$name])) { return $this->data[$name]; } else { echo 'NOT SET'; } } } $z = new Person(); echo $z->title; //NOT SET $z->name = 'Atticus'; echo $z->name; //Atticus $z->age = 48; echo $z->age; //48 ?>
-
Code is on a local dev setup, it would take too much work to make it public facing. I ended up ditching the AJAX and including the page with an iframe in the dialog. Not the best solution.. but it works.
-
Ah crap. It doesn't work. It just closes the Dialog, no data gets submitted...
-
Thanks. I added dojoType="dijit.form.Button" to my submit button and It seems to fix it. I find it crazy that Dojo hijacks the event by default though :S .
-
Try that
-
mysql_query("INSERT INTO user (username, password,email) VALUES ('$user', '$pass', '$email')");
-
I've had experience with PHP, Tor and cURL all talking to each other . What "Doesnt seem to work" about your code? Error messages? Does auth fail?
-
= , assignment == , same value ===, same value and type
-
Howdy folks. I'm having some troubles with forms not submitting when they are included by an AJAX call. I have a page, <em>/add_many/</em> which just displays an HTML form. If I navigate to that page the form works as expected. However If i try and display that page in a dijit.Dialog modal (loaded via AJAX), the form will not submit. Below is my AJAX code addDialog = new dijit.Dialog({title: 'Add Reddit User', style: 'width:500px', preventCache:true}); addDialog.attr('href', '/add_many/'); addDialog.show(); The form displays fine in the dijit.Dialog box, and I can enter information into it. However clicking the submit button does absolutely nothing. Any ideas? Thanks
-
if (strlen($review) < 30){ echo '<p class="red">Review is too short, please enter at least 15 words</p>'; }
-
Use cron to execute a pruning script.
-
Automated Printing from PHP/MySQL web form information
lastkarrde replied to using PHP's topic in Applications
Of course. That is how you execute processes using PHP. -
I've only worked with Paypal's API so I can only comment on that. They send a POST request to a script location that you specify (generally known as a postback). The POST request contains all of the information about the transaction (was it successful, etc). This will give you an idea on how to interpret the postback.
-
$_SESSION['car'] = $car_object; $my_old_car_object = $_SESSION['car']; $my_old_car_object->offer; //Sale
-
Perhaps not the neatest way, but you could save the state using sessions. if(isset($_SESSION['order']) && $_SESSION['order'] == 'DESC') { $_SESSION['order'] == 'ASC'; } $_SESSION['order'] = 'DESC';
-
HttpRequest is a PECL PHP extension: http://www.php.net/manual/en/class.httprequest.php . It provides a nice, object orientated API to issue HTTP requests with. However you can accomplish the same things using sockets or cURL.
-
Parsing XML is slow compared to a database SELECT. Set up your DB tables so that it represents the XML schema. Pull the XML file in, parse it, and save the relevant information in it to the database. That way every time you want to reference that data, your not parsing an XML file (which takes time). If your wanting to delete the old data, when you pull another/updated feed in, just do a DELETE where the timestamp is less than the current timestamp.
-
I would parse the XML, then save the parsed data in a database. Make sure to include timestamps so you can regularly prune/empty/delete the database of old tweets.
-
PHP Login system driving me bonkers...
lastkarrde replied to FalseProphet's topic in PHP Coding Help
We need more information. Any errors? What works that should? What works that shouldn't? -
After logging how do i start a profile page?
lastkarrde replied to frank_solo's topic in PHP Coding Help
A profile page is just made up of some database queries and forms (if you want to save other user data like location, date of birth etc). I suggest you spend time learning PHP and the basics of MySQL. Understand what your login and registration code is actually doing. Once you understand that, implementing user profiles will be trivial. -
$_SERVER['REMOTE_ADDR'] returns the IP address of machine that requested the page (eg, the users IP address). You probably want that.