![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
mikefrederick
-
Posts
247 -
Joined
-
Last visited
Never
Posts posted by mikefrederick
-
-
When you setup mysql on your pc, when do you setup the password? I.E. the password I connect with using mysql_connect
-
he didnt misunderstand your question...if you do it his way just run an if statement.
if($date=$tomorrow) { echo 'Due Date: Tomorrow'; } else { echo 'Due Date: '.$date; }
-
youre basically there...
$memberid=$_SESSION['SESS_MEMBER_ID'];
$qry="SELECT * FROM members WHERE member_id='$memberid'";
$sql=mysql_query($qry);
$results=mysql_fetch_assoc($sql);
echo $results['member_id'];
echo $results['firstname'];
and so on
-
mysql_real_escape_string
-
i have a search script located at http://sites.loado.com/notestock/friendsearch.php
You will see that if you slowly type in names of colleges that each letter will change colors, but if you don't do it slowly a lot of times if only does it every couple of letters and you will have typed in letters that don't change. This is my php code
that the AJAX reaches for:
<?php if(isset($_GET['getCountriesByLetters']) && isset($_GET['letters'])){ $bar = $_GET['letters']; $replace[0]="-"; $replace[1]="the "; $replaces[1]=""; $replaces[0]=""; $bar=str_replace($replace,$replaces,$bar); $replacee[0]=" of "; $replacee[1]=" in "; $replacess[1]=" "; $replacess[0]=" "; $bar=str_replace($replacee,$replacess,$bar); $x=explode(" ",$bar); $search = "WHERE name LIKE '%" . implode("%' and name LIKE '%", $x) . "%' "; $res=mysql_query("select * from schools " . $search . " order by name limit 7"); while($inf = mysql_fetch_array($res)){ $t=$inf["name"]; foreach(explode(" ",$bar) as $x) $t= str_replace($x,"<span class='searched'>" . $x . "</span>",$t); echo $inf["id"]."###".$t."|"; } } ?>
any ideas on better optimization strategies? maybe it is dumb to add a span class to each letter
-
ya me neither, just don't know where to start.
-
I need a script to convert the common file formats to .FLV so that I can make a flash player like the ones used in YouTube and Veoh. I don't know how they convert automatically....I would love to use php is possible. Any help?
-
I want to make a video player in flash and I know a fair amount of actionscript but Have no idea where to get started as far as making a flash player. Anyone know where I should start? I want it to interact with variables from php eventually.
-
i read it, in other words theres no way to do so without turning that off?
-
when i enter an apostrophe into an input form it comes out with 3 slashes before it. i know i can escape the slashes afterwards, but is there a way to enter them in a way that will allow get rid of the slashes before they are sent away?
-
Is it really necessary to sanitize post variables? I guess it's good to be cautious of XSS and whatnot, but it seems like a paranoid practice. What is a good method of sanitizing post variables?
-
couldnt get it, i just made the function an external javascript and thereby removed a bunch of quotes
-
i tried without success:
<?php $descr.=substr(htmlentities($fetchdates['description']),0,100)."..."; $descr.=<<<TEST <a class='readmore' href='javascript:void(0);' onclick='window.open(\'events_view.php\',\'Events View\',\'width=300, height=300, scrollbars=no\');'>(read more)</a>; TEST; }
-
sure....
<?php if($desclen>100) { $descr.=substr(htmlentities($fetchdates['description']),0,100)."..."; $xx="<a class='readmore' href='javascript:void(0);' onclick='window.open(\'events_view.php\',\'Events View\',\'width=300, height=300, scrollbars=no\');'>(read more)</a>"; $descr.= addslashes($xx); } else { $descr=htmlentities($fetchdates['description']); } ?>
i have a link that onmouseover uses the overlib function:
<a href="calendar.php?id=<?=$fetchdates['id'];?>" onmouseover="return overlib('<div align=\'center\' class=\'boxtitle\'><?=$fetchdates['title'];?></div><div class=\'times\'><?=$times;?></div><div class=\'boxmain\'><?=$descr;?></div><div class=\'boxtype\'><?=$type;?></div>', STICKY, 'refmark<?=$date;?>', ANCHORALIGN, 'UR', 'UR', CAPTION, '<?=$topofbox;?>');" onfocus="this.blur()"><?=$fetchdates['title'];?></a>
-
i tried addslashes and the code looks correct in a browser, it has \\\ before the third level apostrophe's, but a new window doesn't open so i dont know...
-
if i did what the conker said it would end the function with the first '.
phpsensei i don't really understand the heredoc method, could you help me out a bit more
-
I cannot figure out how to do the slashes on $xx for this:
onmouseover="return thistitle('<div align=\'center\' class=\'boxtitle\'><?=$xx;?></div>');"
$xx="<a class='readmore' href='javascript:void(0);' onclick='window.open(\'events_view.php\',\'Events View\',\'width=300, height=300, scrollbars=no\');'>(read more)</a>";
Basically it is third level apostrophes I need to figure out...I tried the heredoc method, couldn't figure it out...any help is appreciated. Maybe addslashes? I dont know.
-
Not positive what you want either but:
$refer=$_SERVER['HTTP_REFERER']; //referring URL
if(substr_count($refer,'searchingforstring')>0) { //if your string is found in the URL
run commands;
}
-
The get variable consists of what comes after the ? in the URL. So:
$page=$_GET['url'];
if($page=='about') {
run commands;
}
elseif($page=='jobs') {
more commands;
}
etc. Notice also that I used == and not =.
-
Since this is a PHP board I figure it is a good place to ask if anyone has used ASP or ASP.net on a linux server and if so how can I throw it on my server?
-
and also i don't want to do error_reporting(0)...just want to turn the header error off.
-
by the way i know you can use error_reporting I just never have and don't know the specifics of the function
-
I have come across a rare case in which it is understandable that a headers already sent error occurs, but I need the code to remain as is. I would explain further but it is intricate...
Is there anyway to make it so that the warning does not show up on the page?
-
anybody know of a good wiki type of script? i dont need users to be able to edit pages but i want the page submission, admin approval of submission (might have to do this myself), etc.
using mysql locally
in PHP Coding Help
Posted
also if you are on the comp it is installed on is the host always localhost?