
peuge
Members-
Posts
80 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
peuge's Achievements

Member (2/5)
0
Reputation
-
Just saying that he wanted a checkbox. And why use a link in a form when you can use what is there for you, a nice checkbox. Also IMO Javascript and PHP both have their uses (server/client), a script like this is hardly clutter. You would also have to add another link to undo leave a comment. "does not matter will work, invent your own not copy. how will you ever learn? real programmers dont copy and past do they?" "this is a clone" -> Is that not copying? Anyways was not being rude and didn't want to start an argument, just giving options to do it, I did not copy the other pages javascript so yes "real programmers don't copy and past".
-
You also have to give your input a value="image"
-
The above will work, except in the page quoted they use check boxes, so echo "<br><br><a style='text-decoration: none; color: #000000;' href='{$_SERVER['PHO_SELF']}?cmd=comment'>Leave a comment?</a>"; will come out as a link with no checkbox? Also they dont use buttons, its checkboxes.
-
These addresses are sending variables via the GET method. Therefore if in index.php you do something along the lines of: ADDRESS: www.site.com/index.php?x=1&y=2 $x = $_GET['x']; $y = $_GET['y']; echo $x; echo $y; It will output 12 You can use it alot in <a href="index.php?variable=<?php echo $variable?>"> Hope this helps
-
Calling PHP function on Javascript events e.g onchange
peuge replied to rm_phpfreaks's topic in PHP Coding Help
I find the quickest way is to create an empty iframe, no one will be seeing this, set it to 1pxx1px. Make a php file with only your function in it. Then make a javasctipt function: function fName(var){ var objIframe = document.getElementById('Your iframe id'); var url = 'function.php?variable='+var; objIfram.src = url; } Then in your function.php get your variables. $variable = $_GET['variable']; Then just call your javascript function. Of course you can send it many variable and just add those into the function declaration and then also add then into your url: url= 'function.php?var1='+var1+'&var2='+var etc etc This is only for processing things like database inserts and stuff which does not require display. also your html must be: <input name="" name="" type="text" onChange="fName(this.value);"> If you do want to display stuff then you can expand the iFrame, but then you using iFrames -
In your contact form you need to create and empty <tr> or <div> whichever you using. and give it and id of anything you wish. Your actual check box must also have an id. You have a javascript function: function onCheck(){ var objComment = document.getElementById('your comment checkbox id').value; var objCommentBox = document.getElementById('your comment box td/div id'); var commentArea = new textArea; if (objComment == true){ objCommentBox.appendChild(commentArea); } else{ objCommentBox.removeChild(commentArea); } } Then once you submit just use a $_POST['you comment box id'] to get the input data Have not checked the code, but hopefully you get the idea. Peuge
-
Hi all, I have a small app, which takes a users input from a textarea, what I am doing is using javasctipt onkeyup to update a preview area by sending the new data to preview.php, the problem is that if a user presses 'enter' my preview.php file is not picking up those line breaks up? All other text is fine I have tried using these: $text being the get variable. //THIS echo nl2br($text); //AND THIS - with \r \n and \r\n $textArr = str_split($text,1); foreach ($textArr as $text){ $text = ($text == '\r\n') ? $text = '<br/>' : $text = $text; echo $text; } I do not need to preserve copy and paste text, just when a user is simply typing in the textarea Any help much appreciated
-
None of the imagecopy* functions work. I did not try imagecopymerge before, but it also does not work. Does anyone know why this might be? What basically happens is it just zooms in on the portion of picture I have selected and puts it into the destImg? All I want to do is take a part of an image and put it into another image. Any help appreciated. Thanks
-
Hey all, So I have a picture and when I click on it a crop box appear and I select the area I want to crop from the picture. Once this is done I click the crop button and that sends the co-ordinates of my selection via JSON to a php file found below. I have checked that all the values that are being sent are correct. My problem is that when I crop it does not crop it instead zooms into the picture. I am new to GD but could anyone please help. Thanks. I have also tried all the other imagecopy commands and they dont work. header('Content-Type: image/png'); $coords = json_decode(stripslashes($_GET['coOrds'])); $filename = "beach.png"; //The values below are from the crop box used on the original picture ($filename) $x1 = $coords[0];//top left hand corner $y1 = $coords[1];//top right hand corner $x2 = $coords[2];// bottom right corner $y2 = $coords[3];//bottom right corner $width = $coords[4]; $height = $coords[5]; $canvSize = getimagesize($filename); //size of original picture $source = imagecreatefrompng($filename); $newImg = imagecreatetruecolor($width,$height); imagecopyresampled($newImg, $source, 0,0, $x1, $y1, $width, $height, $width, $height); imagepng($newImg);
-
Hey there, What does the % sign do in php? For example: (From ZenCart): define('EMAIL_TEXT_INTRO', 'Your friend, %s, thought that you would be interested in %s from %s.'); Much Thanks
-
Hey all, 1)Can someone please explain what the % sign does. For example: define('EMAIL_TEXT_INTRO', 'Your friend, %s, thought that you would be interested in %s from %s.'); 2)What does the $column_box_default do and where is it set? 3) Here is my major question. Just been messing around with ZenCart and wondering how this works? includes\modules\sideboxes\tell_a_friend.php Am I correct in saying that the above file requires the tpl_tell_a_friend.php file? Then what does this do? require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); includes\templates\template_default\sideboxes\tpl_tell_a_friend.php In this file it creates the form, and am I correct that it sends the email address to the page below? If not then where does it send it to? And if so then please explain where the actual email is sent? What file? includes\languages\english\tell_a_friend.php Thanks for any help
-
lol also didnt see that thanks for the help!
-
No problem, thanks. But now still getting the Fatal error: Cannot access empty property in C:\xampp\htdocs\zaart\gal_class.php on line 41 on this line: $this->$arr[$count] = $count;
-
Cool thanks. Been away from php for a while now, so gotta get with the new stuff. I am now getting this error? Parse error: syntax error, unexpected T_AS, expecting ';' on this line for (range(0,10) as $count) {