So I tried to build an RSS feed with PHP, and I have no clue why, but it's not working. Can anyone help to point out what's wrong with the script? See the PHP code here and the would be rss output file here.
I'm having a weird problem with PDO on Fedora Core 5. I'm trying to connect to a sqlite database using PDO and it's just bombing out. I have a sqlite2 database, but apparently FC5 only supports sqlite3 databases (via PDO). So the following code just stops working. No error, no output, just fails silently.
$dbh = new PDO("sqlite:$db_path");
Now granted it SHOULDN'T work because it's a sqlite2 database and the sqlite: command is for sqlite3 databases, shouldn't it give me an error about that? Alternately is there a way to tell what version a sqlite database is that's on the disk? Like if it's a sqlite2 database use this command instead:
$dbh = new PDO("sqlite2:$db_path");
That way my code can be intelligent enough to know what type of DB it is?
Hello, I have written an application that sends an email verification request to a person signing up for a mailing list. When testing the applicatation I have the following problem:
The email comes to my personal account very quickly probably because my mail and the server are in the same domain. The problem comes with Yahoo and Hotmail. The people helping me test this say they are not getting the notification at all. I have tested it on one of my webmail type accounts and I got it. The first time took 30 seconds, the second time I got nothing.
Any suggestions would be helpful. I do not have access to PEAR.
Hi guys, I was just fooling around with AJAX for the first time and it's working fine so far, but of course some problems are around.
My question is, is there some possibility to insert PHP code in Javascript? I have my JavaScript file, and now I need to tell it somehow which ID to select from the database. function showFan(str) { var url="getFans.php?id=" + Math.random() + "&q=" + str xmlHttp=GetXmlHttpObject(stateChanged) xmlHttp.open("GET", url , true) xmlHttp.send(null) }
The second line is the one that bothers me. There should be the SQL table variable after the id=, like this; getFans.php?id=$country. The +Math.random() stuff is from the tutorial, no idea what it does, and the rest of the line is also from the tutorial, they used ASP there but I have no clue about asp. So can anyone help me out with and and tell me what PHP code I need to have in my getFans.php in order to make this work? My getFans.php is just a file with the usual database connections and printing stuff, nothing else.
What is everyone's favorite/most used PHP resources online? Of course, php.net comes first to mind, but what are there any more sites that have some cool tricks or tutorials? (Not just the general tutorial sites, but more thought-out and specific--http://www.ilovejackdaniels.com comes to mind.)
Does anyone know anything about geeklog? I'm hoping someone can tell me how to modify a website that is written entirely in PHP, and has geeklog installed. I've been struggling to make sense of this application but i'm clueless. I know HTML, and some PHP, but not enough to puzzle out geeklog.
I read everything on it that I could get my hands on, but there are some gaps in my knowledge. Now I need some practical advice and guidance. I log into the main console and am unable to change anything on the site. The php code looks unfamiliar to me. Is it absolutely necessary to master php in order to make the changes I want? Or is there a WYSIWYG program like Frontpage out there that encodes php?
I want to ask you guys out there for some suggegtions/advice on hosting companies. I have very specific needs:
I need a host that: 1) Is reliable and has good, quick customer service 2) Supports PhP on a windows server - I need to run ASP and PhP 3) Provides at least one SQL Server not mySQL) Database if not more 4) Lets me run my own mail server (not sure if this is done through hosting or domain registration) 5) Preferably lets me add sub-domains for little to no extra cash
Right now I have Enterhost and they are awful (don't support PHP, charge out the ass, their logs don't work, you can't have sub-domains or dedicated IP's and every time I ask them for something they say no). I'm looking at maybe HostExcellence? I need something with practically no downtime, as it is for a money-making site.
On the same subject, is it possible to move files over to the new host and access it through only the IP address before switching my domain name servers? I want to get everything moved and tested on the new server and make sure all the DB calls work before it goes live. Not sure if I could do that without hostin a second, 'testing only' domain temporarily, as I've never done a large-scale transfer like this.
Any advice (besides 'Just switch to a Linux server') is helpful.
Does anyone use SolarisX86 on a regular pc that is a non server?
I am a former BSD user and I do not like Linux in its current state. Dont mean to flame the linux fanatics out there but its alot of work compared to my FreeBSD experience to install and maintain a system with ease with a degree in stability in its packages.
I need Java and 3d support so NetBSd and OpenBSD is not an option. FreeBSD is too unstable and no longer works wiht my hardware well like 4.x did.
I need Java5 for school and the only non Microsoft OS I can think of is solaris. I intend to use www.blastwave.com or is it www.blastwave.net? ... to update solaris10 with modern packages. I am aware there is opensolaris but it seems like alot of work from the beta builds of solaris11 with tons of patches so I am skeptical.
I would like to use something more modern than gnome 2.8 as that is what blastwave includes. Any suggestions on how to upgrade?
Also for those who have used solaris on the desktop is it really worth it? What are the differences over Linux?
One would think this is a simple routine. In fact, I used the idential type of routine (while(list() = each()) to assign the very same associative array I'm calling in this method. For the life of me, I cannot figure out why I'm not even getting in the while loop... This is simple, so why am I getting this output? (see below code)....
//get_sql_insert_string() generates an insert string for the fields ONLY.. tables and criteria still need to be assigned
function get_sql_insert_string() {
$field_str = "";
$value_str = "";
echo "testing associateive array with value... " . $this->fields['hex_id'];
while (list($key, $value) = each($this->fields)) {
echo "why am I not getting in this loop????";
if (!in_array($key, $this->get_sql_exclude_fields())) {
$field_str .= "'" . $key . ", ";
$value_str .= "'" . $value . ", ";
}
}
return " (" . substr_replace($field_str, '', -2) . ") VALUES (" . substr_replace($value_str, '', -2) . ") ";
}
Here's the output I received....
testing associateive array with value... 10CE44 () VALUES ()
It's completely ignoring the loop!!!! Any ideas anyone? I dunno.. maybe I should just step away from the computer for an hour or two. It's probably something simple I'm not seeing.
I am a PHP novice. I'm the first to admit that. I've been working on this script for 2 days. I finally got it to display the table that I need. (yes, all that work to display my table - long story) but now I need to create a clickable link to take the user to a field specific page. Let me show what I mean
In the row with 'cust_PO' output, I need to create a link that works like this - http://www.mydomain.com/purchase.php (or HTML) that goes specifically to the page for that purchase order number ie. 5555. Help? Please? pretty please?
I'm pretty new to PHP, meaning I stick to scripts that other people write :P
Anyway, I'm using a PHP script for a contact form on my website. However, I sometimes get emails from various non-existing email addresses on my domain, so I'm thinking that spammers are using my contact form to send out spam :(
Does anyone know of a contact form script that prevents spammers from doing that? Preferably a script that allows me to choose which fields are required and which aren't and also makes sure that whatever is entered in the email field actually contains the @ sign.
Hope I explained it well enough and that someone out there is able to help. Because I would hate to think that my domain is being used to email spam :[
Hi All.. I'm working on a script that will allow admins on my website to update events. Basically what will happen (if I can get this to work) is the user will use some checkboxes on page1 that will submit the id#'s to page2. I'm streaming the id#'s into page2 as an array, where the information will be edited, and then submitted as an UPDATE statement to the database in page3 (I've confirmed the values are transmitting)
The problem is on page 2, where the data should get called, I'm getting an error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource For simplicities sake, I've I've put the relevant code up at http://pastebin.com/622150 (Livejounal tends to eat code)
If someone could take a look and tell me what I'm doing wrong or point me in the wrong direction then I'd be very appreciative.
I'm having a problem on a couple of sites I'm working on. On each site there's a form of some sort that needs to be filled in an emailed to the site owner. I'm using the PHP mail() function like I always do and I test it by sending it to myself. Works fine. However, when I change the email addrress to the site owner, they don't get the emails. Could it have something to do with the email being sent from theirsite.com to theiremail@theirsite.com? and if so, how could I get around this if they don't have another email address to use? The site's that I'm having trouble with are hosted with three different companies so it's hard to pinpoint.
wondering if anyone could help me, i'm trying to help a friend quickly on a project, and i'm terrible at recursive functions
i have a table of 'genres' for music club 'venues' - each genre can have a 'parentID' if it is a sub-genre of another genre
really roughly he has something like this -
genre ----- [genreID] name parentID
venue ----- [venueID] name
venure_genre ------------ [venueID genreID]
I'm trying to help him build a form to submit venues into a database and assign them 1 or more genres -
i'd like to have the genre selection be a multiple select box, with subgenres spaced over with 's i.e.
I don't really need any help with the output as much as the query - I could do this the long way, and query all the top level genres, store them, then query each top level's sub genre's, etc etc, but i was wondering if anyone with experience writing recursive SQL querys/PHP functions could lend a hand
OK, I have been on a project where it I have been doing mostly front-end php while sending and recieving data in arrays with an API...
Now the API people are saying "We will pass the templates as serialized PHP objects..."
I am really scratching my head here. It sounds like he wants to send the entire php file that makes a web page as a serialized object... Before all I had to do was format an array. I am trying to arrange a confrence call to s I can understand this. (I am an not a PHP expert and I think they are talking above my head.)
In the meantime, what can you tell me about the function serialize()? The example in the manual seems very incomplete and I need to pick this up quick.
Need some help with this - I made an external table for the categories in my blog, and now I want to join the blog and the blog_cat table, so it selects the name from the cat table where the category equals the catID. *Something* works already, but it just keeps selecting only one category one, instead of the equal one it should be selecting. I'm pretty much a noob =_=
$sql = "SELECT * FROM $tableblog ORDER BY timestamp DESC LIMIT 5"; $result = mysql_query($sql) or print ("Unable to select data. " . $sql . " " . mysql_error()); while ($row = mysql_fetch_array($result)) { $date = date("l, F dS, Y - h:ia",$row["timestamp"]); $category = $row["category"]; $entry = $row["entry"]; $id = $row["id"]; // ....
$result3 = mysql_query("SELECT category, catID, catname FROM $tableblog, $tableblogcat WHERE category=catID") or print ("Unable to select data. " . $sql . " " . mysql_error()); while ($row = mysql_fetch_array($result3)) { $catID = $row["catID"]; $catname = $row["catname"]; }
Ok - I'm going to try my best to not sound like I have no idea what I'm talking about -
I'm trying to move more towards pure OOP practices in my PHP projects, and I've been sifting through a couple of packaged MVC frameworks and some OnLAMP tutorials on writing you're own... very cool stuff, too bad i'm only like 3 years behind...
anyway - I use DB_DataObject primarily for my database interactions (if you don't know DB_DataObject is an object relational database tool with an automatic class generating script) - I _would_ like to be able to do some things easier/better with DB_DataObject (PK+FK JOINs in particular could be a bit more elegant) but overall it's a useful tool that cuts out a lot of SQL coding...
So - my actual question - in the article I'm digging thru (http://www.onlamp.com/pub/a/php/2005/09/15/mvc_intro.html) the author is extending his base framework class with a framework DB class that provides the database connection (it's basically a tiny class that sets $this->db) - I'm wondering what is the best way to incorporate DB_DataObject into a solid OOP class schema
- should I use the DataObject generated class as my base class that I extend - then what if I'm writing a class that doesn't need DB connectivity? The other thing I was thinking was to attach it to my other classes like $this->DO = new DataObject_Class but I really like having my class properties line up with my database fields (user.email = $user->email _not_ $user->DO->email); Is there something I'd be better off using the DB_DataObject (I can't bear the thought of -gasp- writing SQL anymore)
I'm somewhat new to this OOP game so any help is appreciated
I have a PHP question, that I bet is pretty simple, but I only play around with the language to do a few website things.
Recently, the webserver I am hosted on has upgraded to PHP5 and broken one of the main drivers of my website. I'm hoping you may be able to help.
Explanation of problem: My website has an "index" table with links. When you click a link, PHP will go out, grab an HTML document, and insert that into a main table also on my index page. This is no longer working since the upgrade.
My website is at www.erikwilson.net if you are curious. The links I am referring to are in the "Site Stuff" table.
This all worked perfectly before the upgrade to PHP5.
See anything that would cause this to fail in PHP5 or how I can fix it?
Example Hyperlink that is calling the PHP:< a class="nav" href="index.php?page=geocache" onmouseover = "over_image('img29');" onmouseout = "off_image('img29')"> Geocaching</a>
Actual PHP driving the page: <?php if ($page == '') { $page = "livejournal"; $l = "?"; } else { $page = "$page"; } ?>
Table the HTML will be intserted into: < table border="0" cellpadding="8" cellspacing="1" width="100%"> < tr> < td bgcolor="ffffff"> < ?php include("$page.shtml");?> < /td> < /tr> < /table>