pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
[SOLVED] Display default text when variable not set
pocobueno1388 replied to kiowa_jackson's topic in PHP Coding Help
<h1>Welcome To My Page About <?php if(!empty($_GET['ins'])) echo urldecode($_GET['ins']); else echo "Something"; ?> -
[SOLVED] PHP Heredoc Inside A Function - Not Working
pocobueno1388 replied to jadedknight's topic in PHP Coding Help
The code works fine for me. Make sure there are no trailering spaces after the FORM; line. -
You never define the $row variable. change your code to this <?php $resultghg="SELECT * FROM `users` WHERE ID = '$quser'"; $articlesghg = mysql_query($resultghg) or die(mysql_error()); $numbghg = mysql_num_rows($articlesghg); $row = mysql_fetch_assoc($articlesghg); //added this line ?>
-
I think thats the only one he has come out with =/
-
http://www.killerphp.com/articles/introduction-to-mysql-video-tutorial/
-
Change require "connect.php"' To require "connect.php";
-
Why do you need a while loop? Explain a little more what you have to do to make it work.
-
Try <?php include 'header.php'; include 'cont.php'; $sql = mysql_query("SELECT * FROM scores"); while ($row = mysql_fetch_assoc($sql)) { $hscore = $row['homescore']; $ascore = $row['awayscore']; $home = $row['home']; $away = $row['away']; $timestamp = $row['timestamp']; $round = $row['roundname']; if ($hscore >= $ascore) { $winner = $home; } if ($ascore >= $hscore) { $winner = $away; } echo $winner.'<br>'; } ?>
-
There are good PHP/MySQL tutorials at these sites: www.tizag.com www.w3schools.com All you need to do is select the information from the database, here is an example snippet. <?php $query = mysql_query("SELECT title, start_date, end_date FROM table WHERE {condition}")or die(mysql_error()); $row = mysql_fetch_assoc($query); echo "<b>Title of Event</b>: {$row['title']}<br>"; echo "<b>Registration Start Date</b>: {$row['start_date']}<br>"; echo "<b>Registration End Date</b>: {$row['end_date']}<br>"; ?>
-
<?php $password_arr = array('password1','password2'); if (isset($_POST["password"]) && (in_array($password, $password_arr))){ //They supplied a good password } else { //wrong password } ?>
-
Can you show us the rest of the script? Chances are we are going to have to edit the part of the script that checks if they entered a correct password so it can work with the password array.
-
Use sessions, that way you can maintain the information through to the last page. It would be a lot easier than trying to pass every value from every page through hidden inputs. Give an example of your form (code)...it's hard to tell what your trying to do by your vague description.
-
Search Google, there are plenty of results: http://www.phpeasystep.com/workshopview.php?id=2 http://www.plus2net.com/php_tutorial/php_multi_file_upload.php http://www.codewalkers.com/c/a/File-Manipulation-Code/Multiple-File-Upload/ I Googled "PHP multiple upload script".
-
It might be that the date in your table isn't in proper format. Your date: 2008-1-15 Should be: 2008-01-15 That may not be it, but MySQL is pretty picky when it comes to dates.
-
Here are two good tutorial sites www.tizag.com www.w3schools.com
-
[SOLVED] Building a search function for my db
pocobueno1388 replied to Grant Holmes's topic in PHP Coding Help
Your trying to echo inside an echo. Change this echo "<a href='requests_edit.php?id=<? echo \"$id\"; ?>'>edit</a></TD>"; To echo "<a href='requests_edit.php?id=$id'>edit</a></TD>"; -
[SOLVED] Building a search function for my db
pocobueno1388 replied to Grant Holmes's topic in PHP Coding Help
How do you want it to print out? -
[SOLVED] Building a search function for my db
pocobueno1388 replied to Grant Holmes's topic in PHP Coding Help
Change it to $sql = "SELECT * FROM birthdays WHERE Contact_Info_FirstName LIKE '%$string%' or Contact_Info_LastName LIKE '%$string%' or Contact_Info_State LIKE '%$string%' ORDER BY id DESC"; -
You can't change the content of anyone else's page. Unless you mean you want to actually grab the source code from another website and change the content on your own site. Your description for what you want is pretty vague, so this may be something that can be easily done and already written, or it could be something pretty unique where you would have to write the code yourself/hire someone to do it.
-
Love it. I don't see anything I would change, great job.
-
Do you have an auto-incremented field in your users table? If you do I'm assuming it is their user ID. Just register that ID as the session and it's unique. If you don't want to do that, maybe you can use the function uniqid()
-
You set a session like this $_SESSION['session_name'] = value; you also need to remember to call session_start() at the top of each page you want the session to carry on to. Sessions tutorial
-
The error being?
-
You need to use mod_rewrite. Here is an article/tutorial on it that will help http://keithdevens.com/weblog/archive/2004/May/24/clean-urls.mod_rewrite.php
-
You can do it through the URL using GET. So your URL to the page should look something like this www.yourdomain.com/page.php?name=steve Then on that page, you could retrieve the information and do your query like so <?php $name = mysql_real_escape_string($_GET['name']); $query = "SELECT* FROM table WHERE name='$name'"; ?>