GingerRobot
Staff Alumni-
Posts
4,082 -
Joined
-
Last visited
Everything posted by GingerRobot
-
I am thinking of installing linux on a 2nd hard drive on my computer because i want try using it but i also want to install php on a linux system. Do any particular distributions of linux have any advantages/disadvantages for installed php etc on them? I understand some of them come with it pre installed?
-
From what i can workout, the title is misleading - thats why im asking for his form and php code so far.
-
Yes that is all possible: the first part: [code] <?php $bid_increment = $_POST['bid_increment']; $item_type = $_POST['item_type']; if($item_type == "auction" or $item_type=="dutch auction") { if(!(is_numeric($bid_increment) && is_int($bid_increment + 0)) OR empty($bid_increment)){ echo "Invalid bid increment"; exit; } else{ echo "Valid bid increment"; } }elseif($item_type == "fixed price" OR $item_type=="classified"){ if(!empty($bid_increment)){ echo "you can have no bid increment with this item type!"; } } ?> [/code] This assumes that you have given the options within the dropdown box the same value as i have e.g.: <option value="auction">Auction</option> <option value="dutch auction">Dutch Auction</option> etc
-
Won't validate from within itself - RESOLVED
GingerRobot replied to kenwvs's topic in PHP Coding Help
well yes, its looking for validation.php and cant find it. If you change the action to uploadformcomplete.php or the file name to validation.php it should work. -
Won't validate from within itself - RESOLVED
GingerRobot replied to kenwvs's topic in PHP Coding Help
so the form itself is called validation.php? -
Show us what you have so far
-
The only way i could think of doing this would be to check every item in the POST array: [code] <?php foreach($_POST as $check){ if (empty($check) && $check !="submit")//the name of your submit button { $num++; } } if($num != 0) { echo "all fields are empty"; }else{ echo "not all fields are empty"; } ?> [/code]
-
Can we see your form? That would help.
-
Well im guessing you have installed some sort of forum php scripts, perhaps in the setup somewhere for that you can specify that non-members can vote?
-
Im not sure, try adding it in and see what happens: $query = mysql_query("INSERT INTO `news` (id,title, by, on, message) VALUES('','$title','$by','$time','$message')");
-
Perhaps i am missing the point here with your simplified version, but couldn't you just put the php information that you want that is currently in $variable and put it in a file and include the file?
-
Im unsure if you are allowed spaces inside this part: (title, by, on, message) try: (title,by,on,message)
-
Finding "most searched for" in mysql table.
GingerRobot replied to dagnasty's topic in PHP Coding Help
[code] <? <?php $sql = mysql_query("SELECT * FROM `your table`"); while($row = mysql_fetch_array($sql)) { $search[$row[searchterm]]++; } print_r($search); ?> [/code] With the data i chucked in to test this, outputted Array ( [dog] => 3 [cat] => 2 [rabbit] => 1 ) -
Add an or die statement: $query = mysql_query("INSERT INTO `news` (title, by, on, message) VALUES('$title','$by','$time','$message')") or die(mysql_error()); So we can see if that is the problem.
-
Do you know how to use it? You will need to log into it and create the tables. You may well have problems for a while though because you do not know all the fields and types the script requires. Brown2005 is right, your best bet would be to contact the person who gave you the script.
-
Well what happens? And also, you might wanna edit out your database username and password.
-
What is the error?
-
You are missing the terminating single quote here: OR skill3 LIKE '%$select_search%) should be OR skill3 LIKE '%$select_search%')
-
newbie Q: Need to make and display link + page in Database
GingerRobot replied to t.bo's topic in PHP Coding Help
Well you have to query the database to get the IDs that you want e.g. [code] <? $sql = mysql_query("SELECT * FROM `yourtable'"); while($row = mysql_fetch_assoc($sql)) { $title = $row['titlefield']; $id = $row['idfield']; echo "<a href='page.php?id=$id'>$title</a>"; } ?> [/code] And then on "page.php": [code] <? $id = $_GET[id]; $sql = mysql_query("SELECT * FROM `yourtable` WHERE and `idfield`='$id'"); then grab the information you need and display it. ?> [/code] You will have to modify the table and field names. -
Well you will have to create the tables to be able to use the script, do you have access to phpMyAdmin?
-
You'll want to make the pattern: $pattern = '/\s\[evilgrin\]\s/is'; the \s i added means any whitespace character. for information on the modifiers, look at the manual: http://uk.php.net/manual/en/reference.pcre.pattern.modifiers.php
-
Its not something i can do for you. Did you create the database with the table in? If so how did you create it, did you use phpMyAdmin?
-
Could you not include a password in the php file and have that as one of the inputs on the form?
-
Are you sure you've selected the right table? It says the table "images" doesn't exist.