Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

168 Neutral

About jon723

  • Rank
  1. I took a screen shot of the error I get from Firebug when I'm in Firefox and hovering my mouse over the first image.
  2. Quote:Original post by Feralrath Quote:Original post by Hodgman Secondly, you're still sending PHP code to the browser^^^ No hes not, the php code with be replaces by the server with the value that is to be echoed. the php will never reach the browser, his code on that point is fine. as for the problem there is no need to nest the php tags just escape the string like so echo "javascript:imageWindow = window.open(\"\",\"Test\", \"width=300, height=300,scrollbars=yes\");"; echo "imageWindow.document.writeln(\"", createThumbs($var); ,"\");"; The nested php tags are probably what is causing the error. also on this line I'm using Dreamweaver's Spry and when using XML dataset's you can reference attributes and tags by referencing the element in the XML file by using "{tagname}". When the html is parsed Spry does the job of filling in the correct data for the tag (the xml is flattened into a big array/table of values). If you want to see how I'm using it here is the page it's being used. (The first image under Newark is what's breaking things since it's the one im using as a test)
  3. I apologize, my first post was incomplete. I'm calling the code from an anchor tag which then calls the php which calls the javascript. Here is the complete example: <?php function createThumbs($var) { if ($dir = opendir($var)) { printf("<table>"); while(($file = readdir($dir)) !== false) { if ( preg_match("/\.(jpg)$/", $file)) { $currFile = $var.'/'.$file; printf("<tr><td><img src=\"%s\" /></td></tr>", $currFile); } } printf("</table>"); closedir($dir); } else { echo 'Cannot open directory ' . $var . '<br />'; } } function showThumbs($var) { echo "javascript:imageWindow = window.open(\"\",\"Test\", \"width=300, height=300,scrollbars=yes\");"; echo "imageWindow.document.writeln(\"<?php createThumbs($var); ?>\");"; } ?> <a href='<?php showThumbs('{gallery}'); ?>'"><img src="{@image}" border="0" alt="House Image" /></a>
  4. I'm attempting to open a window and then print some information to that window using php echo statements. When I click the link that calls the function I get an error that says I'm missing an ")" at the end of the argument list. I don't know where I'm going wrong but from the looks of things I have the right about of parenthesis. echo "javascript:imageWindow = window.open(\"\",\"Test\", \"width=300, height=300,scrollbars=yes\");"; echo "imageWindow.document.writeln(\"<?php createThumbs($var); ?>\");"; Can anyone see an error with this statement?? Jon723
  5. Ok, frustration is setting in. I've replaced the code I was using with the function you suggested. While the redirect "is" working, the messages I print to the screen aren't being displayed. I added a delay to the refresh call but stuff is just not cooperating. Hopefully a second pair of eyes can see what I'm doing wrong. Jon [SOURCE] <?php function pageRedirect() { if(!headers_sent()) { header('Location: '.$_SERVER['HTTP_REFERER']); exit; } else { echo("<script type='text/javascript'>"); echo(" window.location.href='".$_SERVER['HTTP_REFERER']."'"); echo("</script>"); echo("<noscript>"); echo(" <meta http-equiv='refresh' content='3;url=".$_SERVER['HTTP_REFERER']."' />"); echo("</noscript>"); exit; } } ?> <?php if(isset($_POST['submit'])) { $subject = "Contact Form"; $name_field = $_POST['name']; $number_field = $_POST['number']; $body = "From: $name_field\n Phone#: $number_field"; if(($name_field == "") || ($number_field == "")) { echo 'You must fill out both fields' . "<br />"; pageRedirect(); } else { echo "Form has been submitted."; pageRedirect(); } } ?> [/SOURCE][/source]
  6. Hey thanks for you replies. I tried using the function in place of the one I had and it still doesn't work in IE. Also, I would like to refrain from using absolute URL's since the site I'm working on is still in development and the absolute URL isn't the actual URL I'm using while testing.
  7. Hello everyone, I have a function I'm using to redirect the user to the previous page after they submit some data to a form. When I'm testing in firefox and safari the page is redirected like it should but when testing in IE it attempts to redirect but ends up staying on the same page. This is the PHP I'm using to redirect: function pageRedirect() { if(!empty($_SERVER['HTTP_REFERER'])) header('Refresh: 3,URL="'.$_SERVER['HTTP_REFERER'].'"'); else echo '<script type="text/javascript">setTimeout("history.go(-1);",3000);</script>'; } else { echo "Form error"; } } Does anyone know how I can get this to work in IE?? Jon
  8. Hello everyone, I've recently been using php to load some content into a div section of pages I'm creating. The way I'm doing things, I have an outer div which has a background image I'm using to tile a border image I'm using. This div has an inner div which has the php content loaded into it. For some reason, the php that is loaded isn't stretching the height of the outer div which has an 'auto' height. The inner div has a default height of 300px. This is the url of the page in question, does anyone have a solution to this problem: http://homeadvantagenj.com/NewSite/contactus.php Sincerely, Jon
  9. Hello everyone, I'm in the process of creating a pretty extensive website and one of the features that I need to implement is a type of "index" page that list's a bunch of links based on some html pages I have in sub-directories on my web server. What I need to do is, scan a directory and for each html file, open the file and extract the title (using the HTML DOM) so that I can dynamically create a link based on the location and the title of the file (this part seems straight forward). My question is how would I go about scanning a directory so that I can scan a file, is there a specific web technology I can use (php, asp, java script, prayer)? Jon
  10. I'm trying to dynamically write a form on a page I am creating. When I call the javascript from my html document the elements aren't being written. Could someone tell me what I'm doing wrong?? // JavaScript Document var resTitle = "Site Resource"; // this will get changed to the name of the resource var netID = "testID"; // change this id to the id where the email will be sent to. function generateForm() { resTitle = this.document.getElementById("resourceTitle").innerHTML; if(!resTitle) { resTitle = "Site Resource"; } this.document.writeln("<form method='post' action='https://www.lefthandinteractive.com/mytest.cgi'>"); this.document.writeln("<input name='netid' type='hidden' value='", netID,"' />"); this.document.writeln("<input name='subject' type='hidden'", "value='", resTitle, "' />"); this.document.writeln("<input name='required' type='hidden' value='email' />"); this.document.writeln("<span style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;'>Email:</span><span style='color:#FF0000; font-size:9px; font-family:Verdana, Arial, Helvetica, sans-serif;'>(Required)</span><input name='email' type='text' value='' size='30' maxlength='60' /> <br /><br />"); this.document.writeln("<span class='formtext' style='font-weight:bold'>How would you rate this resource?</span><br />"); this.document.writeln("<input name='rating' type='radio' value='1' /><span class='formtext'>1 (lowest)</span>" ); this.document.writeln("<input name='rating' type='radio' value='2' /><span class='formtext'>2</span>"); this.document.writeln("<input name='rating' type='radio' value='3' /><span class='formtext'>3</span>"); this.document.writeln("<input name='rating' type='radio' value='4' /><span class='formtext'>4</span>"); this.document.writeln("<input name='rating' type='radio' value='5' /><span class='formtext'>5 (highest)</span><br /><br />"); this.document.writeln("<span class='formtext' style='font-weight:bold;'>How did you learn about this website?</span><br />"); this.document.writeln("<input name='reference' type='radio' value='Through a search engine?' /><span class='formtext'>Through a search engine?</span><br />"); this.document.writeln("<input name='reference' type='radio' value='From a colleague?' /><span class='formtext'>From a colleague?</span><br />"); this.document.writeln("<input name='reference' type='radio' value='From another webpage (which one?)' /><span class='formtext'>From another webpage (which one?)</span><input name='reference' type='text' value='' size='30' maxlength='60' /><br />"); this.document.writeln("<input name='reference' type='radio' value='From a teacher?' /><span class='formtext'>From a teacher?</span><br />"); this.document.writeln("<input name='reference' type='radio' value='Other (please specify)' /><span class='formtext'>Other: </span><input name='othSource' type='text' value='' size='30' maxlength='60' /><br/><br />" ); this.document.writeln("<span class='formtext' style='font-weight:bold;'>Comments:</span><br />"); this.document.writeln("<textarea name='feedback' rows='4' cols='32'></textarea><br />"); this.document.writeln("<input type='submit' value='Send the form' />", "<input type='reset' value='Reset the form' />"); this.document.writeln("</form>"); }
  11. Hey, thanks for both of the replies. I've read the nehe article before, but I wasn't exactly sure how to mold it into the vector solution I was using. I'll definitely take your suggestions into account. Thanks again.
  12. Greetings everyone, I've had my .Obj file loader working for a really long time under immediate mode rendering. I really want to move away from the slow immediate mode calls for sending vertex data through the pipeline and I figured that I should first get my code to work using vertex arrays and then ultimately VBO's. The following is the structure that defines my vertex data and my model data. I use std::vectors to append data but I'm not entirely sure how to deference a vector when specifying the vertex data when creating the vertex array in opengl. Can someone give me some insight as to what I should do in order to get vertex arrays to work? struct sVertex3d { sVertex3d(); float vertex[3]; }; // a single texture coordinate struct sTexCoord { sTexCoord(); float coord[2]; }; // a single triangle normal struct sNormal3d { sNormal3d(); float normal[3]; }; struct sFace { sFace(); vector<int> vertlist; // the vertices that make up this face vector<int> normlist; // the list of normals that make up this face vector<int> texcoordlist; // the list of texture coordinates that make up this face vector<int> combined; // the combined indices for this face string material; // which material does this face use }; class ObjModel { public: ObjModel(); ~ObjModel(); bool LoadModel(char *fname); bool LoadMtl(char *mtlfilename); // loads a material library file sMaterial *FindMatByName(string name); // searches the array of materials by name and returns the matching material void Draw(); // draw the geometry for the model protected: int numObjects; // the number of objects that make up this model string filename; // the name of the obj model file sObject *objects; // the list of objects that make up the model int numVerts; int numTexCoords; int numNormals; int numFaces; sVertex3d *pvertices; // array of vertices in the model sNormal3d *pnormals; // array of normals in the model sTexCoord *ptexcoords; // array of texture coordinates in the model sFace *pfaces; // array of faces in the model. Faces have indices into the normals, texture coords, and vertex lists // map<string, sMaterial> mats; // the list of materials from all of the material libraries };
  13. jon723

    Warmup for tomorrow's integration

    What exactly are you talking about?
  14. jon723

    simple effects on triangles

    Well the technique I'm speaking of would require you to render the model twice (once as filled polygons and a second time at lines).
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!