Jump to content

alphanumetrix

Members
  • Posts

    167
  • Joined

  • Last visited

Everything posted by alphanumetrix

  1. The sleep(); function has to come before the echo statment. The parser cascades the file from top to bottom as it reads it. - like CSS. Try this: <?php sleep(5); echo "test199"; ?> flush(); shouldn't be necessary.
  2. You should probably add your form, too. It might not be a PHP error so much as an error in variables between the form and script. In the meantime, you should probably change this line to what's below: if ( empty($title) || empty($content) ){ it's more proper that way.
  3. personally, i didn't know you could use unlink on images (never bothered trying it - makes sense though). try this: unlink("userfiles/image/".$photourl); I think you just wrote the string wrong. If that doesn't work, you might want to try this, too: unlink("userfiles/image".$photourl); You might not need the tailing slash, as your url already has it, or the server puts it in automatically in a string.
  4. Is that the only code you're using? You're not trying to write a file with that by chance, are you? That's the only thing I can think of that would give you that kind of error. My code should have worked perfectly. I tested it and everything. this code should have worked the way you want it. the only other option to make it more smooth i can think of is using javascript. if you use that, you probably won't get those \"\ errors anymore. (I don't really know javascript though, so I can't help with that).
  5. try using AND: where t.forum_id!='46' AND t.forum_id!='47' AND t.forum_id!='48'
  6. no... it's not necessarily complicated, but it's not so easy either. at least it is for me, because i haven't use wordpress. i don't know how this works entirely, but you should try this: function Themehave_random_posts(){ global $wp_query, $shortname, $theme_queryRandom, $wpdb, $cx, $showedPosts, $ids; if(!$theme_queryRandom){ $show = (int)get_settings($shortname."_randomCategoryPosts"); if(!in_array($show, $ids)) $ids[] = $show; $catiwant = 'my category'; // put your category in the apostraphies... $theme_queryRandom = new WP_Query('category_name='.$catiwant.'&orderby=rand&showposts=1'); } $aux = $theme_queryRandom->have_posts(); if(get_the_ID()) $showedPosts[] = get_the_ID(); return $aux; }
  7. this should do what you want: <?php if ($_POST['submit']) { $type = $_POST['fieldtype']; $name = $_POST['fieldname']; if ($type == 'Text Field') { echo '<input type="text" name="'.$name.'" />'; echo '<p>view code:</p>'; echo '<textarea cols="60" rows="5"><input type="text" name="'.$name.'" /></textarea>'; } if ($type == 'Text Area') { echo '<textarea cols="5" rows="4" name="'.$name.'"></textarea>'; echo '<p>view code:</p>'; echo '<textarea cols="60" rows="5"><textarea cols="5" rows="4" name="'.$name.'"></textarea></textarea>'; } if ($type == 'Radio Button') { echo '<input type="radio" name="'.$name.'" />'; echo '<p>view code:</p>'; echo '<textarea cols="60" rows="5"><input type="radio" name="'.$name.'" /></textarea>'; } if ($type == 'Checkbox') { echo '<input type="checkbox" name="'.$name.'" />'; echo '<p>view code:</p>'; echo '<textarea cols="60" rows="5"><input type="checkbox" name="'.$name.'" /></textarea>'; } echo '<p><a href="form.php">Try again</a></p>'; } else { echo '<form name="makeformfield" method="post"> Field Name: <input type="text" name="fieldname"> Field Type: <select name="fieldtype"> <option>Text Field</option> <option>Text Area</option> <option>Radio Button</option> <option>Checkbox</option> </select> <input type="submit" name="submit" value="submit"> </form>'; } ?>
  8. I have to go, but I have a piece of code I wrote from before that might be helpful to you: $sql="INSERT INTO ".$releasestable." (series, type, chapter, language, scanlator, download1, download2, download3, notes, owner, video) VALUES ('$_POST[series]', '".$aomvar."', '$_POST[chapter]', '$_POST[language]', '$_POST[scanlator]', '$_POST[download1]', '$_POST[download2]', '$_POST[download3]', '$_POST[notes]', '".$usersname."', '$_POST[video]')"; seems mysql can use arrays... though, that code above still won't fix your problem, you may be able to figure something out with that theory.
  9. You could keep writing them out. or maybe you can do something like this... but I've never had this problem, and I'm not sure how it would work. $datas = array ('$_POST['data']', 'etc...'); $fields = array ('field1', 'field2'); $wheres = array('whereatfirst', 'whereatsecond'); foreach ($datas as $d, $fields as $f, $wheres as $w) { $sql="UPDATE ".$table." SET ".$f."='".$d."' WHERE field='".$w."'"; mysql_query($sql,$link) or die( 'Error: ' . mysql_error() ); mysql_close($link); } I honestly don't know if that would work, and I just added the where's as a second; if you don't need that, you don't need that.
  10. You could do it easily using PHP. If you send me an email, I can help you out: info@akatsukidesigns.com A basic setup of the code would be like... <form> echo ' choose field type... <select name="whatever"> <option>Radio</option> <option>etc...</option> </select> <input type="submit"> </form>'; if ($_POST['submit']) { $whatever = $_POST['whatever']; if ($whatever = 'radio') { // the radio field } } Instead of "if" statements, you could always use case statments.
  11. You problem is right where it says, line 36. You can't declare php inside a variable string as you did below: elseif($type == "edit") { $text = "<?php if($user_id = '$own_id') { Rewrite it to where the whole page is PHP, and don't cut it up so much.
  12. I'm actually working with a company who's developing a CMS similar to that. We're going to be releasing it to the public soon, but it probably won't be for a month or so... If you send me an email: info@akatsukidesigns.com - I can send you an email when its released and let you know where to get it.
  13. I didn't bother to read your code, but a simple SQL query to update a MySQL database would be as follows: // $link - would of course be your database connection $data = $_POST['data']; $sql="UPDATE ".$table." SET field='".$data."' WHERE field='whatever'"; mysql_query($sql,$link) or die( 'Error: ' . mysql_error() ); mysql_close($link);
  14. thanks. i'll revise it after I finish it though. I'm going to try to work on it later today.
  15. i'm pretty sure cron jobs is basically where you put ads on your site and earn credit for it. has nothing to do with php.
  16. please give an example of your code.
  17. try this: $getthreads="SELECT * from forumtutorial_posts where parentid='0' AND `area`= 'math' order by lastrepliedto DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); $name = strip_tags($getthreads3[post]); if (strlen($name) > 20){ while (strlen($name) >6){ $name = substr($name,0,-1); } } print "<div style="position:static; float:bottom;" <tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</a></td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td> <b>$getthreads3[lastposter]</b></tr></br> $name </td>"; } print "</table></div>"; ?>
  18. maybe try making it a little less bland. you could start by maybe making the content area a different color instead of white, which blends into the background.
  19. thanks. for some reason, i always do really good with dark colors. unfortunately though, i've been trying to avoid it (using them was more of a last-resort). in fact, i started this one with lighter colors (didn't turn out too well). not sure what you mean by this. I was thinking of dropping the bottom sphere, and just putting more content there, or maybe even a flash, commercial-like video. i didn't want to over-use the white. i'll try it out though. very cool. i didn't know about this. i always wondered how people put those huge, high-quality images on sites, and still managed to load them fast. i only use tables for layouts when i have high-images. it was faster just to click a button and make a table than writing out 16 or so <DIV> tags. now that i know of this smush.it thing, i won't need to anymore. thanks. i just fixed most of my CSS. I have two errors left; i'm not sure how to fix them: do you have any ideas? What browser did you view them in? The font I'm trying to use isn't showing up in IE or FF. It's only working in Safari. I wanted to use a custom font for those this time, so I googled a CSS code for it. Here is what I'm using: @font-face { font-family:"futura_lt"; src:url(http://akatsukidesigns.com/beta/themes/default/futura_lt.ttf) format("truetype"); } div#some_element { font-family: futura_lt; } It's working for Safari perfect, and the font looks really good, in my opinion. It just isn't working for the other browsers. I haven't any ideas how to go about fixing it either. thanks a lot for the wisdom.
  20. I just validated my site for xhtml. I had a <center> problem, but that's it. I fixed it, and now I'm valid. lol I even put that image link at the bottom of my site.
  21. I added my new design. Here's a link to the topic: http://www.phpfreaks.com/forums/index.php/topic,238936.0.html
  22. Okay. I've been working on it, and it's primarily together now. Here is the new layout for my site: http://akatsukidesigns.com/beta - I spent a lot more time on this one (especially with thinking of a good design - spent a good two-three hours thinking about it before I even started). Overall, I spent a good 10 hours on this (just about all of yesterday). What do you think? Feel free to criticize. Some things I personally don't like about it: there is about 300kb of images - that's a lot i didn't make a lot of content room - mostly 'cause i couldn't decide if i wanted a lot. ----- I decided to put my own font on the site (using CSS); however, it's only working well in Safari. Anyone know why this might be? Oh, and I didn't finish this yet; i've still to do some CSS bridging, so if it doesn't render well for you, please let me know what browser and version you're using. I didn't validate it yet either, so no criticism on that yet. thanks to Maq, jcombs_31, and nrg_alpha for inspiring me to make a new one.
  23. I would do it with CSS, but that's just me. I use CSS for probably 98% of my design (whether it be adjusting a small font, or making a floating DIV). Not at all. this is fun. lol I always put my HTML in php, unless I'm writing a big paragraph or something. It's good practice with reading it for me. I also put little notes all through it; it makes me feel cool. lol IE: // Initiate body... // Show header...
  24. You should perhaps get into the habit of passing your site through the W3C validators to see what problems it reports. Things to consider regarding validation. In truth, you don't have as many errors as it says.. typically, one error can cause a chain reaction. So perhaps instead of 75, you might only have 5 or 10 (just pulling numbers out of my rear here..point being, don't be terribly discouraged by the actual amount reported, but rather where the errors are in your code). Errors don't necessarily translate into broken page components. However, broken code leaves the browser to interpret. Who's to say that in a future browser release, internal algorithms won't start 'interpreting' things different from how it does now, thus potentially breaking something in your page? If you are going to be servicing people with building sites, as a matter of principal and good coding practices, it would be of benefit to conform to W3C compliances. It's your call of course. Do what you want. But Flash should be carefully weighed. While the 'lure' of Flash may be strong, understand that once the novelty wears off, it may annoy people more than impress them. IMO, flash is over rated. Used in small, non intrusive doses can work perfectly fine.. but if a site starts to rely on it too heavily, it becomes a crutch of sorts. Again, from my personal standpoint, I prefer clean (x)html with perhaps some subtle javascript (for non critical components). Hmm.. if you are going to present yourself with your best foot forward, perhaps spending more than 10 minutes on splash page would be in your (and your prospective clients) interest. I would personally axe the splash page in its entirety, and just go to the meat and potatoes homepage that descibes what you do (given your target audience is potential clients). Impress them with a strong mission statement? Perhaps find ways to include additional credibility to your home page. Since your goal is to entice people to go with you for web design, something more appealing than an HTML / Flash version would be more appropriate. I started on my design for the new HTML version. Now that I see it, I think I'm going to trash the flash version as you suggested. It's much better than both of them, so there's no point anymore. When I finish the layout, I'll be sure to post it here, asking for critiques again. I always seem to work better when people keep nagging me about my work (not that you're nagging - just a figure of speach). Just a hobby. I enjoy those ten minutes.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.