I found the main problem with the old code - my install was corrupt. I reinstalled WP (this time, I'm sure it's NOT corrupt.), and the new site that was created told me
Error establishing a database connection
so I re-wrote the code (new code at the bottom). Just like the script before, everything worked, until I tried to view the site (and just like before, it told me it couldn't connect to the DB). I took a look at the DB, and noticed that all of my other sites had their own tables (in the format of (my prefix)_(site's ID)_options, (my prefix)_(site's ID)_posts, etc.), but the site I made with this script didn't have it's own tables with it's ID. So, my problem now is that WP won't make tables for my new site.
<?php
/* I have omitted the values of $title, $newSitePath, and $email.
* If my WP installation was at example.com/mystuff and I wanted to make example.com/mystuff/something
* and I wanted to assign administration rights to xyz@example.com then I'd type in:
* $email = 'james@jamescostian.com';
* $newSitePath = 'something';
* I also need to add in a definition for $title. If I wanted to give this site the title "Randomness" then I'd type in:
* $title = 'Randomness';
* This was made for the sub-dir install.
* If you have the sub-domain install, then go to:
* wp-admin/network/site-new.php
* and use it to figure out how to make your own script.
*/
require_once( 'wp-config.php' );
require_once( 'wp-includes/ms-blogs.php' );
require_once( 'wp-includes/functions.php' );
require_once( 'wp-admin/includes/upgrade.php' );
require_once( 'wp-includes/ms-functions.php' );
$domain = strtolower( $domain );
$email = sanitize_email( $email );
$newdomain = $current_site->domain;
$path = $base.$newSitePath.'/';
$password = 'N/A';
$user_id = email_exists( $email );
$wpdb->hide_errors();
wpmu_create_blog( $newdomain, $path, $title, $user_id, array( 'public' => 1 ), $current_site->id );
$wpdb->show_errors();
if ( !is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) )
update_user_option( $user_id, 'primary_blog', $id, true );
?>