-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
um, what you are describing is simply a Regular Expression match. You could use Curl, or you could simply use file_get_contents() to get the data from the page.
-
Here is a basic example echo "<table>"; while ($row33 = mysql_fetch_row($result33)) { echo "<tr><td>"; print implode(" ", $row33 ); echo "</td></tr>"; } echo "</table>"; I don't know what $row33 is though (IE what values it has, how its formatted), or how you want your table formatted, but you should get the idea. If you wanted each "imploded" entry in $row33 to be a column, something like { echo "<tr><td>"; print implode("</td><td>", $row33 ); echo "</td></tr>"; } as the while loop should do the trick
-
For free? No... If you want to pay someone I suggest you check out the freelancing forums
-
if its a plain text email, you can just use the newline character (\n) to put each entry on its own line $comma_separated = implode("\n", $row33 ); if you want an actual HTML table, it will be a little more complicated, and probably require something more complicated than a simple impode() call
-
No problem! you can mark your topic as solved by pressing the "Mark Solved" button at the bottom of the thread, and don't be afraid to come back if you hit a snag
-
yes.. assuming that you go about it correctly
-
You can achieve that by following the steps you laid out.... add a record into the database with whatever information, and retrieve the data from the database. may i suggest a MySQL tutorial? http://www.tizag.com/mysqlTutorial/
-
Oh ok, well that would depend on how the system is set up, but you can just make a page that lets people edit certain stuff, and use information from that page to post to the actual editing page. However, without seeing how the system is set up, this is more or less a shot in the dark
-
Well, the destination (directory) variable is based on what was uploaded, so if nothign was uploaded I assume that the directory wouldn't be made. You can check if the directory exists with file_exists() if (file_exists($my_dir_to_check)){ //do directory showing stuff }
-
Your question is kind of unclear, but it sounds like you want to build a permissions system. If this is right, than there are plenty of tutorials on the internet. a quick google search turned up this: http://www.tutorials-expert.com/tutorial/4767/Permission-System.html page, which seems like a pretty good tutorial. If this is not what you are asking for, can you explain a little better
-
So what type of Music do my fellow PHPFreaks enjoy listening to? I personally like Classic Rock (go Pink Floyd!) and some modern Rock (mostly alt/prog rock) Some hip-hop is Ok also. currently my favorite band is Muse, what about you guys?
-
Using Checkbox to get multiple results.
mikesta707 replied to overlordofevil's topic in PHP Coding Help
There is a much easier way to do this. instead of dynamically creating slightly different names (IE cid_1, cid_3) just make the checkboxes an HTML array <input type='checkbox' name='cid[]' /> <input type='checkbox' name='cid[]' /> The [] part makes it an array. In the form processing code the $_POST['cid'] variable will be an array, so you can simply loop through it foreach($_POST['cid'] as $cid){ //do whatever -
well you include includes/start.php before you check the login and create the header, so this part if (!$_SESSION['uid']) header('Location: login.php');?> gets run before $_SESSION['uid'] is set. since $_SESSION['uid'] hasn't been set yet, that if statements becomes true
-
Why not just use the MYSQL built in COUNT() function if you are just getting a count clicky
-
if ($_SERVER['HTTP_HOST'] == "localhost"){ //localhost connect } else { //server connect } Something like that should be about right, though you may want to use stristr instead of a straight equality comparison
-
if $row->id is the id, than simply doing $id = $_POST['Select_Form_Name'];//replace select form name with whatever your select is called should get the id that the user selected... I don't really see how you could get the title, the title isn't passed into the post variables, the value attribute is
-
If/Else statement, different analytics code depending on URL
mikesta707 replied to vitug's topic in PHP Coding Help
//this gets the current URI That was used to access the page //for example, on www.example.com/page.php?id=stuff //the request uri would be /page.php $requested = $_SERVER["REQUEST_URI"]; //stristr returns if a string (the variable on the right side) is //inside another string (left side) if (stristr($requested, "query") !== false) { //if this is true, then the word "query" is inside the request URI }elseif (stristr($requested, "documents") !== false) { }else { } -
Just got it, along with a new mouse. Woot can't wait to play it!
-
http://wiki.developer.myspace.com/index.php?title=Main_Page They have a several API's, surely one of them would be able to do this
-
I think this $r = mysql_fetch_row($result); $numrows = $r[0]; should just be $numrows = mysql_num_rows($result); What you had before meant to get the first column of the first returned row from the result set. And i doubt that is the number of rows returned.
-
can you post the css for the "main" div tag
-
Oh, if you're looking to pay someone to do it you can post in the freelancing section
-
I was the same, I used to love ganking noobs in STV/ashenvale/hillsbrad but cross server battle grounds ruined the PVP imo I thought it was pretty good in the beginning, but now its just a grind fest
-
well, first off there are code/php tags for posting code. Secondly, that is a huge amount of code that I am not going to read through. As far as editing goes though the general logic that you use is as follows You generate your list of the servers (simple select statement with whatever WHERE clauses you want) Now lets say we got the following results server1 server2 server3 Now, assuming each entry in the database has a unique identifier (usually as an integer primary key that is set to auto increment) we can use this "id", along with a get variable to post to a page. To explain further... Lets pretend that our while loop to generate the list of servers looked something like $query = mysql_query("SELECT * FROM table ..."); while($row = mysql_fetch_assoc($query)){ echo $row['server_name']; } and lets pretend we had a page to edit a specific entry (more on this later). Well, we would need a way to send which entry we want to edit. Well, using the unique identifier (which I shall refer to as id) we can send the id as a get variable to the edit page. All we would need to do is alter our while loop above to something like this $query = mysql_query("SELECT * FROM table ..."); while($row = mysql_fetch_assoc($query)){ echo '<a href="edit.php?id='.$row['id'].'">'.$row['server_name'].'</a>'; } Now, what this will do is create a link. Assuming the first row returned has an id of 5, and the server name is "my_server", the link would look like <a href="edit.php?id=5">my_server</a> the ?id=5 part basically creates a GET variable named id, and sets its value to 5. Now, on edit.php, we could access that variable doing something like $id = $_GET['id']; Now the rest is really up to you. Something really common is to create a form (with textboxes and stuff) and populate them with the values from the table. Your query could look something like $query = "SELECT * FROM table WHERE id=$id"; That would select the specific row we want to edit. We could use a mysql_fetch_XXX function to grab data from that result set, and populate a form with that. For example, say we had 1 field we wanted to edit, and it was the name. We could make a form and populate it with the data like so $result = mysql_query($query); $row = mysql_fetch_assoc($result);//no need for a loop since we get only 1 row $name = $row['name']; //echo the form echo '<form action="whatever" method="post">';//you could also use get as the method echo '<input type="text" value="'.$name.'" name="newName">'; echo '<input type="hidden" name="id" value="'.$id.'">';//remember our $id variable from above echo '<input type="submit" name="submit" value="submit" >'; Now, the reason I created that hidden field is so that on the page that the form above submits to, we have access to the $id variable we used to get the old information from the table. Now we could use a simple update statement on the next page $newName = $_POST['newName']; $id = $_POST['id']; $update = "UPDATE table set server_name = '$newName' WHERE id=$id"; mysql_query($update); Hope that helps get you started