Jump to content

shimano55

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

About shimano55

  • Birthday 09/17/1990

Contact Methods

  • AIM
    aomshimano55
  • MSN
    phpshimano55@hotmail.com
  • Website URL
    http://

Profile Information

  • Gender
    Not Telling
  • Location
    Los Angeles, CA

shimano55's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Have the links contain the id of the category. For instance: [code]<a href='articles.php?catId=$cats['id']'>$cats['name']</a>[/code] have $cats be an array with the DB fields and values by using a while loop in conjunction with mysql_fetch_assoc(); Then on articles.php: [code]$catId = $_REQUEST['catId']; $q = mysql_query("SELECT * FROM cats WHERE id='$catId' LIMIT 1"); $cat = mysql_fetch_assoc($q); echo "You are currently viewing ".$cat;[/code] Does this help? -shimano55
  2. @css: Yes, but what if the news post has more than one paragraph? I'm making an admincp for the news posts. So I need it to be by just hitting the spacebar. As I said, the spaces are there in phpmyadmin. Is there no other way to accomplish this? Thanks, shimano55
  3. Is the malfunction detected around the mysql_query part? Because I am skeptical about ur url declaration. Otherwise, you usually have to escape single and double quotes. A good way to take care of this would be: [code]$filename = "Nirvana - Jesus Doesn't Want Me For a Sunbeam"; //notice the single quote $filename = mysql_escape_string($filename); //this will add slashes before quotes and other special chars [/code] That should do the trick if that's where the problem is. -shimano55
  4. Did you add the )???? Your code should look like: [code] // Performing SQL query         $query = "INSERT INTO nuke_audio_audio (title, url, artist) VALUES ('$arrArtistTitle[1]', 'http://www.dxcr.com/audio/tones/$filename', '$arrArtistTitle[0]')";         echo $result = mysql_query($query) or die('Query failed: ' . mysql_error());[/code] Is that how it looks? -shimano55
  5. Take out the single quotes around title, url, and artist. By the way, you also need to add another ) after '$arrArtistTitle[0]'.
  6. Well a for statement would make more sense for this situation. [code]$numBoxs = $_POST['boxes']; for ($i=1;$i<=$numBoxes;$i++) { echo "<textarea name='box".$i."' rows=5 cols=50></textarea><br />"; }[/code] This would make the number of text boxes and have them named box1,box2,box3,etc. As for adding them to a mysql database, that depends on how your database is built. -shimano55
  7. Hey everyone. I'm building a CMS and am working on the formatting of news posts. I have nl2br() to add breaks to the result, but I'm at a loss when it comes to indents. When I submit the news post, I use 5 spaces at the beginning, and I can see 5 spaces in the field on phpmyadmin. But when the result is displayed on the site, there are only the spaces in between words and sentences. No indent. This is my current format function: [code]function newsPost($post) {     return nl2br(htmlspecialchars($post));   }[/code] What do I have to add to it to get the ident spaces to show? Thanks in advance, shimano55
  8. Hey everyone. I need to know how to use php to change the value of a variable in my configuration file and resave the file with the variable having its new value. For instance, I want to change: [code] $var1 = 1; [/code] to [code] $var1 = 0; [/code] and then save the file with the new value for $var1. Thanks, shimano55
×
×
  • 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.