Masna
-
Posts
288 -
Joined
-
Last visited
Posts posted by Masna
-
-
Add ob_start() to the top of your script. Does mail() work now?
-
Turn error reporting on. Post here any errors that are printed.
error_reporting(E_ALL); //add this to the top of your script
-
function Hilight($val1, $val2){
$return = "";
if($val1 == $val2){
$return = " style='color:blue;'";
}
return($return);
}
echo("<option value='cat'><font" . Hilight("cat",$teach) . ">
cat
</font></option>");
...
The HTML source that's outputted. (I guess I had this coming to me.)
-
It was simply cat...nothing hilighted or background color.
Can you post the source code?
-
Unfortunately that didnt make a difference. Thanks for trying.
Can you post the output here?
-
Where is $email obtained from? (Also, the quotes used in the first three parameters of mail() are unnecessary.)
-
Try...
function Hilight($val1, $val2){ $return = ""; if($val1 == $val2){ $return = " style='color:blue;'"; } return($return); } php code: $teach = "cat"; echo("<option value='cat'><span " . Hilight("cat",$teach) . "> cat </span></option>");
-
$get_emails = mysql_query("SELECT * FROM `emails`"); while($row = mysql_fetch_assoc($get_emails)){ $curr_email = $row['emails_email']; $curr_count = mysql_query("SELECT * FROM `emails` WHERE `emails_email`='".mysql_escape_string($curr_email)."'"); $i = mysql_num_rows($curr_count); while($i > 1){ $del = mysql_query("DELETE FROM `emails` WHERE `emails_email`='".mysql_escape_string($curr_email)."' LIMIT 1"); $i--; } }
Run this once. This will delete duplicate entries in emails_email. (I suggest backing up first...)
-
$sql = "SELECT id,Subject FROM menusubjects"; $menu = mysql_query($sql); while($row = mysql_fetch_assoc($menu)){ echo $row['Subject']; if ($row['Subject'] == $menu_type) { $sql2 = "SELECT * FROM regularmenu WHERE menusubjects ='$menu_type'"; //line 54 $smenu = mysql_query($sql2); while ($srow = mysql_fetch_assoc($smenu)) { echo $srow['shoename']; } } } ?>
-
It has to do with your loops and if statements' arrangement
Orly?
-
hi,
when these fields are checked, I want the submit button to open the response.php page.
if it contains errors they will be fixed and if no response.php will open when clicked on it.
is it possible to do it?
Thanks...
I put this code, but it is wrong :S
<?php if (!isset($error['name']) && !isset($error['email']) && !isset($error['password']) && !isset($error['accept']) ){ }?> <input name="submit" type="submit" onClick="document.contactForm.action='response.php';" value="Submit">
Huh?
-
$string = "111/special-dominguez-2008"; $expl = explode("/", $string); echo $expl[0]; //will print '111'
-
$sql = "SELECT id,Subject FROM menusubjects"; $menu = mysql_query($sql); while($row = mysql_fetch_assoc($menu)){ echo $row['Subject']; if ($rod['Subject'] == $menu_type) { $sql2 = "SELECT * FROM regularmenu WHERE menusubjects ='$menu_type'"; //line 54 $smenu = mysql_query($sql2) //missing semicolon HERE <-- ERROR ERROR ERROR while (srow = mysql_fetch_assoc($smenu)) { echo $smenu['shoename']; } } } ?>
-
$file = array(); $title = array(); $description = array(); foreach($array['data']['item'] as $value){ //assuming your array is stored in $array $file[] = $value['file']; $title[] = $value['title']; $description[] = $value['description']; }
-
I tend to program most efficiently when I'm listening to music. It distracts that part of my brain that is seeking distractions (so as to keep throwing me off track), and I'm usually able to keep the work-oriented portion of my brain concentrated with the rest concentrated on the music.
-
It's not bad. It looks, for the most part, professional. It certainly gets the job done.
Though, I wouldn't be totally surprised if at least half of the users that first visit the site vow never to revisit because of the blinding purple rays coming from every direction.
-
Maybe make use of your own predetermined special character to join pieces of information:
fixture1=team1_5
Then, later on...
$fixture1_split = explode("_", $_GET['fixture1']); //now, $fixture1_split[0] stores "team1" and $fixture1_split[1] stores "5"
Hope this helps (though I'm not sure it will).
-
Just curious how does these polls works then,
I am attaching this News Paper Link just as an example, its is allowing to cast vote from 2 computers from one network.
http://www.deccanchronicle.com/
Thanks
Cookies.
-
thanks for quick reply,
I am attaching a part of script
<?session_start();
$uip=$_SERVER['REMOTE_ADDR'];
$query = "select pollId from pollanswers where pollId=1 and visitorIP='$uip'";
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
if ($numrows == 0){?>
<h2>Poll Of The Day</h2>
<form action="" name="poll" >
<?
$result=mysql_query("select * from pollquestions");
while($row_list=mysql_fetch_assoc($result))
<display Poll Questions / Options>
}
For Exp:
I have Casted vote and My External IP is 1.1.1.1 and to this external ip there 3 computers connected with internal ip.
How to allow others to cast the vote, hopefully I am expressing my question properly, if not I appologise.
Thanks
Well, unfortunately (as far as I know), there's no way to differentiate from devices connected locally to the same remote IP address. So, even if one IP address is consistent with ten local users (all in the same house, for argument's sake), once one of the ten voted, the other nine could not vote.
-
Does your server provide MySQL Database support? If so, I recommend reading up on MySQL: INSERT and SELECT queries.
And, you can retrieve a user's IP address at any time using the superglobal array "$_SERVER."
$ip_address = $_SERVER['REMOTE_ADDR'];
-
This works:
$query = "SELECT * FROM test1";
$result = mysql_query($query) or die (mysql_error());
But this throws up the error:
$query = "load data infile 'upload.csv' INTO TABLE test1";
$result = mysql_query($query) or die (mysql_error());
That probably means that the user "mobile" doesn't have the privilege to utilize the LOAD DATA INFILE syntax. Check the privileges on said user.
-
Yes, this is the error:
Access denied for user 'mobiles'@'localhost' (using password: YES)
Lol.
You have to use mysql_connect() to open a connection with the MySQL server associated with your site. Then, you have to use mysql_select_db() to select a database with which you'd like to interact.
Both of these must be used before you attempt to execute any MySQL queries.
Edit: I see that you actually have already implemented these two functions. So, the problem, clearly, is that your username and password credentials are collectively invalid.
-
Are any errors printed when the query is attempted to be executed?
-
thanks for the webiste, but I still need help ! :S
is there any link to put it in the other page in order not to display undifined name?
Huh?
somepage.html
<form action="otherpage.php" method="post"> <input type="text" name="name"> <input type="submit" value="submit"> </form>
otherpage.php
echo $_POST['name']; //will print whatever is inputted in the 'name' text field in somepage.html
[SOLVED] php validation
in PHP Coding Help
Posted